Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/resinfs
7 changes: 7 additions & 0 deletions src/DrawUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,13 @@ void CST_filledCircleRGBA(CST_Renderer* renderer, uint32_t x, uint32_t y, uint32
#endif
}

CST_DisplayMode CST_GetCurrentDisplayMode()
{
CST_DisplayMode currentMode;
SDL_GetCurrentDisplayMode(0, &currentMode);
return currentMode;
}

void CST_SetWindowSize(CST_Window* window, int w, int h)
{
// actually resize the window, and adjust it for high DPI
Expand Down
3 changes: 3 additions & 0 deletions src/DrawUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ typedef SDL_Surface CST_Surface;
typedef SDL_Color CST_Color;
typedef SDL_Rect CST_Rect;

typedef SDL_DisplayMode CST_DisplayMode;

class RootDisplay;
class InputEvents;

Expand Down Expand Up @@ -75,6 +77,7 @@ void CST_rectangleRGBA (
Uint8 r, Uint8 g, Uint8 b, Uint8 a
);
float CST_GetDpiScale();
CST_DisplayMode CST_GetCurrentDisplayMode();
void CST_SetWindowSize(CST_Window* renderer, int w, int h);
void CST_Delay(int time);

Expand Down
2 changes: 2 additions & 0 deletions src/RootDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ RootDisplay::RootDisplay()
setScreenResolution(640, 480);
#elif defined(_3DS) || defined(_3DS_MOCK)
setScreenResolution(400, 480); // 3ds has a special resolution!
#elif defined(__WIIU__)
setScreenResolution(CST_GetCurrentDisplayMode().w, CST_GetCurrentDisplayMode().h);
#else
// setScreenResolution(640, 480);
setScreenResolution(1280, 720);
Expand Down