Jump to content
  • Advertisement
Sign in to follow this  
ishkabible

Glew Isn'T Loading Extensions

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
ok i got everything working with the ARB and EXT extensions, i had both the .dll linked and the .lib linked and apparently that caused issues. i wasn't confused as to when to use wglGetProcAddress it was just the only thing working and i wanted to show that. im now having some trouble bliting one frame buffer onto the next. i want alpha transparency to be maintained however and it's not. ill work on it maybe post back here about it if something happens. im currently getting help at OpenGL.org with the frame buffers. thanks!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!