-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
84 lines (77 loc) · 2.47 KB
/
Copy pathProgram.cs
File metadata and controls
84 lines (77 loc) · 2.47 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
using Silk.NET.Input;
using Silk.NET.OpenGL;
using Silk.NET.OpenGL.Extensions.ImGui;
namespace RedCicada;
public class Program{
static Application Game = new Application();
static ImGuiController controller = null;
static string rf ="";
static Entity player = new Entity("Player");
static Entity ground = new Entity();
static string ConsoleLoger ="";
public static void Main(){
Game.appOptions.SetOptions("Red Cicada",new vector2Int(1280,720),"RedCicada.png",60);
Game.Init();
Game.window.Load+=OnLoad;
Game.window.Render+=OnRender;
Game.window.Update+=OnUpdate;
Game.window.FileDrop+=OnDropFile;
Game.Run();
}
static void OnLoad(){
controller = new ImGuiController(OpenGL.gl = Game.window.CreateOpenGL(),Game.window,Game.Input);
ImGuiNET.ImGui.GetIO().ConfigFlags = ImGuiNET.ImGuiConfigFlags.DockingEnable;
for (int i = 0; i < Game.Input.Keyboards.Count; i++)
{
Game.Input.Keyboards[i].KeyDown+=KeyDown;
Game.Input.Keyboards[i].KeyUp+=KeyUp;
}
PlayerMovment move = new PlayerMovment();
player.AddComponent(move);
Game.sceneSystem.LoadedScene.entities.Add(player);
}
static void OnRender(double deltaTime){
controller.Update((float)deltaTime);
//Editor
ImGuiNET.ImGui.Begin("App");
ImGuiNET.ImGui.End();
ConsoleLoger = rf;
ImGuiNET.ImGui.End();
ImGuiNET.ImGui.Begin("Console");
ImGuiNET.ImGui.Text(ConsoleLoger);
ImGuiNET.ImGui.End();
ImGuiNET.ImGui.Begin("Project");
if(ImGuiNET.ImGui.Button("Import")){
AssetManager.Import(rf);
}
ImGuiNET.ImGui.End();
ImGuiNET.ImGui.Begin("Inspector");
ImGuiNET.ImGui.InputFloat3("Camera",ref Game.cameraPosition);
ImGuiNET.ImGui.End();
ImGuiNET.ImGui.Begin("Scene List");
ImGuiNET.ImGui.End();
controller.Render();
}
static void OnUpdate(double deltaTime){
}
static void OnDropFile(string[] path){
for (int i = 0; i < path.Count(); i++)
{
AssetManager.Import(path[i]);
rf+=path[i];
}
}
static void KeyDown(IKeyboard keyboard,Key key,int keyCode){
if(key== Key.Escape){
Game.window.Close();
}
}
static void KeyUp(IKeyboard keyboard,Key key,int keyCode){
if(key== Key.F11){
}
}
void Build(string project){
string command = "";
System.Diagnostics.Process.Start("CMD.exe",project);
}
}