X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscreen%2Ftexture.cxx;h=62e8c74b11f9d6f35bfff2a823bcd068a3d848db;hb=ad56ba1bfa35cc93b082c173ff0b5c09a81a1a76;hp=58f69ef60e5e4e23b789d4bf46abb49f4bb48782;hpb=51ef4568dd248a6917720a386e658610958e1512;p=simgear.git diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index 58f69ef6..62e8c74b 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -22,18 +22,24 @@ #include "colours.h" SGTexture::SGTexture() + : texture_id(0), + texture_data(0) { - texture_data = 0; } SGTexture::SGTexture(unsigned int width, unsigned int height) + : texture_id(0) { texture_data = new GLubyte[ width * height * 3 ]; } SGTexture::~SGTexture() { - delete texture_data; + if (texture_data) + delete texture_data; + + if (texture_id) + free_id(); } void @@ -323,6 +329,7 @@ SGTexture::read_r8_texture(const char *name) } +#if 0 void SGTexture::set_pixel(GLuint x, GLuint y, sgVec3 &c) { @@ -343,6 +350,7 @@ SGTexture::get_pixel(GLuint x, GLuint y) return &c; } +#endif SGTexture::ImageRec *