Hi!
i got some problems with glew.
#include <Windows.h>
#include <SDL.h>
#include "Settings.h"
#include "Buffer.h"
#include <GL/glew.h>
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
bool running=true;
SDL_Surface *screen;
SDL_Event event;
//Settings::read();
// ----- SDL init ---------------
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "Video initialization failed: %s
", SDL_GetError());
exit(-1);
}
atexit(SDL_Quit);
// ----- OpenGL attribute setting via SDL ---------------
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
// ----- Setting up the screen surface ---------------
if ((screen = SDL_SetVideoMode(Settings::RESOLUTION_WIDTH, Settings::RESOLUTION_HEIGHT, 0, SDL_OPENGL)) == 0) {
fprintf(stderr, "Video mode set failed: %s
", SDL_GetError());
exit(-1);
}
GLenum err = glewInit();
if (GLEW_OK != err)
{
MessageBox(0,"error", "err", MB_OK);
return 0;
}
if (GLEW_VERSION_1_3)
{
MessageBox(0,"asdf", "asdf", MB_OK);
}
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
while (running) {
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
running = false;
break;
}
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
SDL_GL_SwapBuffers();
}
return 1;
}
compiles fine, also runs, but it says gl version 1.3 is not available (but i even got gl 4.0 running on my pc). things like glClear also work, but when i use glGenFramebuffersEXT(1, &id); e.g. i get a runtime error.
did i miss something? what could be the problem?