2018-06-27 07:01:37 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-07-17 18:13:08 +02:00
|
|
|
#include <SDL_stdinc.h>
|
2018-06-27 07:01:37 +02:00
|
|
|
|
|
|
|
class Display
|
|
|
|
{
|
|
|
|
private:
|
2018-06-27 17:32:41 +02:00
|
|
|
Sint32 width;
|
|
|
|
Sint32 height;
|
2018-06-27 07:01:37 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Display ();
|
|
|
|
|
|
|
|
public:
|
|
|
|
static Display & getDisplay ();
|
|
|
|
|
2018-06-27 17:31:59 +02:00
|
|
|
void readDisplaySize ();
|
2018-06-28 23:54:30 +02:00
|
|
|
void setDisplaySize (Sint32 w, Sint32 h);
|
2018-06-27 07:01:37 +02:00
|
|
|
Sint32 getWidth ();
|
|
|
|
Sint32 getHeight ();
|
|
|
|
Sint32 getLogicWidth ();
|
|
|
|
Sint32 getLogicHeight ();
|
|
|
|
};
|
|
|
|
|
2018-06-27 17:31:59 +02:00
|
|
|
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);
|
|
|
|
}
|