无边框窗口
This commit is contained in:
parent
ca01bf072c
commit
8c2bc80e05
@ -50,10 +50,6 @@ void application::init(const window_params& in_window_params, int argc, char** a
|
|||||||
int application::run() {
|
int application::run() {
|
||||||
while (!g_exit_requested) {
|
while (!g_exit_requested) {
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
g_exit_requested = glfwWindowShouldClose(window_);
|
|
||||||
if (g_exit_requested)
|
|
||||||
break;
|
|
||||||
|
|
||||||
renderer_->new_frame(window_);
|
renderer_->new_frame(window_);
|
||||||
draw_gui();
|
draw_gui();
|
||||||
renderer_->end_frame(window_);
|
renderer_->end_frame(window_);
|
||||||
@ -108,6 +104,7 @@ void application::init_glfw() {
|
|||||||
spdlog::error("Failed to initialize GLFW");
|
spdlog::error("Failed to initialize GLFW");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void application::init_imgui() {
|
void application::init_imgui() {
|
||||||
@ -119,6 +116,8 @@ void application::init_imgui() {
|
|||||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
|
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
|
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
|
||||||
|
io.ConfigViewportsNoAutoMerge = true;
|
||||||
|
io.ConfigViewportsNoTaskBarIcon = false;
|
||||||
ImGui::StyleColorsDark();
|
ImGui::StyleColorsDark();
|
||||||
//ImGui::StyleColorsLight();
|
//ImGui::StyleColorsLight();
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,11 @@ public:
|
|||||||
|
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
|
|
||||||
|
void request_exit() {
|
||||||
|
glfwSetWindowShouldClose(window_, GLFW_TRUE);
|
||||||
|
g_exit_requested = true;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void draw_gui() = 0;
|
virtual void draw_gui() = 0;
|
||||||
|
|
||||||
virtual const char* get_shader_path() = 0;
|
virtual const char* get_shader_path() = 0;
|
||||||
|
18
core/widget/uilts.h
Normal file
18
core/widget/uilts.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "extern.h"
|
||||||
|
#include "imgui.h"
|
||||||
|
#include "imgui_internal.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
void HideTabBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace ImGui {
|
||||||
|
inline void HideTabBar()
|
||||||
|
{
|
||||||
|
ImGuiWindowClass window_class;
|
||||||
|
window_class.DockNodeFlagsOverrideSet = ImGuiDockNodeFlags_NoWindowMenuButton;
|
||||||
|
// window_class.DockNodeFlagsOverrideSet = ImGuiDockNodeFlags_NoTabBar;
|
||||||
|
SetNextWindowClass(&window_class);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user