Bind texture after setting buffer;

The `buffer` field was not being initialized to 0, so sometimes
the texture was binding to the wrong target.
This commit is contained in:
bjorn 2016-11-14 00:59:47 -08:00
parent 3ef84510c9
commit acde08228c
1 changed files with 1 additions and 2 deletions

View File

@ -7,6 +7,7 @@ Texture* lovrTextureCreate(void* data, int size) {
Texture* texture = malloc(sizeof(Texture));
if (!texture) return NULL;
texture->buffer = 0;
glGenTextures(1, &texture->id);
if (data) {
@ -24,8 +25,6 @@ Texture* lovrTextureCreate(void* data, int size) {
free(image);
}
texture->buffer = 0;
return texture;
}