1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ 2 3 #ifndef UNIT_DEF_IMAGE 4 #define UNIT_DEF_IMAGE 5 6 #include "System/creg/creg_cond.h" 7 #include "Rendering/GL/myGL.h" 8 9 struct UnitDefImage 10 { 11 CR_DECLARE_STRUCT(UnitDefImage) 12 UnitDefImageUnitDefImage13 UnitDefImage(): imageSizeX(-1), imageSizeY(-1), textureID(0) { 14 } 15 FreeUnitDefImage16 bool Free() { 17 if (textureID != 0) { 18 glDeleteTextures(1, &textureID); 19 textureID = 0; 20 return true; 21 } 22 return false; 23 } 24 25 int imageSizeX; 26 int imageSizeY; 27 GLuint textureID; 28 }; 29 30 #endif // UNIT_DEF_IMAGE 31