TINYGL: Added texture data versioning.

This is introduced to detect changes when a texture is updated.
This commit is contained in:
Stefano Musumeci 2014-08-02 21:42:25 +02:00
parent 03239abf72
commit 94a41de865
2 changed files with 3 additions and 0 deletions

View file

@ -55,6 +55,7 @@ GLTexture *alloc_texture(GLContext *c, int h) {
t->handle = h;
t->disposed = false;
t->versionNumber = 0;
return t;
}
@ -165,6 +166,7 @@ void glopTexImage2D(GLContext *c, GLParam *p) {
}
}
c->current_texture->versionNumber++;
im = &c->current_texture->images[level];
im->xsize = width;
im->ysize = height;