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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Vekta

Pages: [1]
1
Window / Using glew with sfml 2.0 problem
« on: June 07, 2011, 10:22:03 am »
Ah of course, thank you

2
Window / Using glew with sfml 2.0 problem
« on: June 07, 2011, 01:42:27 am »
Hello, i've been having some trouble setting up an OpenGl 3.2 context with sfml 2.0 and glew.

When i call glewInit() it retuns the error "Missing GL version". I've tried the same code using freeGLUT for the context and it worked perfectly. I can only deduce that im using SFML wrong somehow.

Here is the code

Code: [Select]
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/glew.h>
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>
#define WINDOW_TITLE_PREFIX "Chapter 2"


void Initialize(int, char*[]);
void InitWindow(void);


int main(int argc, char* argv[])
{
InitWindow();
Initialize(argc, argv);
exit(EXIT_SUCCESS);
}

void InitWindow()
{
sf::Window App(sf::VideoMode(800, 600, 32), "OpenGL");

}

void Initialize(int argc, char* argv[])
{

GLenum GlewInitResult;

glewExperimental = GL_TRUE;
GlewInitResult = glewInit();

if (GLEW_OK != GlewInitResult) {
fprintf(
stderr,
"ERROR: %s\n ",
glewGetErrorString(GlewInitResult)
);
exit(EXIT_FAILURE);
}

fprintf(
stdout,
"INFO: OpenGL Version: %s\n",
glGetString(GL_VERSION)
);
}


I'm probably being stupid and I apologize but any help is greatly appreciated!

Pages: [1]