Functions | |
void NAPAPI | showWindow (SDL_Window *window, bool show) |
void NAPAPI | raiseWindow (SDL_Window *window) |
bool NAPAPI | setFullscreen (SDL_Window *window, bool value) |
bool NAPAPI | getFullscreen (SDL_Window *window) |
glm::ivec2 NAPAPI | getWindowSize (SDL_Window *window) |
uint32 NAPAPI | getWindowFlags (SDL_Window *window) |
glm::ivec2 NAPAPI | getScreenSize (int screenIndex) |
void NAPAPI | setWindowSize (SDL_Window *window, const glm::ivec2 &size) |
glm::ivec2 NAPAPI | getDrawableWindowSize (SDL_Window *window) |
glm::ivec2 NAPAPI | getWindowPosition (SDL_Window *window) |
void NAPAPI | setWindowPosition (SDL_Window *window, const glm::ivec2 &position) |
void NAPAPI | shutdownVideo () |
std::string NAPAPI | getSDLError () |
uint32_t NAPAPI | getWindowId (SDL_Window *window) |
int NAPAPI | getDisplayCount () |
int NAPAPI | getDisplayIndex (SDL_Window *window) |
int NAPAPI | getDisplayDPI (int displayIndex, float *ddpi, float *hdpi, float *vdpi) |
int NAPAPI | getDisplayDPI (SDL_Window *window, float *ddpi, float *hdpi, float *vdpi) |
bool NAPAPI | getDisplayName (int displayIndex, std::string &outName) |
int NAPAPI | getDisplayBounds (int displayIndex, glm::ivec2 &outMin, glm::ivec2 &outMax) |
void NAPAPI | hideCursor () |
void NAPAPI | showCursor () |
bool NAPAPI | cursorVisible () |
void NAPAPI | toggleCursor () |
glm::ivec2 NAPAPI | getCursorPosition () |
glm::ivec2 NAPAPI | getGlobalCursorPosition () |
uint32 NAPAPI | getMouseState (int *x, int *y) |
uint32 NAPAPI | getGlobalMouseState (int *x, int *y) |
bool NAPAPI | initVideo (utility::ErrorState &error) |
void NAPAPI | setWindowBordered (SDL_Window *window, bool hasBorders) |
void NAPAPI | setWindowTitle (SDL_Window *window, const std::string &name) |
bool NAPAPI nap::SDL::cursorVisible | ( | ) |
Returns if the cursor is visible
glm::ivec2 NAPAPI nap::SDL::getCursorPosition | ( | ) |
Returns the mouse cursor position relative to the focus window.
int NAPAPI nap::SDL::getDisplayBounds | ( | int | displayIndex, |
glm::ivec2 & | outMin, | ||
glm::ivec2 & | outMax | ||
) |
Gets desktop area represented by a display, with the primary display located at 0,0
displayIndex | index of the display to get the bounds for |
outMin | min position of desktop area represented by a display, with the primary display located at 0,0 |
outMax | max position of desktop area represented by a display, with the primary display located at 0,0 |
int NAPAPI nap::SDL::getDisplayCount | ( | ) |
Get the number of available video displays.
int NAPAPI nap::SDL::getDisplayDPI | ( | int | displayIndex, |
float * | ddpi, | ||
float * | hdpi, | ||
float * | vdpi | ||
) |
Get he dots/pixels-per-inch for a display.
displayIndex | The index of the display from which DPI information should be queried |
ddpi | a pointer filled in with the diagonal DPI of the display; may be nullptr |
hdpi | a pointer filled in with the horizontal DPI of the display; may be nullptr |
vdpi | a pointer filled in with the vertical DPI of the display; may be nullptr |
int NAPAPI nap::SDL::getDisplayDPI | ( | SDL_Window * | window, |
float * | ddpi, | ||
float * | hdpi, | ||
float * | vdpi | ||
) |
Get the dots/pixels-per-inch of the display that holds the given window
window | the window to get the dpi for |
ddpi | a pointer filled in with the diagonal DPI of the display; may be nullptr |
hdpi | a pointer filled in with the horizontal DPI of the display; may be nullptr |
vdpi | a pointer filled in with the vertical DPI of the display; may be nullptr |
int NAPAPI nap::SDL::getDisplayIndex | ( | SDL_Window * | window | ) |
Get the index of the display associated with a window.
window | the window to get the display index for |
bool NAPAPI nap::SDL::getDisplayName | ( | int | displayIndex, |
std::string & | outName | ||
) |
displayIndex | index of display to get name for |
outName | display name for given display index |
glm::ivec2 NAPAPI nap::SDL::getDrawableWindowSize | ( | SDL_Window * | window | ) |
Returns the actual size in pixels of a window, which can be different from the represented window size. This is the case with High DPI screens on OSX
bool NAPAPI nap::SDL::getFullscreen | ( | SDL_Window * | window | ) |
Returns if the window is full screen (Desktop)
glm::ivec2 NAPAPI nap::SDL::getGlobalCursorPosition | ( | ) |
Get the position of the cursor, in relation to the desktop. This works just like getCursorPosition(), but the coordinates will be reported relative to the top-left of the desktop. Current position of the cursor, in relation to the desktop
uint32 NAPAPI nap::SDL::getGlobalMouseState | ( | int * | x, |
int * | y | ||
) |
Get the current state of the mouse, in relation to the desktop. This works just like getMouseState(), but the coordinates will be reported relative to the top-left of the desktop.
x | the current x coordinate, relative to the desktop. Can be nullptr |
y | the current y coordinate, relative to the desktop. Can be nullptr |
uint32 NAPAPI nap::SDL::getMouseState | ( | int * | x, |
int * | y | ||
) |
Get the current state of the mouse relative to the focus window.
x | the current x coordinate. Can be nullptr |
y | the current y coordinate. Can be nullptr |
glm::ivec2 NAPAPI nap::SDL::getScreenSize | ( | int | screenIndex | ) |
screenIndex | the number of the display |
std::string NAPAPI nap::SDL::getSDLError | ( | ) |
@ return the last SDL error as a string
uint32 NAPAPI nap::SDL::getWindowFlags | ( | SDL_Window * | window | ) |
window | the window to get the flags for |
uint32_t NAPAPI nap::SDL::getWindowId | ( | SDL_Window * | window | ) |
glm::ivec2 NAPAPI nap::SDL::getWindowPosition | ( | SDL_Window * | window | ) |
returns the window position as pixel coordinates
window | the window to get the position for |
glm::ivec2 NAPAPI nap::SDL::getWindowSize | ( | SDL_Window * | window | ) |
Returns the size of an SDL window
window | the window to retrieve the size for |
void NAPAPI nap::SDL::hideCursor | ( | ) |
Hides the mouse cursor
bool NAPAPI nap::SDL::initVideo | ( | utility::ErrorState & | error | ) |
Initializes SDL video system. Call this before creating any windows or render contexts!
void NAPAPI nap::SDL::raiseWindow | ( | SDL_Window * | window | ) |
Makes sure the window is on top and receives input focus.
window | the window to raise |
bool NAPAPI nap::SDL::setFullscreen | ( | SDL_Window * | window, |
bool | value | ||
) |
Sets the window to be full screen in desktop mode
window | the window to enable / disable |
value | if the window is full screen |
void NAPAPI nap::SDL::setWindowBordered | ( | SDL_Window * | window, |
bool | hasBorders | ||
) |
Controls if the window has any borders.
window | the window to set |
hasBorders | if the window should have borders |
void NAPAPI nap::SDL::setWindowPosition | ( | SDL_Window * | window, |
const glm::ivec2 & | position | ||
) |
Set the position of a window on screen.
window | the window to set the position for |
position | the window location in pixels |
void NAPAPI nap::SDL::setWindowSize | ( | SDL_Window * | window, |
const glm::ivec2 & | size | ||
) |
resizes an SDL window
window | the window to resize |
size | the new window size |
void NAPAPI nap::SDL::setWindowTitle | ( | SDL_Window * | window, |
const std::string & | name | ||
) |
Sets the window title.
window | the window to set the title for |
name | the new window name |
void NAPAPI nap::SDL::showCursor | ( | ) |
Shows the mouse cursor
void NAPAPI nap::SDL::showWindow | ( | SDL_Window * | window, |
bool | show | ||
) |
Makes a window visible.
window | pointer to the window to make visible. |
show | if the window is shown or hidden |
void NAPAPI nap::SDL::shutdownVideo | ( | ) |
Shutdown SDL
void NAPAPI nap::SDL::toggleCursor | ( | ) |
Toggles cursor visibility on / off