From e04b18cd8ac343eb261f570ae6f638b76833ed6c Mon Sep 17 00:00:00 2001 From: "Lars A. Doucet" Date: Thu, 30 Jul 2015 15:32:20 -0500 Subject: [PATCH] displays -- almost there --- project/include/system/Display.h | 6 +++--- project/src/backend/sdl/SDLDisplay.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/project/include/system/Display.h b/project/include/system/Display.h index 3d7255877..f9c4afd09 100644 --- a/project/include/system/Display.h +++ b/project/include/system/Display.h @@ -11,13 +11,13 @@ namespace lime { public: - value Display::GetCurrentDisplayMode (int displayIndex); - value Display::GetDisplayMode (int displayIndex, int modeIndex); + static value Display::GetCurrentDisplayMode (int displayIndex); + static value Display::GetDisplayMode (int displayIndex, int modeIndex); static int GetNumDevices (); static const char* GetDisplayName (int displayIndex); static int GetNumDisplayModes (int displayIndex); - + } } diff --git a/project/src/backend/sdl/SDLDisplay.cpp b/project/src/backend/sdl/SDLDisplay.cpp index 39e1964a3..a0c7d6857 100644 --- a/project/src/backend/sdl/SDLDisplay.cpp +++ b/project/src/backend/sdl/SDLDisplay.cpp @@ -7,7 +7,7 @@ namespace lime { value Display::GetCurrentDisplayMode (int displayIndex) { SDL_DisplayMode mode = { SDL_PIXELFORMAT_UNKNOWN, 0, 0, 0, 0 }; - SDL_GetCurrentDisplayMode(displayIndex, mode); + SDL_GetCurrentDisplayMode(displayIndex, &mode); value mValue = alloc_empty_object (); alloc_field (mValue, val_id("w"), alloc_int(mode.w)); @@ -15,12 +15,13 @@ namespace lime { alloc_field (mValue, val_id("refresh_rate"), alloc_int(mode.refresh_rate)); alloc_field (mValue, val_id("format"), alloc_int(mode.format)); return mValue; + } value Display::GetDisplayMode (int displayIndex, int modeIndex) { SDL_DisplayMode mode = { SDL_PIXELFORMAT_UNKNOWN, 0, 0, 0, 0 }; - SDL_GetDisplayMode(displayIndex, modeIndex, mode); + SDL_GetDisplayMode(displayIndex, modeIndex, &mode); value mValue = alloc_empty_object (); alloc_field (mValue, val_id("w"), alloc_int(mode.w));