Skip to content

Commit

Permalink
fix: update imgui helpers (#98)
Browse files Browse the repository at this point in the history
update supportsViewports to correctly return false for swithc
add supportsWindowedFullscreen method

Co-authored-by: briaguya <briaguya@alice>
  • Loading branch information
briaguya-ai and briaguya committed Jan 18, 2023
1 parent 486c45b commit 7f04a56
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/menu/ImGuiImpl.cpp
Expand Up @@ -312,7 +312,25 @@ void ImGuiRenderDrawData(ImDrawData* data) {
}
}

bool supportsWindowedFullscreen() {
#ifdef __SWITCH__
return false;
#endif

// We don't yet support windowed fullscreen on DirectX
switch (impl.backend) {
case Backend::SDL:
return true;
default:
return false;
}
}

bool supportsViewports() {
#ifdef __SWITCH__
return false;
#endif

switch (impl.backend) {
case Backend::DX11:
return true;
Expand Down
1 change: 1 addition & 0 deletions src/menu/ImGuiImpl.h
Expand Up @@ -66,6 +66,7 @@ typedef struct {
WindowDrawFunc drawFunc;
} CustomWindow;

bool supportsWindowedFullscreen();
bool supportsViewports();

void Init(WindowImpl window_impl);
Expand Down

0 comments on commit 7f04a56

Please sign in to comment.