-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuScreen.cpp
More file actions
90 lines (77 loc) · 2.52 KB
/
MenuScreen.cpp
File metadata and controls
90 lines (77 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include "MenuScreen.h"
#include "imgui.h"
#include "imgui_impl_dx11.h"
#include "imgui_impl_win32.h"
#include <iostream>
#include "GameObjectManager.h"
#include "GraphicsEngine.h"
#include "VertexShader.h"
#include "ShaderLibrary.h"
MenuScreen::MenuScreen() : AUIScreen("MenuScreen")
{
}
MenuScreen::~MenuScreen()
{
}
void MenuScreen::drawUI()
{
if (ImGui::BeginMainMenuBar()) {
if (ImGui::BeginMenu("File")) {
if (ImGui::MenuItem("Open..", "Ctrl+O")) { /* Do stuff */ }
if (ImGui::MenuItem("Save", "Ctrl+S")) { /* Do stuff */ }
if (ImGui::MenuItem("Save As...", "Ctrl+Shift+S")) { /* Do stuff */ }
if (ImGui::MenuItem("Exit Editor", "Ctrl+W")) {/*Do something */ }
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Game Object")) {
if (ImGui::MenuItem("Create Sphere")) { this->OnCreateSphereClicked(); }
if (ImGui::MenuItem("Create Cube")) { this->OnCreateCubeClicked(); }
if (ImGui::MenuItem("Create Textured Cube")) { this->OnCreateTexturedCubeClicked(); }
if (ImGui::MenuItem("Create Placeholder Physics Cube")) { this->OnPhysicsCubeClicked(); }
if (ImGui::MenuItem("Create Plane")) { this->OnCreatePlaneClicked(); }
if (ImGui::MenuItem("Create Placeholder Physics Plane")) { this->OnPhysicsPlaneClicked(); }
if (ImGui::BeginMenu("Light")) {
if (ImGui::MenuItem("Point Light")) { /* Do stuff */ }
ImGui::EndMenu();
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Components")) {
if (ImGui::MenuItem("Rigid Body")) { this->OnRigidBodyComponentClicked(); }
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
}
}
void MenuScreen::OnCreateCubeClicked()
{
//initialize vertex for object
GameObjectManager::getInstance()->createObject(GameObjectManager::PrimitiveType::CUBE);
}
void MenuScreen::OnCreateTexturedCubeClicked()
{
GameObjectManager::getInstance()->createObject(GameObjectManager::PrimitiveType::TEXTURED_CUBE);
}
void MenuScreen::OnCreateSphereClicked()
{
std::cout << "Creating sphere placeholder. \n";
}
void MenuScreen::OnCreatePlaneClicked()
{
//initialize vertex for object
GameObjectManager::getInstance()->createObject(GameObjectManager::PrimitiveType::PLANE);
}
void MenuScreen::OnRigidBodyComponentClicked()
{
std::cout << "Creating rigid body placeholder. \n";
}
void MenuScreen::OnPhysicsCubeClicked()
{
for (int i = 0; i < 20; i++) {
GameObjectManager::getInstance()->createObject(GameObjectManager::PrimitiveType::PHYSICS_CUBE);
}
}
void MenuScreen::OnPhysicsPlaneClicked()
{
GameObjectManager::getInstance()->createObject(GameObjectManager::PrimitiveType::PHYSICS_PLANE);
}