SFML community forums

Help => Window => Topic started by: Jalfor on May 18, 2013, 11:20:38 am

Title: OpenGL Access Violation
Post by: Jalfor on May 18, 2013, 11:20:38 am
I'm not entirely sure this is an SFML problem, but I think it is. Pretty much, it crashes the moment I try to generate a buffer giving the error:

First-chance exception at 0x00000000 in OpenGLThing.exe: 0xC0000005: Access violation at location 0x0000000000000000.
Unhandled exception at 0x00000000 in OpenGLThing.exe: 0xC0000005: Access violation at location 0x0000000000000000.

Anyway, here is a simple program that gives gives the error.

#define GL_GLEXT_PROTOTYPES

#include <GL/glew.h>
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>

int main()
{
        sf::ContextSettings contextSettings;
    contextSettings.depthBits = 32;
    contextSettings.stencilBits = 8;
    contextSettings.antialiasingLevel = 4;
    contextSettings.majorVersion = 3;
    contextSettings.minorVersion = 3;
       
        sf::Window window(sf::VideoMode(800, 600, 32), "OpenGL Triangle", sf::Style::Default, contextSettings);

        GLuint positionBuffer;
        glGenBuffers(1, &positionBuffer);

        window.close();
        return 0;
}
Title: Re: OpenGL Access Violation
Post by: Laurent on May 18, 2013, 01:01:34 pm
glewInit();
Title: Re: OpenGL Access Violation
Post by: Jalfor on May 18, 2013, 02:21:17 pm
woops....thanks!