Changeset 808


Ignore:
Timestamp:
Aug 10, 2011, 4:08:00 PM (9 years ago)
Author:
sam
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sdlapp.cpp

    r796 r808  
    6060        exit(EXIT_FAILURE);
    6161    }
    62 #if defined USE_GLEW
    63     GLenum glerr = glewInit();
    64     if (glerr != GLEW_OK)
    65     {
    66         Log::Error("cannot initialise GLEW: %s\n", glewGetErrorString(glerr));
    67         SDL_Quit();
    68         exit(EXIT_FAILURE);
    69     }
    70 #endif
    7162
    7263    SDL_WM_SetCaption(title, NULL);
  • trunk/src/video.cpp

    r796 r808  
    5252void Video::Setup(vec2i size)
    5353{
     54#if defined USE_GLEW
     55    /* Initialise GLEW if necessary */
     56    GLenum glerr = glewInit();
     57    if (glerr != GLEW_OK)
     58    {
     59        Log::Error("cannot initialise GLEW: %s\n", glewGetErrorString(glerr));
     60        exit(EXIT_FAILURE);
     61    }
     62#endif
     63
    5464    /* Initialise OpenGL */
    5565    glViewport(0, 0, size.x, size.y);
Note: See TracChangeset for help on using the changeset viewer.