Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenGL Access Violation  (Read 2827 times)

0 Members and 1 Guest are viewing this topic.

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
OpenGL Access Violation
« 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;
}
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: OpenGL Access Violation
« Reply #1 on: May 18, 2013, 01:01:34 pm »
glewInit();
Laurent Gomila - SFML developer

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: OpenGL Access Violation
« Reply #2 on: May 18, 2013, 02:21:17 pm »
woops....thanks!
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.