I'm using Windows 7 and most people in the group of this specific OpenGL project is too, there's only one member on Windows XP. We are all using Visual Studio 2010 though. I don't know if the OpenGL headers come with VS or with Windows but I would assume it's VS. And since we are all using the same VS version, albeit not the same SKU, I'm also assuming we all have the same OpenGL headers and version running on our systems.
That said, the version installed on my system (note that I haven't installed anything OpenGL related) is 2.1 and it does support GL_GENERATE_MIPMAP
, I don't need to resort ot the SGIS extension.
However, the Windows headers only support version 1.1. To work around that, I'm using GLEW. I also noticed that both GL_GENERATE_MIPMAP_SGIS
and GL_GENERATE_MIPMAP
have the same exact values defined.
So my question is, should I do the following on my texture loading routine:
if(GLEW_SGIS_generate_mipmap) {
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, glFormat, texWidth, texHeight, 0, glFormat,
GL_UNSIGNED_BYTE, texPixels);
} else {
gluBuild2DMipmaps(GL_TEXTURE_2D, glFormat, texWidth, texHeight, glFormat,
GL_UNSIGNED_BYTE, texPixels);
}
...or can I just assume everything will work and just do this:
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, glFormat, texWidth, texHeight, 0, glFormat,
GL_UNSIGNED_BYTE, texPixels);
?
I would think that this code would fail (and the game wouldn't probably run) if the OpenGL version doesn't support mipmapping generation like that, but nowadays, most people probably have OpenGL 2.1 on their systems right, probably in Windows XP too (without any development tools installed)?
Also, another small question...
My laptop has 2 graphics card, one integrated (Intel) and the other dedicated (NVIDIA), with NVIDIA Optimus technology. Mipmapping using the dedicated GPU seems to have better quality. I mean, the integrated card mipmapping seems more pixelized in near planes (I'm talking about a plane terrain texture) than the dedicated one. And when I move the camera, the near pixels "blink" a little (with the integrated card) and it's distracting, while the far pixels look nicely linear. Yes, I'm using GL_LINEAR_MIPMAP_LINEAR
for the minifying filter. Anyway to fix this?