mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 13:23:59 +02:00
- added ability to check if compiler supports SSE and if not fallback to X87 for streflop.
- added ability for clients to specify gamma override value for drivers which support it
This commit is contained in:
@@ -1587,6 +1587,11 @@ bool changeVideoMode(int resW, int resH, int colorBits, int ) {
|
||||
|
||||
void restoreVideoMode(bool exitingApp) {
|
||||
//SDL_Quit();
|
||||
if(exitingApp == true && SDL_WasInit(SDL_INIT_VIDEO)) {
|
||||
SDL_ShowCursor(1);
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
SDL_SetGamma(1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int getScreenW() {
|
||||
|
@@ -50,7 +50,9 @@ PlatformContextGl::~PlatformContextGl() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,bool hardware_acceleration, bool fullscreen_anti_aliasing) {
|
||||
void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,
|
||||
bool hardware_acceleration,
|
||||
bool fullscreen_anti_aliasing, float gammaValue) {
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
@@ -209,7 +211,15 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,bool
|
||||
//fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
|
||||
|
||||
int bufferSize = (resW * resH * BaseColorPickEntity::COLOR_COMPONENTS);
|
||||
BaseColorPickEntity::init(bufferSize);
|
||||
BaseColorPickEntity::init(bufferSize);
|
||||
|
||||
if(gammaValue != 0.0) {
|
||||
//printf("Attempting to call SDL_SetGamma using value %f\n", gammaValue);
|
||||
|
||||
if (SDL_SetGamma(gammaValue, gammaValue, gammaValue) < 0) {
|
||||
printf("WARNING, SDL_SetGamma failed using value %f [%s]\n", gammaValue,SDL_GetError());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,12 +22,15 @@ namespace Shared{ namespace Platform{
|
||||
// class WindowGl
|
||||
// =====================================================
|
||||
|
||||
void WindowGl::initGl(int colorBits, int depthBits, int stencilBits,bool hardware_acceleration, bool fullscreen_anti_aliasing){
|
||||
void WindowGl::initGl(int colorBits, int depthBits, int stencilBits,
|
||||
bool hardware_acceleration, bool fullscreen_anti_aliasing,
|
||||
float gammaValue) {
|
||||
context.setColorBits(colorBits);
|
||||
context.setDepthBits(depthBits);
|
||||
context.setStencilBits(stencilBits);
|
||||
context.setHardware_acceleration(hardware_acceleration);
|
||||
context.setFullscreen_anti_aliasing(fullscreen_anti_aliasing);
|
||||
context.setGammaValue(gammaValue);
|
||||
|
||||
context.init();
|
||||
}
|
||||
|
Reference in New Issue
Block a user