main.cpp 1.31 KB
Newer Older
1
#include <core/state.h>
2
#include <core/res/res.h>
3
4
5
#include <core/objects/skybox.h>

#include <core/rendering/batch_renderer.h>
6
7
#include <components/PlayerController.h>
#include <core/objects/camera.h>
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "imgui/imgui.h"

#include "imgui/imgui_glfw.h"

using namespace glare;

void gui();

int main(int argc, char* argv[])
{
	// Initialize engine from settings xml
	core::state::initialize(files::asset("/preferences/default.xml"));
	
	// Create a skybox
	core::state::skybox->reset(core::Skybox::collectFilesFrom(files::asset("textures/ryfjallet/")));

	core::state::camera->owner()->makeComponent<component::PlayerController>();

	// Render the scene with the pathtracer
Johannes Braun's avatar
Johannes Braun committed
27
	core::state::mainLoop([]() { 
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
		gui();
	});
}

void gui()
{
	static int current_tab = 0;
	ImGui::BeginTabbed("Settings", std::array<std::string, 2>{ "First Tab", "Second Tab" }, current_tab, ImVec4(0.4f, 0.3f, 0.1f, 1.f));

	/*ImGui::BeginSelectableTree("My tree");
	if(ImGui::SelectableTreeNode("My tree", "Node 0"))
	{
		if (ImGui::SelectableTreeNode("My tree", "Node 342"))
		{
			if (ImGui::SelectableTreeNode("My tree", "Node 555"))
			{

				ImGui::TreePop();
			}

			ImGui::TreePop();
		}
		if (ImGui::SelectableTreeNode("My tree", "Node 23"))
		{

			ImGui::TreePop();
		}
		ImGui::TreePop();
	}
	ImGui::EndSelectableTree();*/

	ImGui::EndTabbed();
}