this->width = w;
this->height = h;
-
+
assert_gl("before creating texture");
glGenTextures(1, &handle);
-
+
try {
glBindTexture(GL_TEXTURE_2D, handle);
throw std::runtime_error("image has no power of 2 size");
if(format->BitsPerPixel != 24 && format->BitsPerPixel != 32)
throw std::runtime_error("image has no 24 or 32 bit color depth");
-
+
this->width = image->w;
this->height = image->h;
assert_gl("before creating texture");
glGenTextures(1, &handle);
-
+
try {
GLenum sdl_format;
if(format->BytesPerPixel == 3)
assert_gl("creating texture");
- set_texture_params();
+ set_texture_params();
} catch(...) {
glDeleteTextures(1, &handle);
throw;
assert_gl("set texture params");
}
-