]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
implemented vid_samples cvar (antialiasing samples per pixel)
[xonotic/darkplaces.git] / vid_sdl.c
index 3902899cc15bc0666f0bca3be8a236454d30b075..bb3b22395863cace552b3fa56a228a2841cb95d4 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -491,9 +491,15 @@ static void VID_SetCaption()
 
        icon = LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( IDI_ICON1 ) );
 #ifndef _W64 //If Windows 64bit data types don't exist
+#ifndef SetClassLongPtr
 #define SetClassLongPtr SetClassLong
+#endif
+#ifndef GCLP_HICON
 #define GCLP_HICON GCL_HICON
+#endif
+#ifndef LONG_PTR
 #define LONG_PTR LONG
+#endif
 #endif
        SetClassLongPtr( info.window, GCLP_HICON, (LONG_PTR)icon );
 }
@@ -623,7 +629,7 @@ static void VID_OutputVersion()
                                        version->major, version->minor, version->patch );
 }
 
-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)
 {
        int i;
        static int notfirstvideomode = false;
@@ -699,6 +705,11 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
                SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1);
        else
                SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 0);
+       if (samples > 1)
+       {
+               SDL_GL_SetAttribute (SDL_GL_MULTISAMPLEBUFFERS, 1);
+               SDL_GL_SetAttribute (SDL_GL_MULTISAMPLESAMPLES, samples);
+       }
 
        video_bpp = bpp;
        video_flags = flags;