+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+ // SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
+ SDL_Window *window = SDL_CreateWindow("OpenGL window",
+ SDL_WINDOWPOS_UNDEFINED,
+ SDL_WINDOWPOS_UNDEFINED,
+ WIDTH, HEIGHT,
+ SDL_WINDOW_OPENGL);
+ SDL_GLContext context = SDL_GL_CreateContext(window);
+ assert(context != nullptr);
+
+ CHECK(init_movit(".", MOVIT_DEBUG_ON));
+ printf("GPU texture subpixel precision: about %.1f bits\n",
+ log2(1.0f / movit_texel_subpixel_precision));
+ printf("Wrongly rounded x+0.48 or x+0.52 values: %d/510\n",
+ movit_num_wrongly_rounded);
+ if (movit_num_wrongly_rounded > 0) {
+ printf("Rounding off in the shader to compensate.\n");
+ }
+