mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 10:19:59 +01:00
UserInterface tracking of keyboard modifier and fullscreen.
This commit is contained in:
@@ -385,10 +385,17 @@ float Rendering::MonitorHeight()
|
|||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Rendering::IsFullscreen ()
|
||||||
|
{
|
||||||
|
return (glfwGetWindowMonitor(main_window_) != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void Rendering::ToggleFullscreen()
|
void Rendering::ToggleFullscreen()
|
||||||
{
|
{
|
||||||
// if in fullscreen mode
|
// if in fullscreen mode
|
||||||
if (glfwGetWindowMonitor(main_window_) != nullptr) {
|
if (IsFullscreen()) {
|
||||||
// set to window mode
|
// set to window mode
|
||||||
glfwSetWindowMonitor( main_window_, nullptr, Settings::application.windows.front().x,
|
glfwSetWindowMonitor( main_window_, nullptr, Settings::application.windows.front().x,
|
||||||
Settings::application.windows.front().y,
|
Settings::application.windows.front().y,
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public:
|
|||||||
class Screenshot *CurrentScreenshot();
|
class Screenshot *CurrentScreenshot();
|
||||||
|
|
||||||
// request fullscreen
|
// request fullscreen
|
||||||
|
bool IsFullscreen ();
|
||||||
void ToggleFullscreen();
|
void ToggleFullscreen();
|
||||||
// get width of rendering area
|
// get width of rendering area
|
||||||
float Width();
|
float Width();
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ void UserInterface::handleKeyboard()
|
|||||||
|
|
||||||
// Application "CTRL +"" Shortcuts
|
// Application "CTRL +"" Shortcuts
|
||||||
if ( io.KeyCtrl ) {
|
if ( io.KeyCtrl ) {
|
||||||
|
keyboard_modifier_active = true;
|
||||||
|
|
||||||
if (ImGui::IsKeyPressed( GLFW_KEY_Q )) {
|
if (ImGui::IsKeyPressed( GLFW_KEY_Q )) {
|
||||||
// Quit
|
// Quit
|
||||||
@@ -240,9 +241,13 @@ void UserInterface::handleKeyboard()
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Normal keys
|
keyboard_modifier_active = false;
|
||||||
|
|
||||||
|
// Action keys
|
||||||
if (ImGui::IsKeyPressed( GLFW_KEY_BACKSPACE ))
|
if (ImGui::IsKeyPressed( GLFW_KEY_BACKSPACE ))
|
||||||
Mixer::manager().deleteCurrentSource();
|
Mixer::manager().deleteCurrentSource();
|
||||||
|
else if (ImGui::IsKeyPressed( GLFW_KEY_GRAVE_ACCENT ))
|
||||||
|
navigator.toggleMenu();
|
||||||
// Application F-Keys
|
// Application F-Keys
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_F1 ))
|
else if (ImGui::IsKeyPressed( GLFW_KEY_F1 ))
|
||||||
Mixer::manager().setCurrentView(View::MIXING);
|
Mixer::manager().setCurrentView(View::MIXING);
|
||||||
@@ -250,10 +255,12 @@ void UserInterface::handleKeyboard()
|
|||||||
Mixer::manager().setCurrentView(View::GEOMETRY);
|
Mixer::manager().setCurrentView(View::GEOMETRY);
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_F12 ))
|
else if (ImGui::IsKeyPressed( GLFW_KEY_F12 ))
|
||||||
Rendering::manager().ToggleFullscreen();
|
Rendering::manager().ToggleFullscreen();
|
||||||
|
else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE )){
|
||||||
|
if (Rendering::manager().IsFullscreen())
|
||||||
|
Rendering::manager().ToggleFullscreen();
|
||||||
|
}
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_PRINT_SCREEN ))
|
else if (ImGui::IsKeyPressed( GLFW_KEY_PRINT_SCREEN ))
|
||||||
toolbox.StartScreenshot();
|
toolbox.StartScreenshot();
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_GRAVE_ACCENT ))
|
|
||||||
navigator.toggleMenu();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public:
|
|||||||
void Render();
|
void Render();
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: class ShaderEditor
|
|
||||||
|
|
||||||
class UserInterface
|
class UserInterface
|
||||||
{
|
{
|
||||||
@@ -67,16 +66,12 @@ class UserInterface
|
|||||||
Navigator navigator;
|
Navigator navigator;
|
||||||
ToolBox toolbox;
|
ToolBox toolbox;
|
||||||
|
|
||||||
|
bool keyboard_modifier_active;
|
||||||
bool show_about;
|
bool show_about;
|
||||||
bool show_imgui_about;
|
bool show_imgui_about;
|
||||||
bool show_gst_about;
|
bool show_gst_about;
|
||||||
bool show_opengl_about;
|
bool show_opengl_about;
|
||||||
|
|
||||||
std::string currentTextEdit;
|
|
||||||
|
|
||||||
void handleKeyboard();
|
|
||||||
void handleMouse();
|
|
||||||
void showMenuFile();
|
|
||||||
|
|
||||||
// typedef enum {
|
// typedef enum {
|
||||||
// FILE_DIALOG_INACTIVE = 0,
|
// FILE_DIALOG_INACTIVE = 0,
|
||||||
@@ -109,14 +104,23 @@ public:
|
|||||||
void Render();
|
void Render();
|
||||||
// Post-loop termination
|
// Post-loop termination
|
||||||
void Terminate();
|
void Terminate();
|
||||||
//
|
|
||||||
|
// status querries
|
||||||
|
inline bool keyboardModifier() { return keyboard_modifier_active; }
|
||||||
|
|
||||||
|
|
||||||
|
// TODO implement the shader editor
|
||||||
|
std::string currentTextEdit;
|
||||||
void fillShaderEditor(std::string text);
|
void fillShaderEditor(std::string text);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
void showMenuFile();
|
||||||
void RenderPreview();
|
void RenderPreview();
|
||||||
void RenderMediaPlayer();
|
void RenderMediaPlayer();
|
||||||
void RenderShaderEditor();
|
void RenderShaderEditor();
|
||||||
|
void handleKeyboard();
|
||||||
|
void handleMouse();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user