};
-OpenGLTexture2D::OpenGLTexture2D(ResourceManager *m):
- Texture(GL_TEXTURE_2D, m)
+OpenGLTexture2D::OpenGLTexture2D():
+ Texture(GL_TEXTURE_2D)
{ }
void OpenGLTexture2D::allocate()
protected:
class AsyncLoader;
- OpenGLTexture2D(ResourceManager *);
+ OpenGLTexture2D();
void allocate();
void sub_image(unsigned, int, int, unsigned, unsigned, const void *);
namespace Msp {
namespace GL {
-Mesh::Mesh(ResourceManager *rm):
+Mesh::Mesh():
vbuf(0),
ibuf(0),
dirty(0),
disallow_rendering(false),
face_winding(NON_MANIFOLD)
-{
- if(rm)
- set_manager(rm);
-}
+{ }
-Mesh::Mesh(const VertexFormat &f, ResourceManager *rm):
- Mesh(rm)
+Mesh::Mesh(const VertexFormat &f):
+ Mesh()
{
storage(f);
}
std::string debug_name;
public:
- Mesh(ResourceManager * = 0);
- Mesh(const VertexFormat &, ResourceManager * = 0);
+ Mesh();
+ Mesh(const VertexFormat &);
~Mesh();
void storage(const VertexFormat &);
namespace Msp {
namespace GL {
-Texture::Texture(unsigned t, ResourceManager *m):
+Texture::Texture(unsigned t):
TextureBackend(t),
format(NO_PIXELFORMAT),
storage_fmt(format),
swizzle(NO_SWIZZLE),
use_srgb_format(false),
auto_gen_mipmap(false)
-{
- if(m)
- set_manager(m);
-}
+{ }
void Texture::set_format(PixelFormat fmt)
{
bool use_srgb_format;
bool auto_gen_mipmap;
- Texture(unsigned, ResourceManager * = 0);
+ Texture(unsigned);
void set_format(PixelFormat);
namespace Msp {
namespace GL {
-Texture2D::Texture2D(ResourceManager *m):
- Texture2DBackend(m),
+Texture2D::Texture2D():
width(0),
height(0)
{ }
unsigned levels;
public:
- Texture2D(ResourceManager * = 0);
+ Texture2D();
virtual ~Texture2D();
/** Defines storage structure for the texture. If lv is zero, the number
if(RefPtr<IO::Seekable> io = open_raw(name))
{
- RefPtr<Mesh> mesh = new Mesh(resource_manager);
+ RefPtr<Mesh> mesh = new Mesh;
+ mesh->set_manager(resource_manager);
resource_manager->set_resource_location(*mesh, *this, name);
return mesh.release();
}
if(ext==".tex2d")
{
- tex = new Texture2D(resource_manager);
+ tex = new Texture2D;
+ tex->set_manager(resource_manager);
DataFile::Parser parser(*io, name);
Texture2D::Loader ldr(*tex, *this);
ldr.load(parser);