Add guGetDisplayState function to libgu

This function allows users to get if the display is turned on in libgu.
This can be useful for libraries like SDL, which want a way to check if
it is before trying to display the on-screen keyboard or a native
message dialog, since those do not work before libgu has been fully
initialized.
This commit is contained in:
Wouter Wijsman
2024-07-15 12:30:24 +02:00
parent 7fb1360259
commit 76bae20779
2 changed files with 16 additions and 0 deletions

View File

@@ -1537,6 +1537,17 @@ void* guGetStaticVramBuffer(unsigned int width, unsigned int height, unsigned in
**/
void* guGetStaticVramTexture(unsigned int width, unsigned int height, unsigned int psm);
/**
* Get state of display
*
* Available states are:
* - GU_TRUE (1) - Display is turned on
* - GU_FALSE (0) - Display is turned off
*
* @return State of the display
**/
int guGetDisplayState();
/**@}*/
#if defined(__cplusplus)

View File

@@ -21,3 +21,8 @@ int sceGuDisplay(int state)
gu_display_on = state;
return state;
}
int guGetDisplayState()
{
return gu_display_on;
}