GLSL in window

Hi, do You know how to launch GLSL in window using winapi ?
I have some shader prepared - and it works on GLUT. But when i want to use it in winapi - program crashes and there is a message that
glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB) returns NULL.
I use wglGetProcAddress to get all i want but still it doesn’t work.

please HELP !

  • i tried many ways: glew.h, SLD libraries, etc.

You seem to be talking about two different things. What windowing system you’re using shouldn’t affect which extensions are loaded.

Have you tried using GLEW or GLee to bring in extensions?

You must do wglGetProcAddress when you already have a valid render context.

GLEW is easy and works well, you must be doing something wrong.

Make sure you’re getting an accelerated pixel format. You could be getting the default Microsoft software implementation.

You need to call glewInit AFTER you have set up your complete window and OpenGL context, but before doing any rendering.

If GL_RENDERER is something with “Microsoft” you have set your parameters for ChoosePixelFormat wrong, so that you only get a software renderer, that does not expose any modern extensions.

However, in that case GLEW will not detect GLSL support, at all, anyway.


Yes, most of You were right ! wglGetProcAddress returns correct address when there is a render context created.

Thanks a lot !

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.