mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Don't allow GL modes if GL Major Version is less than 2.
Additionally, fix build issues for RENDERTYPE=WIN introduced in r6827. git-svn-id: https://svn.eduke32.com/eduke32@6921 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
7fd844a795
commit
d5b669ebe5
3 changed files with 23 additions and 8 deletions
|
@ -10,7 +10,7 @@
|
||||||
static BOOL rawinput_started = 0;
|
static BOOL rawinput_started = 0;
|
||||||
static uint8_t KeyboardState[256] = {0}; // VKeys
|
static uint8_t KeyboardState[256] = {0}; // VKeys
|
||||||
|
|
||||||
extern uint8_t g_mouseEnabled, g_mouseGrabbed;
|
extern bool g_mouseEnabled, g_mouseGrabbed;
|
||||||
extern void keySetState(int32_t key, int32_t state);
|
extern void keySetState(int32_t key, int32_t state);
|
||||||
|
|
||||||
//#define MASK_DOWN (1<<(i<<1))
|
//#define MASK_DOWN (1<<(i<<1))
|
||||||
|
|
|
@ -1646,6 +1646,13 @@ int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs)
|
||||||
}
|
}
|
||||||
|
|
||||||
gladLoadGLLoader(SDL_GL_GetProcAddress);
|
gladLoadGLLoader(SDL_GL_GetProcAddress);
|
||||||
|
if (GLVersion.major < 2)
|
||||||
|
{
|
||||||
|
initprintf("Your computer does not support OpenGL version 2 or greater. GL modes are unavailable.\n");
|
||||||
|
nogl = 1;
|
||||||
|
destroy_window_resources();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_SetWindowFullscreen(sdl_window, ((fs & 1) ? SDL_WINDOW_FULLSCREEN : 0));
|
SDL_SetWindowFullscreen(sdl_window, ((fs & 1) ? SDL_WINDOW_FULLSCREEN : 0));
|
||||||
SDL_GL_SetSwapInterval(vsync_renderlayer);
|
SDL_GL_SetSwapInterval(vsync_renderlayer);
|
||||||
|
|
|
@ -128,7 +128,7 @@ static GUID guidDevs;
|
||||||
char di_disabled = 0;
|
char di_disabled = 0;
|
||||||
static char di_devacquired;
|
static char di_devacquired;
|
||||||
static HANDLE di_inputevt = 0;
|
static HANDLE di_inputevt = 0;
|
||||||
static int32_t joyblast=0;
|
//static int32_t joyblast=0;
|
||||||
|
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
|
@ -685,8 +685,6 @@ int32_t handleevents(void)
|
||||||
//
|
//
|
||||||
int32_t initinput(void)
|
int32_t initinput(void)
|
||||||
{
|
{
|
||||||
int32_t i;
|
|
||||||
|
|
||||||
Win_GetOriginalLayoutName();
|
Win_GetOriginalLayoutName();
|
||||||
Win_SetKeyboardLayoutUS(1);
|
Win_SetKeyboardLayoutUS(1);
|
||||||
|
|
||||||
|
@ -860,7 +858,8 @@ void releaseallbuttons(void)
|
||||||
for (i=0; i<32; i++)
|
for (i=0; i<32; i++)
|
||||||
if (joystick.bits & (1<<i)) joystick.pCallback(i+1, 0);
|
if (joystick.bits & (1<<i)) joystick.pCallback(i+1, 0);
|
||||||
}
|
}
|
||||||
joystick.bits = joyblast = 0;
|
joystick.bits = 0;
|
||||||
|
//joyblast = 0;
|
||||||
|
|
||||||
for (i=0; i<NUMKEYS; i++)
|
for (i=0; i<NUMKEYS; i++)
|
||||||
{
|
{
|
||||||
|
@ -889,7 +888,7 @@ static BOOL CALLBACK InitDirectInput_enum(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRe
|
||||||
return DIENUM_CONTINUE;
|
return DIENUM_CONTINUE;
|
||||||
|
|
||||||
inputdevices |= 4;
|
inputdevices |= 4;
|
||||||
d = "CONTROLLER"
|
d = "CONTROLLER";
|
||||||
Bmemcpy(&guidDevs, &lpddi->guidInstance, sizeof(GUID));
|
Bmemcpy(&guidDevs, &lpddi->guidInstance, sizeof(GUID));
|
||||||
|
|
||||||
initprintf(" * %s: %s\n", d, lpddi->tszProductName);
|
initprintf(" * %s: %s\n", d, lpddi->tszProductName);
|
||||||
|
@ -2703,14 +2702,23 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp)
|
||||||
ReleaseOpenGL();
|
ReleaseOpenGL();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
} else if (loadglulibrary(getenv("BUILD_GLULIB")))
|
}
|
||||||
|
else if (loadglulibrary(getenv("BUILD_GLULIB")))
|
||||||
{
|
{
|
||||||
initprintf("Failure loading GLU. GL modes are unavailable.\n");
|
initprintf("Failure loading GLU. GL modes are unavailable.\n");
|
||||||
nogl = 1;
|
nogl = 1;
|
||||||
ReleaseOpenGL();
|
ReleaseOpenGL();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
} else
|
}
|
||||||
|
else if (GLVersion.major < 2)
|
||||||
|
{
|
||||||
|
initprintf("Your computer does not support OpenGL version 2 or greater. GL modes are unavailable.\n");
|
||||||
|
nogl = 1;
|
||||||
|
ReleaseOpenGL();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
glLoaded = 1;
|
glLoaded = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue