YoggieEngine/BarinkEngine/BarinkEngine.cpp

107 lines
1.4 KiB
C++
Raw Normal View History

#include "BarinkEngine.h"
#include <imgui.h>
extern void Start(int argc, char* argv[]);
extern void Update();
extern void Stop();
using namespace BarinkEngine;
void DrawMyGUI();
BarinkWindow* MainWindow;
int main(int argc, char* argv[]) {
// Startup services
MainWindow = new BarinkWindow(800, 600);
Renderer renderer = Renderer();
InputManager InputSystem = InputManager();
InputSystem.attach(MainWindow);
GUIManager GUISystem = GUIManager(MainWindow);
// First call to setup game
Start(argc, argv);
// Runtime loop
while (!MainWindow->WindowShouldClose()) {
InputSystem.PollEvents();
Update();
renderer.Render();
DrawMyGUI();
GUISystem.Render();
MainWindow->SwapBuffers();
}
// Shutdown game
Stop();
// Shutdown Services
delete MainWindow;
return 0;
}
void WARN(std::string message) {
spdlog::warn(message);
}
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();
}