static int Sys_EventFilter( SDL_Event *event )
{
//TODO: Add a quit query in linux, too - though linux user are more likely to know what they do
+ if (event->type == SDL_QUIT)
+ {
#ifdef WIN32
- if( event->type == SDL_QUIT && MessageBox( NULL, "Are you sure you want to quit?", "Confirm Exit", MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION ) == IDNO )
- return 0;
- else
- return 1;
-#else
- return 1;
+ if (MessageBox( NULL, "Are you sure you want to quit?", "Confirm Exit", MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION ) == IDNO)
+ return 0;
#endif
+ }
+ return 1;
}
static keynum_t buttonremap[18] =
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 );
}
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;
}
else
{
- SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 1);
- SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 1);
- SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 1);
+ SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 5);
+ SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 5);
+ SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16);
}
if (stereobuffer)
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;