mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
Bugfixes so that win32 code will compile with latest sdl changes
This commit is contained in:
parent
1f2c805fe8
commit
a6609cbdab
Binary file not shown.
@ -106,6 +106,7 @@ vector<std::pair<string,int32> > getFolderTreeContentsCheckSumListRecursively(co
|
||||
void createDirectoryPaths(string Path);
|
||||
string extractDirectoryPathFromFile(string filename);
|
||||
|
||||
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight);
|
||||
bool changeVideoMode(int resH, int resW, int colorBits, int refreshFrequency);
|
||||
void restoreVideoMode();
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <direct.h>
|
||||
#include <algorithm>
|
||||
#include "opengl.h"
|
||||
|
||||
#include "leak_dumper.h"
|
||||
|
||||
@ -456,10 +455,44 @@ void createDirectoryPaths(string Path)
|
||||
|
||||
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
|
||||
// Get the current video hardware information
|
||||
const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
|
||||
colorBits = vidInfo->vfmt->BitsPerPixel;
|
||||
screenWidth = vidInfo->current_w;
|
||||
screenHeight = vidInfo->current_h;
|
||||
//const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
|
||||
//colorBits = vidInfo->vfmt->BitsPerPixel;
|
||||
//screenWidth = vidInfo->current_w;
|
||||
|
||||
/*
|
||||
//screenHeight = vidInfo->current_h;
|
||||
int cx = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
// height
|
||||
int cy = GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||
|
||||
printf("cx = %d, cy = %d\n",cx,cy);
|
||||
|
||||
if(cx > screenWidth) {
|
||||
screenWidth = cx;
|
||||
screenHeight = cy;
|
||||
}
|
||||
*/
|
||||
int iMaxWidth = -1;
|
||||
int iMaxHeight = -1;
|
||||
int iMaxBits = -1;
|
||||
|
||||
DEVMODE devMode;
|
||||
for (int i=0; EnumDisplaySettings(NULL, i, &devMode) ;i++){
|
||||
|
||||
printf("devMode.dmPelsWidth = %d, devMode.dmPelsHeight = %d, devMode.dmBitsPerPel = %d\n",devMode.dmPelsWidth,devMode.dmPelsHeight,devMode.dmBitsPerPel);
|
||||
|
||||
if(devMode.dmPelsWidth > iMaxWidth) {
|
||||
iMaxWidth = devMode.dmPelsWidth;
|
||||
iMaxHeight = devMode.dmPelsHeight;
|
||||
iMaxBits = devMode.dmBitsPerPel;
|
||||
//devMode.dmDisplayFrequency=refreshFrequency;
|
||||
}
|
||||
}
|
||||
if(iMaxWidth > 0) {
|
||||
colorBits = iMaxBits;
|
||||
screenWidth = iMaxWidth;
|
||||
screenHeight = iMaxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
bool changeVideoMode(int resW, int resH, int colorBits, int refreshFrequency){
|
||||
|
Loading…
x
Reference in New Issue
Block a user