add res enumeration to LLW SDL
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "RageDisplay.h" // for REFRESH_DEFAULT
|
||||
#include "StepMania.h"
|
||||
#include "GameLoop.h"
|
||||
#include "DisplayResolutions.h"
|
||||
|
||||
#if defined(MACOSX)
|
||||
extern "C"
|
||||
@@ -225,6 +226,18 @@ void LowLevelWindow_SDL::Update()
|
||||
}
|
||||
}
|
||||
|
||||
void LowLevelWindow_SDL::GetDisplayResolutions( DisplayResolutions &out ) const
|
||||
{
|
||||
SDL_Rect **modes = SDL_ListModes(NULL, SDL_RESIZABLE | SDL_OPENGL | SDL_FULLSCREEN );
|
||||
ASSERT_M( modes, "No modes available" );
|
||||
|
||||
for(int i=0; modes[i]; ++i )
|
||||
{
|
||||
DisplayResolution res = { modes[i]->w, modes[i]->h };
|
||||
out.s.insert( res );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2003-2004 Chris Danford, Glenn Maynard
|
||||
* All rights reserved.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define LOW_LEVEL_WINDOW_SDL_H
|
||||
|
||||
#include "LowLevelWindow.h"
|
||||
#include "RageDisplay.h"
|
||||
|
||||
class LowLevelWindow_SDL: public LowLevelWindow
|
||||
{
|
||||
@@ -10,6 +11,8 @@ public:
|
||||
~LowLevelWindow_SDL();
|
||||
void *GetProcAddress(CString s);
|
||||
CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut );
|
||||
virtual void GetDisplayResolutions( DisplayResolutions &out ) const;
|
||||
|
||||
void SwapBuffers();
|
||||
void Update();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user