- int x = SDL_WINDOWPOS_UNDEFINED;
- int y = SDL_WINDOWPOS_UNDEFINED;
- unsigned int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
- win_width = 1280;
- win_height = 800;
- if(!(win = SDL_CreateWindow("vrfileman", x, y, win_width, win_height, flags))) {
- fprintf(stderr, "failed to create window\n");
- return 1;
+ if(!(win = create_window(def_opt.width, def_opt.height))) {
+ // try again without the SRGB capability
+ SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 0);
+ if(!(win = create_window(def_opt.width, def_opt.height))) {
+ fprintf(stderr, "failed to create window\n");
+ return 1;
+ }
+ fprintf(stderr, "failed to create sRGB-capable window, defaulting to non-linear color space\n");
+ def_opt.srgb = false;