33 memset(&m_mode, 0,
sizeof(m_mode));
38 numDisplays = SDL_GetNumVideoDisplays();
45 GHOST_ASSERT(display < 1,
"Only single display systems are currently supported.\n");
47 numSettings = SDL_GetNumDisplayModes(display - 1);
56 setting.
bpp = SDL_BYTESPERPIXEL(mode->format) * 8;
58 setting.
frequency = mode->refresh_rate ? mode->refresh_rate : 60;
73 GHOST_ASSERT(display < 1,
"Only single display systems are currently supported.\n");
76 SDL_GetDisplayMode(display, index, &mode);
87 SDL_GetCurrentDisplayMode(display, &mode);
111 SDL_DisplayMode mode;
112 const int num_modes = SDL_GetNumDisplayModes(display);
113 int best_fit, best_dist, dist,
x,
y;
118 if (num_modes == 0) {
123 for (
int i = 0; i < num_modes; i++) {
125 SDL_GetDisplayMode(display, i, &mode);
133 dist = (
x *
x) + (
y *
y);
134 if (dist < best_dist) {
143 SDL_GetDisplayMode(display, best_fit, &mode);
154 SDL_SetWindowDisplayMode(sdl_win, &mode);
155 SDL_ShowWindow(sdl_win);
156 SDL_SetWindowFullscreen(sdl_win, SDL_TRUE);
163 printf(
"no windows available, cant fullscreen\n");
#define GHOST_ASSERT(x, info)
static void ghost_mode_to_sdl(const GHOST_DisplaySetting &setting, SDL_DisplayMode *mode)
static void ghost_mode_from_sdl(GHOST_DisplaySetting &setting, SDL_DisplayMode *mode)
unsigned char GHOST_TUns8
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting &setting) const
GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const
GHOST_TSuccess getCurrentDisplayModeSDL(SDL_DisplayMode &mode) const
GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting &setting) const
GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, const GHOST_DisplaySetting &setting)
GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32 &numSettings) const
GHOST_DisplayManagerSDL(GHOST_SystemSDL *system)
GHOST_WindowManager * getWindowManager() const
GHOST_IWindow * getActiveWindow(void) const
SDL_Window * getSDLWindow()