Sys_Quit(0);
}
-static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer)
+static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer, int samples)
{
*attrib++ = AGL_RGBA;
- *attrib++ = AGL_RED_SIZE;*attrib++ = 1;
- *attrib++ = AGL_GREEN_SIZE;*attrib++ = 1;
- *attrib++ = AGL_BLUE_SIZE;*attrib++ = 1;
+ *attrib++ = AGL_RED_SIZE;*attrib++ = stencil ? 8 : 5;
+ *attrib++ = AGL_GREEN_SIZE;*attrib++ = stencil ? 8 : 5;
+ *attrib++ = AGL_BLUE_SIZE;*attrib++ = stencil ? 8 : 5;
*attrib++ = AGL_DOUBLEBUFFER;
- *attrib++ = AGL_DEPTH_SIZE;*attrib++ = 1;
+ *attrib++ = AGL_DEPTH_SIZE;*attrib++ = stencil ? 24 : 16;
// if stencil is enabled, ask for alpha too
if (stencil)
{
*attrib++ = AGL_STENCIL_SIZE;*attrib++ = 8;
- *attrib++ = AGL_ALPHA_SIZE;*attrib++ = 1;
+ *attrib++ = AGL_ALPHA_SIZE;*attrib++ = 8;
}
if (fullscreen)
*attrib++ = AGL_FULLSCREEN;
if (stereobuffer)
*attrib++ = AGL_STEREO;
+#ifdef AGL_SAMPLE_BUFFERS_ARB
+#ifdef AGL_SAMPLES_ARB
+ if (samples > 1)
+ {
+ *attrib++ = AGL_SAMPLE_BUFFERS_ARB;
+ *attrib++ = 1;
+ *attrib++ = AGL_SAMPLES_ARB;
+ *attrib++ = samples;
+ }
+#endif
+#endif
+
*attrib++ = AGL_NONE;
}
-int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer)
+int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer, int samples)
{
const EventTypeSpec winEvents[] =
{
GetEventTypeCount(winEvents), winEvents, window, NULL);
// Create the desired attribute list
- VID_BuildAGLAttrib(attributes, bpp == 32, fullscreen, stereobuffer);
+ VID_BuildAGLAttrib(attributes, bpp == 32, fullscreen, stereobuffer, samples);
if (!fullscreen)
{
gl_vendor = (const char *)qglGetString(GL_VENDOR);
gl_version = (const char *)qglGetString(GL_VERSION);
gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
+ gl_platformextensions = "";
gl_platform = "AGL";
gl_videosyncavailable = true;
+ if (!gl_extensions)
+ gl_extensions = "";
+ if (!gl_platformextensions)
+ gl_platformextensions = "";
+
+ Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
+ Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
+ Con_DPrintf("GL_VERSION: %s\n", gl_version);
+ Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
+ Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+
multithreadedgl = false;
vid_isfullscreen = fullscreen;
vid_usingmouse = false;