]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_agl.c
reworked packet sending code a bit more, this is mostly just a cleanup, not a change...
[xonotic/darkplaces.git] / vid_agl.c
index 8a765011f38241ef3d58e785470b8f42a0205eda..191e7e569eac037270d5ec397d70b1b1c0ced0b2 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -257,7 +257,7 @@ static int GL_OpenLibrary(void)
                Con_Printf("Unable to open symbol list for %s\n", name);
                return false;
        }
-       strcpy(gl_driver, name);
+       strlcpy(gl_driver, name, sizeof(gl_driver));
        return true;
 }
 
@@ -360,7 +360,7 @@ static void VID_ProcessPendingAsyncEvents (void)
                Sys_Quit();
 }
 
-static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen)
+static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer)
 {
        *attrib++ = AGL_RGBA;
        *attrib++ = AGL_RED_SIZE;*attrib++ = 1;
@@ -377,10 +377,12 @@ static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscr
        }
        if (fullscreen)
                *attrib++ = AGL_FULLSCREEN;
+       if (stereobuffer)
+               *attrib++ = AGL_STEREO;
        *attrib++ = AGL_NONE;
 }
 
-int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate)
+int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer)
 {
     const EventTypeSpec winEvents[] =
        {
@@ -431,7 +433,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        carbonError = CreateNewWindow(kDocumentWindowClass, kWindowStandardFloatingAttributes | kWindowStandardHandlerAttribute, &windowBounds, &window);
        if (carbonError != noErr || window == NULL)
        {
-               Con_Printf("Unable to create window (error %d)\n", carbonError);
+               Con_Printf("Unable to create window (error %u)\n", (unsigned)carbonError);
                return false;
        }
 
@@ -445,7 +447,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
                                                           GetEventTypeCount(winEvents), winEvents, window, NULL);
 
        // Create the desired attribute list
-       VID_BuildAGLAttrib(attributes, bpp == 32, fullscreen);
+       VID_BuildAGLAttrib(attributes, bpp == 32, fullscreen, stereobuffer);
 
        if (!fullscreen)
        {
@@ -737,7 +739,7 @@ void Sys_SendKeyEvents(void)
                                        }
 
                                        default:
-                                               Con_Printf (">> kEventClassMouse (UNKNOWN eventKind: %d) <<\n", eventKind);
+                                               Con_Printf (">> kEventClassMouse (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
                                                break;
                                }
                        }
@@ -779,14 +781,14 @@ void Sys_SendKeyEvents(void)
                                                break;
 
                                        default:
-                                               Con_Printf (">> kEventClassKeyboard (UNKNOWN eventKind: %d) <<\n", eventKind);
+                                               Con_Printf (">> kEventClassKeyboard (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
                                                break;
                                }
                                break;
                        }
 
                        case kEventClassTextInput:
-                               Con_Printf(">> kEventClassTextInput (%d) <<\n", eventKind);
+                               Con_Printf(">> kEventClassTextInput (%d) <<\n", (int)eventKind);
                                break;
 
                        case kEventClassApplication:
@@ -804,7 +806,7 @@ void Sys_SendKeyEvents(void)
                                        case kEventAppActiveWindowChanged:
                                                break;
                                        default:
-                                               Con_Printf(">> kEventClassApplication (UNKNOWN eventKind: %d) <<\n", eventKind);
+                                               Con_Printf(">> kEventClassApplication (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
                                                break;
                                }
                                break;
@@ -815,7 +817,7 @@ void Sys_SendKeyEvents(void)
                                        case kEventAppleEvent :
                                                break;
                                        default:
-                                               Con_Printf(">> kEventClassAppleEvent (UNKNOWN eventKind: %d) <<\n", eventKind);
+                                               Con_Printf(">> kEventClassAppleEvent (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
                                                break;
                                }
                                break;
@@ -826,7 +828,7 @@ void Sys_SendKeyEvents(void)
                                        case kEventWindowUpdate :
                                                break;
                                        default:
-                                               Con_Printf(">> kEventClassWindow (UNKNOWN eventKind: %d) <<\n", eventKind);
+                                               Con_Printf(">> kEventClassWindow (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
                                                break;
                                }
                                break;