• ### Popular Now

• 13
• 16
• 27
• 9
• 9

This topic is 2623 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

ok so im just giving a small example that replicates my issue. i can't seem to get glew to load the extensions i want to use but i can do it manually with wglGetProcAddress. i don't want to use a window's specific function so what do i do? how do i get glew to load the extensions properly?

 #include <iostream> #include <GL/glew.h> #include <GL/wglew.h> #include <GL/glfw.h> int main() { glfwInit(); glfwOpenWindow( 800, 600, 8, 8, 8, 8, 0, 0, GLFW_WINDOW); glewInit(); if(glGenFramebuffers) { std::cout<<"it's loaded\n"; } else { std::cout<<"it's not loaded yet\n"; glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) wglGetProcAddress("glGenFramebuffers"); if(glGenFramebuffers) { std::cout<<"now it's loaded"; } else { std::cout<<"it's still not loaded"; } } } 

##### Share on other sites
First, Are you sure your graphics card can create a buffer. If the graphics card can't (which is unlikely), glew will never load the extension.

Second. The init code should be like this

GLenum err = glewInit(); if (GLEW_OK != err) { /* Problem: glewInit failed, something is seriously wrong. */ fprintf(stderr, "Error: %s\n", glewGetErrorString(err)) }

This way you can find out what went wrong.

assainator

##### Share on other sites
it doesn't give me an error, and if i take the if statement out it prints "No error". as for frame buffers i have no clue i have 2 Nvidia 9800gtx+'s running in SLI. i just asumed that my GPU was able to create frame buffers.

##### Share on other sites

it doesn't give me an error, and if i take the if statement out it prints "No error". as for frame buffers i have no clue i have 2 Nvidia 9800gtx+'s running in SLI. i just asumed that my GPU was able to create frame buffers.

How was I supposed to know this? It's possible your computer has a graphics card that is 10 years old and stuck with OGL 1.1 so I asked.

Now back to the issue, Have you tried glGenFrameBuffersARB? And what is the output of your snippet?

assainator

##### Share on other sites
it says glGenFrameBuffersARB wasn't declared in this scope so i guess it's in another header file or something. do you have any suggestions as to what i should use?

##### Share on other sites
The only thing thing I know of you can try is glGenFramebuffersEXT

other then that, I don't know anything

assainator

##### Share on other sites
If you want to use glGenFramebuffer, then you need to make a GL 3.0 context. Unfortunately, I don't know enough about glfw so I can't help you with that.

Alternatively, and this is what I do, I program against GL 2.0. I use the EXT version (glGenFramebufferEXT and the others).
That requires an extension known as GL_EXT_framebuffer_object.

Also, never use wglGetProcAddress if you are using GLEW. Because you don't need to. You seem to be confused on that point.

We invested a lot of time to write the WIKI, so make use of it : http://www.opengl.org/wiki