X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcore%2Ftexture.cpp;h=c27e850676b83153de81ef09b4d76282e481e091;hb=3c0cbf0529aa06d9809ad3aa9e282400e8209b4d;hp=e607792c9dc6f50103c2bd30d195343d107976b3;hpb=b7ecc29c204faede028556d1942b2d61d5cda9ee;p=libs%2Fgl.git diff --git a/source/core/texture.cpp b/source/core/texture.cpp index e607792c..c27e8506 100644 --- a/source/core/texture.cpp +++ b/source/core/texture.cpp @@ -5,7 +5,6 @@ #include #include "error.h" #include "resourcemanager.h" -#include "resources.h" #include "texture.h" using namespace std; @@ -26,8 +25,8 @@ Texture *Texture::scratch_binding = 0; Texture::Texture(GLenum t, ResourceManager *m): id(0), target(t), - format(RGB8), - storage_fmt(RGB8), + format(NO_PIXELFORMAT), + storage_fmt(format), swizzle(NO_SWIZZLE), use_srgb_format(false), auto_gen_mipmap(false) @@ -109,7 +108,7 @@ void Texture::apply_swizzle() if(swizzle==NO_SWIZZLE) return; - if(get_gl_api()==OPENGL_ES2) + if(get_backend_api()==OPENGL_ES) { set_parameter_i(GL_TEXTURE_SWIZZLE_R, swizzle_orders[swizzle*4]); set_parameter_i(GL_TEXTURE_SWIZZLE_G, swizzle_orders[swizzle*4+1]); @@ -125,7 +124,7 @@ void Texture::apply_swizzle() } } -void Texture::set_parameter_i(GLenum param, int value) const +void Texture::set_parameter_i(unsigned param, int value) const { if(ARB_direct_state_access) glTextureParameteri(id, param, value);