// Tell startup code that we have a client
int cl_available = true;
+
+qboolean vid_supportrefreshrate = false;
+
static qboolean vid_usingmouse;
static qboolean vid_isfullscreen;
#endif
}
+static keynum_t buttonremap[18] =
+{
+ K_MOUSE1,
+ K_MOUSE3,
+ K_MOUSE2,
+ K_MWHEELUP,
+ K_MWHEELDOWN,
+ K_MOUSE4,
+ K_MOUSE5,
+ K_MOUSE6,
+ K_MOUSE7,
+ K_MOUSE8,
+ K_MOUSE9,
+ K_MOUSE10,
+ K_MOUSE11,
+ K_MOUSE12,
+ K_MOUSE13,
+ K_MOUSE14,
+ K_MOUSE15,
+ K_MOUSE16,
+};
+
void Sys_SendKeyEvents( void )
{
SDL_Event event;
}
break;
case SDL_MOUSEBUTTONDOWN:
- if( event.button.button == SDL_BUTTON_MIDDLE )
- event.button.button = SDL_BUTTON_RIGHT;
- else if( event.button.button == SDL_BUTTON_RIGHT )
- event.button.button = SDL_BUTTON_MIDDLE;
- Key_Event( K_MOUSE1 + event.button.button - 1, 0, true );
+ if (event.button.button <= 18)
+ Key_Event( buttonremap[event.button.button - 1], 0, true );
break;
case SDL_MOUSEBUTTONUP:
- if( event.button.button == SDL_BUTTON_MIDDLE )
- event.button.button = SDL_BUTTON_RIGHT;
- else if( event.button.button == SDL_BUTTON_RIGHT )
- event.button.button = SDL_BUTTON_MIDDLE;
- Key_Event( K_MOUSE1 + event.button.button - 1, 0, false );
+ if (event.button.button <= 18)
+ Key_Event( buttonremap[event.button.button - 1], 0, false );
break;
}
}
void VID_Init (void)
{
if (SDL_Init(SDL_INIT_VIDEO) < 0)
- Sys_Error ("Failed to init video: %s\n", SDL_GetError());
+ Sys_Error ("Failed to init video: %s", SDL_GetError());
vid_isfullscreen = false;
}
return;
icon = LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( IDI_ICON1 ) );
+#ifndef WIN64
SetClassLong( info.window, GCL_HICON, (LONG) icon );
+#else
+ SetClassLongPtr( info.window, GCLP_HICON, (LONG_PTR)icon );
+#endif
}
#else
static void VID_SetCaption()
version->major, version->minor, version->patch );
}
-int VID_InitMode(int fullscreen, int width, int height, int bpp)
+int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate)
{
int i;
int flags = SDL_OPENGL;
We cant switch from one OpenGL video mode to another.
Thus we first switch to some stupid 2D mode and then back to OpenGL.
*/
-#ifndef MACOSX
SDL_SetVideoMode( 0, 0, 0, 0 );
-#endif
// SDL usually knows best
drivername = NULL;
return false;
}
- qglGetString = GL_GetProcAddress("glGetString");
-
- // Knghtbrd: should do platform-specific extension string function here
-
- if (qglGetString == NULL)
+ if ((qglGetString = (const GLubyte* (GLAPIENTRY *)(GLenum name))GL_GetProcAddress("glGetString")) == NULL)
{
VID_Shutdown();
Con_Print("Required OpenGL function glGetString not found\n");
return false;
}
+ // Knghtbrd: should do platform-specific extension string function here
+
vid_isfullscreen = false;
if (fullscreen) {
flags |= SDL_FULLSCREEN;
// enable key repeat since everyone expects it
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
- gl_renderer = qglGetString(GL_RENDERER);
- gl_vendor = qglGetString(GL_VENDOR);
- gl_version = qglGetString(GL_VERSION);
- gl_extensions = qglGetString(GL_EXTENSIONS);
+ gl_renderer = (const char *)qglGetString(GL_RENDERER);
+ gl_vendor = (const char *)qglGetString(GL_VENDOR);
+ gl_version = (const char *)qglGetString(GL_VERSION);
+ gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
gl_platform = "SDL";
// Knghtbrd: should assign platform-specific extensions here
//TODO: maybe ;)