File tree Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 9
9
#include < windows.h>
10
10
#endif
11
11
12
+ #include < imgui.h>
13
+
12
14
#include " frame/common/application.h"
13
15
#include " frame/file/file_system.h"
14
16
#include " frame/file/image_stb.h"
15
17
#include " frame/gui/draw_gui_factory.h"
16
- #include " frame/gui/window_resolution.h"
17
18
#include " frame/gui/window_logger.h"
19
+ #include " frame/gui/window_resolution.h"
18
20
#include " frame/window_factory.h"
19
21
#include " modal_info.h"
20
22
46
48
" Resolution" , size, win->GetDesktopSize (), win->GetPixelPerInch ());
47
49
ptr_window_resolution = gui_resolution.get ();
48
50
gui_window->AddWindow (std::move (gui_resolution));
49
- gui_window->AddWindow (
50
- std::make_unique<frame::gui::WindowLogger>( " Logger " ));
51
+ gui_window->AddWindow (std::make_unique<frame::gui::WindowLogger>( " Logger " ));
52
+ // Set the main window in full.
51
53
// gui_window->SetVisible(false);
54
+ ImGuiStyle& style = ImGui::GetStyle ();
55
+ style.Colors [ImGuiCol_PopupBg] = ImVec4 (
56
+ 0 .1f , 0 .5f , 0 .1f , 0 .9f ); // Dark background with some transparency
52
57
gui_window->AddModalWindow (
53
58
std::make_unique<ModalInfo>(" Info" , " This is a test modal window." ));
54
59
win->GetDevice ().AddPlugin (std::move (gui_window));
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ class Application
22
22
* @param window: The unique pointer to the window (should have been
23
23
* created prior).
24
24
*/
25
- Application (std::unique_ptr<frame::WindowInterface>&& window);
25
+ Application (std::unique_ptr<frame::WindowInterface> window);
26
+ /* *
27
+ * @brief Get the Window object.
28
+ * @return The window.
29
+ */
30
+ frame::WindowInterface& GetWindow ();
26
31
/* *
27
32
* @brief Startup this will initialized the inner level of the window
28
33
* according to a path.
@@ -34,7 +39,7 @@ class Application
34
39
* @brief Same as previously but this use a level.
35
40
* @param level: A unique pointer to a level.
36
41
*/
37
- void Startup (std::unique_ptr<frame::LevelInterface>&& level);
42
+ void Startup (std::unique_ptr<frame::LevelInterface> level);
38
43
/* *
39
44
* @brief A helper function that call the inner resize of the window.
40
45
* @param size: The new size of the window.
Original file line number Diff line number Diff line change 5
5
namespace frame ::common
6
6
{
7
7
8
- Application::Application (std::unique_ptr<frame::WindowInterface>&& window)
8
+ Application::Application (std::unique_ptr<frame::WindowInterface> window)
9
9
: window_(std::move(window))
10
10
{
11
11
assert (window_);
12
12
}
13
13
14
+ frame::WindowInterface& Application::GetWindow ()
15
+ {
16
+ assert (window_);
17
+ return *window_;
18
+ }
19
+
14
20
void Application::Startup (std::filesystem::path path)
15
21
{
16
22
assert (window_);
@@ -25,7 +31,7 @@ void Application::Startup(std::filesystem::path path)
25
31
device.AddPlugin (std::move (plugin));
26
32
}
27
33
28
- void Application::Startup (std::unique_ptr<frame::LevelInterface>&& level)
34
+ void Application::Startup (std::unique_ptr<frame::LevelInterface> level)
29
35
{
30
36
assert (window_);
31
37
auto & device = window_->GetDevice ();
You can’t perform that action at this time.
0 commit comments