Sign in to follow this  
m4rqz

OpenGL Using OpenGL shaders with GLFW

Recommended Posts

Hello folks! This is my first post to these forums :) I'm developing a little game using glfw/opengl and I wanted to try out vertex/fragment shaders. The problem is that I can't compile my code.. either the functions needed to use shaders are not found (when I include only GL/glfw.h) or the linking fails when I #define GL_GLEXT_PROTOTYPES and include GL/glext.h .. I know my video card (radeon 9600 mobile) supports shaders, so what can be wrong here? Do I have to use glfwGetProcAdress to get shader functions when glfwGetGLVersion return 2.0 ? Btw, I want to use glfw, so don't tell me to switch unless glfw can't handle shaders. Also, I'm not running windows, but I have official ATI video drivers, let's leave it there. Cheers

Share this post


Link to post
Share on other sites
Quote:
Original post by m4rqz
Do I have to use glfwGetProcAdress to get shader functions when glfwGetGLVersion return 2.0 ?

Yes.

Quote:
Btw, I want to use glfw, so don't tell me to switch unless glfw can't handle shaders.

GLFW is just for Window creation, input reading from keyboard/mouse and some other stuff which doesn't connects to shaders and OpenGL in general at all.
All OpenGL calls are made through OpenGL library not GLFW.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kalidor
If you're on Windows, everything beyond OpenGL 1.1 needs to be accessed as an extension. Read the Forum FAQ for information on using extensions.


He said that he is not running windows :)

getProcAddress is the right way to do it. You can define GL_GLEXT_PROTOTYPES but make sure that it is defined before any GL headers get included. Its probably the best to pass it as a compiler option (-DGL_GLEXT_PROTOTYPES if you are using gcc). But be aware that there are some drawbacks to this methode.

Share this post


Link to post
Share on other sites
Quote:
Original post by nefthy
He said that he is not running windows :)
Whoops... sorry about that. [embarrass]

EDIT: You should still be able to use GLee or GLEW for easing the use of extensions, however.

[Edited by - Kalidor on April 17, 2006 12:27:12 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this