diff options
Diffstat (limited to 'hacks/gl/image.cc')
| -rw-r--r-- | hacks/gl/image.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/hacks/gl/image.cc b/hacks/gl/image.cc new file mode 100644 index 000000000..11b851268 --- /dev/null +++ b/hacks/gl/image.cc @@ -0,0 +1,29 @@ +#include "image.h" +#include "image_loader.h" + +Image::Image() +{ +} + +Image::Image(wxString path) +{ + load(path); +} + +void Image::load(wxString path) +{ + ID=loadImage(path, &width, &height, &textureWidth, &textureHeight); + + tex_coord_x = (float)width/(float)textureWidth; + tex_coord_y = (float)height/(float)textureHeight; +} + +GLuint* Image::getID() +{ + return ID; +} + +Image::~Image() +{ + glDeleteTextures (1, ID); +} |
