-istream &operator>>(istream &in, TextureFilter &tf)
-{
- string str;
- in>>str;
-
- if(str=="NEAREST")
- tf = NEAREST;
- else if(str=="LINEAR")
- tf = LINEAR;
- else if(str=="NEAREST_MIPMAP_NEAREST")
- tf = NEAREST_MIPMAP_NEAREST;
- else if(str=="NEAREST_MIPMAP_LINEAR")
- tf = NEAREST_MIPMAP_LINEAR;
- else if(str=="LINEAR_MIPMAP_NEAREST")
- tf = LINEAR_MIPMAP_NEAREST;
- else if(str=="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);