Using GL_GENERATE_MIPMAP with Quake
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Using GL_GENERATE_MIPMAP with Quake
I'm trying to use glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); with GLQuake, but i'm getting a strange error on compile.
error C2065: 'GL_GENERATE_MIPMAP' : undeclared identifier
What can be happening? I saw something about outdated headers, how can i fix it?
error C2065: 'GL_GENERATE_MIPMAP' : undeclared identifier
What can be happening? I saw something about outdated headers, how can i fix it?
- JasonX
- Posts: 411
- Joined: Tue Apr 21, 2009 2:08 pm
You just need a #define for GL_GENERATE_MIPMAP in your glquake.h, like so:
You might also want to use glHint (GL_GENERATE_MIPMAP_HINT, GL_FASTEST) or glHint (GL_GENERATE_MIPMAP_HINT, GL_NICEST) to control the performance vs quality levels, although as it's a hint drivers are not obliged to respect it.
I'd generally use GLEW for this kinda thing as it can make the whole process of dealing with extensions a LOT less painful.
Be aware that this is a very old extension and has long ago been superseded by the glGenerateMipmap function (which is part of the GL_ARB_framebuffer_object extension). Also be aware that not all hardware supports hardware mipmapping, some hardware that does claim to support it does not do so reliably, and that hardware mipmapping is kinda crap as it can generally only do a point or linear filter for miplevel reduction, whereas box filter is what you really want for the best quality.
- Code: Select all
#define GL_GENERATE_MIPMAP 0x8191
You might also want to use glHint (GL_GENERATE_MIPMAP_HINT, GL_FASTEST) or glHint (GL_GENERATE_MIPMAP_HINT, GL_NICEST) to control the performance vs quality levels, although as it's a hint drivers are not obliged to respect it.
- Code: Select all
#define GL_GENERATE_MIPMAP_HINT 0x8192
I'd generally use GLEW for this kinda thing as it can make the whole process of dealing with extensions a LOT less painful.
Be aware that this is a very old extension and has long ago been superseded by the glGenerateMipmap function (which is part of the GL_ARB_framebuffer_object extension). Also be aware that not all hardware supports hardware mipmapping, some hardware that does claim to support it does not do so reliably, and that hardware mipmapping is kinda crap as it can generally only do a point or linear filter for miplevel reduction, whereas box filter is what you really want for the best quality.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
You can't; you've got fairly limited control over this part of the pipeline. The closest you can get is not mipmapping at all, and that just leaves sizes the same (and you can see from the ugly artefacts it creates - and how slow it is - that increasing size might not be a good idea).
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest