static void find_resolution() { int i,bestw,besth,wantedw,wantedh; wantedw=fullscreen_width>consoleWidth*fontWidth?fullscreen_width:consoleWidth*fontWidth; wantedh=fullscreen_height>consoleHeight*fontHeight?fullscreen_height:consoleHeight*fontHeight; actual_fullscreen_width=wantedw; actual_fullscreen_height=wantedh; bestw=99999; besth=99999; for(i=0;i < sfVideoMode_GetModesCount();i++) { sfVideoMode mode=sfVideoMode_GetMode(i); if (mode.Width >= wantedw && mode.Width <= bestw && mode.Height >= wantedh && mode.Height <= besth ) { bestw=mode.Width; besth=mode.Height; } } if ( bestw != 99999) { actual_fullscreen_width=bestw; actual_fullscreen_height=besth; } //printf ("resolution : %dx%d =>%dx%d\n",wantedw,wantedh,bestw,besth); }
void w_sfVideoMode_GetMode(size_t Index, sfVideoMode *Mode) { *Mode = sfVideoMode_GetMode(Index); }