- tmp_texture_mem = calloc(1, 1024 * 512 * 2);
- if (tmp_texture_mem == NULL) {
+ ret = gl_platform_init(&display, &window, quirks);
+ if (ret != 0) {
+ fprintf(stderr, "gl_platform_init failed with %d\n", ret);
+ goto out;
+ }
+
+ flip_old_w = flip_old_h = 0;
+ for (tex_w = 1; tex_w < w; tex_w *= 2)
+ ;
+ for (tex_h = 1; tex_h < h; tex_h *= 2)
+ ;
+ tex_mem = realloc(tex_mem, tex_w * tex_h * 2);
+ if (tex_mem == NULL) {