# MSVC2008 and GL_MULTISAMPLE

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

## Recommended Posts

Hi, I'm writing a simple GL program in Qt4.5, x64 and the application works fine, However i have tried using
glEnable(GL_MULTISAMPLE);
And MSVC2008 gives "error C2065: 'GL_MULTISAMPLE' : undeclared identifier" I notice that Intellisense doesn't have any references to GL_MULTISAMPLE, and either does the Microsoft "Gl.h" file, other gl.h files i have from mingw, etc do have GL_MULTISAMPLE mentioned. There does seem to be a GL_MULT definition in Microsofts header. (Whatever that is) Why is there not an ability to call "GL_MULTISAMPLE" from MSVC08? What is the best way to solve this issue? How many other calls will i have problems with? Can i somehow use the mingw file safely with MSVC?

##### Share on other sites
use glew library for usging OGL 1.2+ and extensions:

http://glew.sourceforge.net/

sample code for initialize glew in your program in MSVC++

#include "gl/glew.h"
#pragma comment(lib,"glew32.lib")

void init_gl()
{

...

// initialize glew
glewInit();

}

##### Share on other sites
Thanks, I will do it the suggested way and add the extension. One would figure MSVC2008 wouldn't be SO far behind. I am aware of glew, and was going use other extensions via this way method, thanks for the suggestions.

One last questions is why can't i compile an OpenGL.dll for myself? If it's really an Open standard should we all be able to compile OGL ourselves? (I assume this is what Nvidia have done of sorts)

I have managed to compile freeglut, Qt, DevIL, (and soon glew for x64.) and numerous other libraries for 64bit, I do wonder if MS don't update it, why i cannot roll all changed into an updated .lib, .dll. Seems a little silly to have to do it via extra extension headers and Nvidia and glew.

##### Share on other sites
Quote:
 Original post by FreestylerThanks, I will do it the suggested way and add the extension. One would figure MSVC2008 wouldn't be SO far behind.

It's not a question of being far behind. Microsoft has chosen to not support OpenGL natively in their products. So you'll have to use third party solutions to get that support.

Quote:
 Original post by FreestylerOne last questions is why can't i compile an OpenGL.dll for myself? If it's really an Open standard should we all be able to compile OGL ourselves? (I assume this is what Nvidia have done of sorts)

OpenGL is an open standard, not an open implementation. Opengl32.dll doesn't contain any OpenGL code at all. It's just an empty shell, forwarding calls to the real implementation, which is a vendor dependent (and absolutely not open) DLL supplied by the graphics driver.

##### Share on other sites
Quote:
Original post by Yann L
Quote:
 Original post by FreestylerThanks, I will do it the suggested way and add the extension. One would figure MSVC2008 wouldn't be SO far behind.

It's not a question of being far behind. Microsoft has chosen to not support OpenGL natively in their products. So you'll have to use third party solutions to get that support.

Yeah, I just would of figured it could or should work in much the same way as any other API or library as i mentioned. And assumed (wrongly) part of the reason for MSVC adoption is it's abilities to be quite modern and include the latest and greatest. :)

Quote:
 OpenGL is an open standard, not an open implementation. Opengl32.dll doesn't contain any OpenGL code at all. It's just an empty shell, forwarding calls to the real implementation, which is a vendor dependent (and absolutely not open) DLL supplied by the graphics driver.

Thanks for the explanation, But it does contain all OGL 1.1 functionality still? One could think we could just use Nvidia's without the middelman so to speak. It would be nice to see Nvidia have open OGL, but this would stop Nvidia's Quadro business to a certain extent, So obviously it's a little convoluted for a fair few reasons. It would be just plain better to compile my own OpenGL31x64.lib and include this .dll with my application after Microsoft dropped the ball so to speak.

I'm starting to ponder D3D and lose my crossplatform capabilities. Qt, OGL, DevIL etc, are all LGPL and crossplatform. But Nvidia drivers, and my current Vista x64 platform combined with arguably a more modern and powerful optimized graphics api, maybe something i again look at.

Nvidia 185.85 drivers are just not working for my 9650GT on laptop, So i'm without OGL 3.0 extension support until a newer better driver from Nvidia... Grrrr...! :) But thankyou again for the useful posts, I will continue to think it over, already basic OGL is working well.

##### Share on other sites
Most of us don't have a need to compile OpenGL.
Getting function pointers is not a big deal. Even with Direct3D, you get a pointer to the "device" and basically you have a table of pointers and you use it like this
d3d->SetRenderState, d3d->SetTexture and so on.
Don't worry, this won't reduce performance. There are hundreds of PC games and Xbox games that work like this with Direct3D. Yes, Direct3D is a great API.