PDA

View Full Version : GLSL in window



Warzywo
11-04-2007, 06:16 AM
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.

Lindley
11-04-2007, 06:43 AM
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?

ZbuffeR
11-04-2007, 06:44 AM
You must do wglGetProcAddress when you already have a valid render context.

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

Korval
11-04-2007, 12:33 PM
Make sure you're getting an accelerated pixel format. You could be getting the default Microsoft software implementation.

Jan
11-04-2007, 04:05 PM
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.

Jan.

Warzywo
11-05-2007, 03:01 PM
Yes, most of You were right ! wglGetProcAddress returns correct address when there is a render context created.

Thanks a lot !
:)