mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
56 lines
749 B
C++
56 lines
749 B
C++
|
|
#pragma once
|
|
|
|
#include <SDL_stdinc.h>
|
|
|
|
class Display
|
|
{
|
|
private:
|
|
Sint32 width;
|
|
Sint32 height;
|
|
|
|
private:
|
|
Display ();
|
|
|
|
public:
|
|
static Display & getDisplay ();
|
|
|
|
bool isWide ();
|
|
void readDisplaySize ();
|
|
void setDisplaySize (Sint32 w, Sint32 h);
|
|
Sint32 getWidth ();
|
|
Sint32 getHeight ();
|
|
Sint32 getLogicWidth ();
|
|
Sint32 getLogicHeight ();
|
|
};
|
|
|
|
inline Sint32
|
|
LXLOGIC ()
|
|
{
|
|
return Display::getDisplay ().getLogicWidth ();
|
|
}
|
|
|
|
inline Sint32
|
|
LYLOGIC ()
|
|
{
|
|
return Display::getDisplay ().getLogicHeight ();
|
|
}
|
|
|
|
inline Sint32
|
|
LXIMAGE ()
|
|
{
|
|
return Display::getDisplay ().getWidth ();
|
|
}
|
|
|
|
inline Sint32
|
|
LYIMAGE ()
|
|
{
|
|
return Display::getDisplay ().getHeight ();
|
|
}
|
|
|
|
inline Sint32
|
|
LXOFFSET ()
|
|
{
|
|
return ((LXIMAGE () - LXLOGIC ()) / 2);
|
|
}
|