glew not initializing with SDL2

I've been trying to get GLew 1.10 to play nicely with SDL 2.0.3 , but GLew won't initialize. The problem I'm having is that GLew 1.10 requires a function GLEWContext* glewGetContext().

I've tried to use a the same solution used for GLew 1.10 with GLFW3, where you use a struct to handle the window and GLew context, but that method doesn't work with SDL2.

The 2 errors I'm receiving is this which points to glewInit():

C3861: 'glewGetContext': identifier not found

Intellisense: identifier "glewGetContext is undefined

code:

    // Create window
    _screen = SDL_CreateWindow("Window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 
        800, 600, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);

    /* Create Context */
    _mainContext = SDL_GL_CreateContext(_screen);

    /* swap syncronized */
    SDL_GL_SetSwapInterval(0);

    // Initialize GLew 1.10
    glewExperimental = GL_TRUE;
    GLenum glewError = glewInit(); <------------- error

    if (glewError != GLEW_OK)
        printf("Error with GLew. SDL Error: %sn", SDL_GetError());
链接地址: http://www.djcxy.com/p/67580.html

上一篇: CreateRenderer降级OpenGL上下文,是否可以防止?

下一篇: Glew不会使用SDL2进行初始化