/* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* ** GLW_IMP.C ** ** This file contains ALL Linux specific stuff having to do with the ** OpenGL refresh. When a port is being made the following functions ** must be implemented by the port: ** ** GLimp_EndFrame ** GLimp_Init ** GLimp_Shutdown ** GLimp_SwitchFullscreen ** */ #include #include #include #include #include #include #include #include #include "../ref_gl/gl_local.h" #include "../client/keys.h" #include "../linux/rw_linux.h" #include "../linux/glw_linux.h" #include /*****************************************************************************/ glwstate_t glw_state; static qboolean GLimp_SwitchFullscreen( int width, int height ); qboolean GLimp_InitGL (void); extern cvar_t *vid_fullscreen; extern cvar_t *vid_ref; static fxMesaContext fc = NULL; //FX Mesa Functions fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]); fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]); void (*qfxMesaDestroyContext)(fxMesaContext ctx); void (*qfxMesaMakeCurrent)(fxMesaContext ctx); fxMesaContext (*qfxMesaGetCurrentContext)(void); void (*qfxMesaSwapBuffers)(void); #define NUM_RESOLUTIONS 16 static resolutions[NUM_RESOLUTIONS][3]={ { 320,200, GR_RESOLUTION_320x200 }, { 320,240, GR_RESOLUTION_320x240 }, { 400,256, GR_RESOLUTION_400x256 }, { 400,300, GR_RESOLUTION_400x300 }, { 512,384, GR_RESOLUTION_512x384 }, { 640,200, GR_RESOLUTION_640x200 }, { 640,350, GR_RESOLUTION_640x350 }, { 640,400, GR_RESOLUTION_640x400 }, { 640,480, GR_RESOLUTION_640x480 }, { 800,600, GR_RESOLUTION_800x600 }, { 960,720, GR_RESOLUTION_960x720 }, { 856,480, GR_RESOLUTION_856x480 }, { 512,256, GR_RESOLUTION_512x256 }, { 1024,768, GR_RESOLUTION_1024x768 }, { 1280,1024,GR_RESOLUTION_1280x1024 }, { 1600,1200,GR_RESOLUTION_1600x1200 } }; static int findres(int *width, int *height) { int i; for(i=0;i