mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
set window size/pos at the relevant place, each window sets its own
This commit is contained in:
parent
f29bde9551
commit
6653f91e88
@ -1282,21 +1282,12 @@ void Steam_Overlay::overlay_render_proc()
|
|||||||
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
||||||
if (!Ready()) return;
|
if (!Ready()) return;
|
||||||
|
|
||||||
ImGuiIO &io = ImGui::GetIO();
|
|
||||||
|
|
||||||
// Set the overlay windows to the size of the game window
|
|
||||||
// only if we have a reason (full overlay or just some notification)
|
|
||||||
if (show_overlay || notifications.size()) {
|
|
||||||
ImGui::SetNextWindowPos({ 0,0 });
|
|
||||||
ImGui::SetNextWindowSize({ io.DisplaySize.x, io.DisplaySize.y });
|
|
||||||
ImGui::SetNextWindowBgAlpha(0.55f);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (show_overlay) {
|
if (show_overlay) {
|
||||||
render_main_window();
|
render_main_window();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notifications.size()) {
|
if (notifications.size()) {
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
build_notifications(io.DisplaySize.x, io.DisplaySize.y);
|
build_notifications(io.DisplaySize.x, io.DisplaySize.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1377,10 +1368,6 @@ uint32 Steam_Overlay::apply_global_style_color()
|
|||||||
// Try to make this function as short as possible or it might affect game's fps.
|
// Try to make this function as short as possible or it might affect game's fps.
|
||||||
void Steam_Overlay::render_main_window()
|
void Steam_Overlay::render_main_window()
|
||||||
{
|
{
|
||||||
//ImGui::SetNextWindowFocus();
|
|
||||||
ImGui::PushFont(font_default);
|
|
||||||
uint32 style_color_stack = apply_global_style_color();
|
|
||||||
|
|
||||||
char tmp[TRANSLATION_BUFFER_SIZE]{};
|
char tmp[TRANSLATION_BUFFER_SIZE]{};
|
||||||
snprintf(tmp, sizeof(tmp), translationRenderer[current_language], (_renderer == nullptr ? "Unknown" : _renderer->GetLibraryName().c_str()));
|
snprintf(tmp, sizeof(tmp), translationRenderer[current_language], (_renderer == nullptr ? "Unknown" : _renderer->GetLibraryName().c_str()));
|
||||||
std::string windowTitle{};
|
std::string windowTitle{};
|
||||||
@ -1390,6 +1377,13 @@ void Steam_Overlay::render_main_window()
|
|||||||
|
|
||||||
bool show = true;
|
bool show = true;
|
||||||
|
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
|
||||||
|
ImGui::PushFont(font_default);
|
||||||
|
uint32 style_color_stack = apply_global_style_color();
|
||||||
|
|
||||||
|
ImGui::SetNextWindowPos({ 0, 0 });
|
||||||
|
ImGui::SetNextWindowSize({ io.DisplaySize.x, io.DisplaySize.y });
|
||||||
if (ImGui::Begin(windowTitle.c_str(), &show,
|
if (ImGui::Begin(windowTitle.c_str(), &show,
|
||||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse |
|
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse |
|
||||||
ImGuiWindowFlags_NoBringToFrontOnFocus)) {
|
ImGuiWindowFlags_NoBringToFrontOnFocus)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user