Jump to content
  • Advertisement
Sign in to follow this  
ChaseRLewis

OpenGL glGenerateMipMap ?

This topic is 2767 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

So coming from DirectX trying to teach myself OpenGL. I"m using the SuperBible 5th edition book and up till texturing it's been doing fine. However, I'm noticing a few functions they use in this chapter don't see to be in any of the libraries I downloaded.

It mentions a glGenerateMipMap(GLenum enum) that don't exist in any OpenGL library I've tried.

So basically how should I go about generating mipmaps? gluBuild2DMipMap?

Share this post


Link to post
Share on other sites
Advertisement
Maybe you mean glGenerateMipmap? (lowercase m)

http://www.opengl.org/sdk/docs/man3/xhtml/glGenerateMipmap.xml

I believe this function has replaced gluBuild (I think it's faster and leverages the GPU in some way, glu was just a utility function that probably did everything locally on the cpu). I'm purely guessing though.

Share this post


Link to post
Share on other sites
Also, that function won't be in the library, but must be dynamically loaded (using wglGetProcAddress on Windows), as must all other newer OpenGL functionality. You can use a library such as for example GLEW to make this easier.

Share this post


Link to post
Share on other sites

Also, that function won't be in the library, but must be dynamically loaded (using wglGetProcAddress on Windows), as must all other newer OpenGL functionality. You can use a library such as for example GLEW to make this easier.


Ya i've been using GLEW,the book hasn't mentioned anything about dynamically loading specific functions. Probably a fairly basic question, but how do I go about loading that function?

Share this post


Link to post
Share on other sites
If you're using GLEW you don't need to dynamically load it - it should already be available. That's the whole point of GLEW. Can you check that you called glewInit after initializing your context?

(As an aside, I personally prefer generating mipmaps by hand as I find that a simple box filter gives the best results for them, whereas with any autogen method you don't really have control over the filter type being used.)

Share this post


Link to post
Share on other sites

So coming from DirectX trying to teach myself OpenGL. I"m using the SuperBible 5th edition book and up till texturing it's been doing fine. However, I'm noticing a few functions they use in this chapter don't see to be in any of the libraries I downloaded.

It mentions a glGenerateMipMap(GLenum enum) that don't exist in any OpenGL library I've tried.

So basically how should I go about generating mipmaps? gluBuild2DMipMap?


The glGenerateMipmap() function was originally introduced in the GL_EXT_framebuffer_object extension. glGenerateMipmap() has been part of the core API since OpenGL 3.0.

In your learning you might see some sources telling you to use the GL_GENERATE_MIPMAP flag to the glTexParameteri() function to generate your mipmaps. Don't do that because that's been deprecated since OpenGL 3.0.

Share this post


Link to post
Share on other sites
All the info is here
http://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation
http://www.opengl.org/wiki/Common_Mistakes#gluBuild2DMipmaps

and if you are new
http://www.opengl.org/wiki/Getting_started

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!