summaryrefslogtreecommitdiff
path: root/hacks/gl/image.cc
blob: 11b85126809b7eeae26552a1d8ea9fd3533fdef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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);
}