displays -- almost there

This commit is contained in:
Lars A. Doucet
2015-07-30 15:32:20 -05:00
parent a99ee5af17
commit e04b18cd8a
2 changed files with 6 additions and 5 deletions

View File

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

View File

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