http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/
I'm using Code::Blocks with SDL 2.0.4. I've correctly setup all the includes and libs (and GLEW statically). These are the linker arguments:
-lmingw32
-lglew32s
-lOpenGL32
-lSDL2
-lSDL2_image
-lSDL2_mixer
MinGW compiler and libraries are x86_64. I have initialized SDL (everything), GLEW, setup the OpenGL context and made it current. Also glewInit does not give any error.
These are the SDL settings I use:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
SDL_SetHint(SDL_HINT_RENDER_OPENGL_SHADERS, "1");
All seems to work, until glCreateShader is called.No errors on compile, except one strange warning:
Warning: corrupt .drectve at end of def file[background=#ffffff] [/background]
Searching around the internet, I found that the compiler throws that warning because I'm using the GLEW made for VC++, not for MinGW. I downloaded the libraries from the official website... So the problem are the GLEW libraries? Or something else?
Thanks in advance for any help!