mirror of https://github.com/bjornbytes/lovr.git
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:
parent
3ef84510c9
commit
acde08228c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue