X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_state.c;fp=src%2Ffreeglut_state.c;h=5a2f081bc6a15aff7d9e62b7bcd923ec51183616;hb=f2afa8e09dc46f89642a9cbbbc19250554c7ec5f;hp=4da1b5e0b065d3f2faf6baed101e9a3d926884f4;hpb=829150890f9ae5c95e3e8362f661697cec308fe7;p=freeglut diff --git a/src/freeglut_state.c b/src/freeglut_state.c index 4da1b5e..5a2f081 100644 --- a/src/freeglut_state.c +++ b/src/freeglut_state.c @@ -119,6 +119,16 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value ) } } +#if TARGET_HOST_MS_WINDOWS +/* WRONG-- FIXME */ +/* The following include file is available from SGI but is not standard: + * #include + * So we copy the necessary parts out of it to support the multisampling query + */ +#define WGL_SAMPLES_ARB 0x2042 +#endif + + /* * General settings query method */ @@ -129,6 +139,8 @@ int FGAPIENTRY glutGet( GLenum eWhat ) GLboolean boolValue ; #endif + int nsamples = 0; + switch (eWhat) { case GLUT_INIT_STATE: @@ -154,15 +166,17 @@ int FGAPIENTRY glutGet( GLenum eWhat ) case GLUT_INIT_WINDOW_HEIGHT: return fgState.Size.Y ; case GLUT_INIT_DISPLAY_MODE: return fgState.DisplayMode ; +#if TARGET_HOST_POSIX_X11 /* * The window/context specific queries are handled mostly by * fghGetConfig(). */ case GLUT_WINDOW_NUM_SAMPLES: - /* XXX Multisampling. Return what I know about multisampling. */ - return 0; +#ifdef GLX_VERSION_1_3 + glGetIntegerv(GL_SAMPLES, &nsamples); +#endif + return nsamples; -#if TARGET_HOST_POSIX_X11 /* * The rest of GLX queries under X are general enough to use a macro to * check them @@ -279,6 +293,10 @@ int FGAPIENTRY glutGet( GLenum eWhat ) #elif TARGET_HOST_MS_WINDOWS + case GLUT_WINDOW_NUM_SAMPLES: + glGetIntegerv(WGL_SAMPLES_ARB, &nsamples); + return nsamples; + /* Handle the OpenGL inquiries */ case GLUT_WINDOW_RGBA: glGetBooleanv ( GL_RGBA_MODE, &boolValue );