diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index dfac6bc2a7..62c14a4344 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -1266,14 +1266,28 @@ static void gl1_load_texture_data( static void video_texture_load_gl1( struct texture_image *ti, enum texture_filter_type filter_type, - uintptr_t *id) + uintptr_t *idptr) { + GLuint id; + unsigned width = 0; + unsigned height = 0; + const void *pixels = NULL; + /* Generate the OpenGL texture object */ - glGenTextures(1, (GLuint*)id); - gl1_load_texture_data((GLuint)*id, + glGenTextures(1, &id); + *idptr = id; + + if (ti) + { + width = ti->width; + height = ti->height; + pixels = ti->pixels; + } + + gl1_load_texture_data(id, RARCH_WRAP_EDGE, filter_type, 4 /* TODO/FIXME - dehardcode */, - ti->width, ti->height, ti->pixels, + width, height, pixels, sizeof(uint32_t) /* TODO/FIXME - dehardcode */ ); }