diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-01-28 22:41:25 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-01-28 22:41:25 +0000 |
| commit | 1409af06f789ee1a832e61ed722cc48ed18f89f3 (patch) | |
| tree | f1393eff53f5b25ef4b005da1de981793037eb2c /hacks/gl/image.cc | |
| parent | 4117c113eeffe817fddc1c63f5d10eb4e6ada4f9 (diff) | |
OpenGL hacks.
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); +} |
