2022-05-28 11:32:17 +00:00
|
|
|
#include "BarinkEngine.h"
|
2022-05-28 16:49:08 +00:00
|
|
|
#include <imgui.h>
|
2022-05-27 20:47:36 +00:00
|
|
|
|
|
|
|
extern void Start(int argc, char* argv[]);
|
2022-05-28 16:49:08 +00:00
|
|
|
extern void Update();
|
|
|
|
extern void Stop();
|
2022-05-27 20:47:36 +00:00
|
|
|
|
|
|
|
using namespace BarinkEngine;
|
2022-05-28 16:49:08 +00:00
|
|
|
void DrawMyGUI();
|
2022-05-27 20:47:36 +00:00
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
BarinkWindow* MainWindow;
|
2022-05-27 20:47:36 +00:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
// Startup services
|
|
|
|
MainWindow = new BarinkWindow(800, 600);
|
2022-05-27 20:47:36 +00:00
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
Renderer renderer = Renderer();
|
|
|
|
InputManager InputSystem = InputManager();
|
|
|
|
|
|
|
|
|
|
|
|
InputSystem.attach(MainWindow);
|
|
|
|
|
|
|
|
GUIManager GUISystem = GUIManager(MainWindow);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// First call to setup game
|
2022-05-27 20:47:36 +00:00
|
|
|
Start(argc, argv);
|
|
|
|
|
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
// Runtime loop
|
|
|
|
while (!MainWindow->WindowShouldClose()) {
|
|
|
|
InputSystem.PollEvents();
|
|
|
|
|
|
|
|
Update();
|
|
|
|
|
|
|
|
|
|
|
|
renderer.Render();
|
2022-05-27 20:47:36 +00:00
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
|
|
|
|
DrawMyGUI();
|
|
|
|
|
|
|
|
GUISystem.Render();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MainWindow->SwapBuffers();
|
2022-05-27 20:47:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
// Shutdown game
|
2022-05-27 20:47:36 +00:00
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
Stop();
|
2022-05-27 20:47:36 +00:00
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
|
|
|
|
// Shutdown Services
|
|
|
|
delete MainWindow;
|
|
|
|
|
2022-05-27 20:47:36 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-28 11:32:17 +00:00
|
|
|
void WARN(std::string message) {
|
|
|
|
spdlog::warn(message);
|
2022-05-28 16:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DrawMyGUI() {
|
|
|
|
ImGui::NewFrame();
|
|
|
|
|
|
|
|
ImGui::Begin("Transform");
|
|
|
|
ImGui::Text("Cube");
|
|
|
|
/*
|
|
|
|
ImGui::InputFloat3("Position:", (float*)nullptr);
|
|
|
|
ImGui::InputFloat3("Rotation:", (float*)nullptr);
|
|
|
|
ImGui::InputFloat3("Scale:", (float*)nullptr);
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
ImGui::Begin("Camera");
|
|
|
|
|
|
|
|
//ImGui::SliderFloat("Zoom:", &NULL, 10, 190);
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Begin("Scripting!!");
|
|
|
|
|
|
|
|
//ImGui::InputTextMultiline("Lua Script", nullptr, 255);
|
|
|
|
//runCode = ImGui::Button("Run");
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::ShowDemoWindow();
|
2022-05-27 20:47:36 +00:00
|
|
|
|
2022-05-28 11:32:17 +00:00
|
|
|
}
|
2022-05-28 16:49:08 +00:00
|
|
|
|
|
|
|
|