Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

able to change window modes at runtime #174

Merged
merged 1 commit into from
Jul 22, 2024
Merged
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
4 changes: 4 additions & 0 deletions include/cute_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@ CF_API void CF_CALL cf_app_set_vsync(bool true_turn_on_vsync);
*/
CF_API bool CF_CALL cf_app_get_vsync();

CF_API void cf_app_set_window_mode();
CF_API void cf_app_set_borderless_fullscreen_mode();
CF_API void cf_app_set_fullscreen_mode();

/**
* @enum CF_PowerState
* @category app
Expand Down
15 changes: 15 additions & 0 deletions src/cute_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,21 @@ bool cf_app_get_vsync()
return app->vsync;
}

void cf_app_set_window_mode()
{
SDL_SetWindowFullscreen(app->window, 0);
}

void cf_app_set_borderless_fullscreen_mode()
{
SDL_SetWindowFullscreen(app->window, SDL_WINDOW_FULLSCREEN_DESKTOP);
}

void cf_app_set_fullscreen_mode()
{
SDL_SetWindowFullscreen(app->window, SDL_WINDOW_FULLSCREEN);
}

ImGuiContext* cf_app_init_imgui(bool no_default_font)
{
if (!app->gfx_enabled) return NULL;
Expand Down
Loading