- 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:
Mark Vejvoda
2011-12-23 08:20:54 +00:00
parent f38c8c9f63
commit 2e94c32d59
14 changed files with 103 additions and 22 deletions

View File

@@ -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() {

View File

@@ -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());
}
}
}
}

View File

@@ -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();
}