Pārlūkot izejas kodu

gl: initialise Glew in the video setup instead of the SDL app, so we don't

have to duplicate this code to other places. Fixes the GTK app on the way.
legacy
Sam Hocevar sam pirms 13 gadiem
vecāks
revīzija
e750e82332
2 mainītis faili ar 10 papildinājumiem un 9 dzēšanām
  1. +0
    -9
      src/sdlapp.cpp
  2. +10
    -0
      src/video.cpp

+ 0
- 9
src/sdlapp.cpp Parādīt failu

@@ -59,15 +59,6 @@ SdlApp::SdlApp(char const *title, vec2i res, float fps) :
SDL_Quit();
exit(EXIT_FAILURE);
}
#if defined USE_GLEW
GLenum glerr = glewInit();
if (glerr != GLEW_OK)
{
Log::Error("cannot initialise GLEW: %s\n", glewGetErrorString(glerr));
SDL_Quit();
exit(EXIT_FAILURE);
}
#endif

SDL_WM_SetCaption(title, NULL);
SDL_ShowCursor(0);


+ 10
- 0
src/video.cpp Parādīt failu

@@ -51,6 +51,16 @@ vec2i VideoData::saved_viewport = 0;

void Video::Setup(vec2i size)
{
#if defined USE_GLEW
/* Initialise GLEW if necessary */
GLenum glerr = glewInit();
if (glerr != GLEW_OK)
{
Log::Error("cannot initialise GLEW: %s\n", glewGetErrorString(glerr));
exit(EXIT_FAILURE);
}
#endif

/* Initialise OpenGL */
glViewport(0, 0, size.x, size.y);



Notiek ielāde…
Atcelt
Saglabāt