glGenerateMipMap ?

Started by
5 comments, last by V-man 13 years, 2 months ago
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?
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.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
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.

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?
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.)

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


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.

http://www.dhpoware.com
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
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement