-void operator>>(const LexicalConverter &c, TextureFilter &tf)
-{
- if(c.get()=="NEAREST")
- tf = NEAREST;
- else if(c.get()=="LINEAR")
- tf = LINEAR;
- else if(c.get()=="NEAREST_MIPMAP_NEAREST")
- tf = NEAREST_MIPMAP_NEAREST;
- else if(c.get()=="NEAREST_MIPMAP_LINEAR")
- tf = NEAREST_MIPMAP_LINEAR;
- else if(c.get()=="LINEAR_MIPMAP_NEAREST")
- tf = LINEAR_MIPMAP_NEAREST;
- else if(c.get()=="LINEAR_MIPMAP_LINEAR")
- tf = LINEAR_MIPMAP_LINEAR;
+int Texture::swizzle_orders[] =
+{
+ GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA,
+ GL_RED, GL_RED, GL_RED, GL_ONE,
+ GL_RED, GL_RED, GL_RED, GL_GREEN,
+ GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA
+};
+
+Texture::Texture(GLenum t, ResourceManager *m):
+ id(0),
+ target(t),
+ ifmt(RGB8),
+ swizzle(NO_SWIZZLE),
+ auto_gen_mipmap(false),
+ default_sampler(*this)
+{
+ if(m)
+ set_manager(m);
+ else if(ARB_direct_state_access)
+ glCreateTextures(target, 1, &id);