Initial commit
This commit is contained in:
BIN
DemoProject/Resources/test.png
Normal file
BIN
DemoProject/Resources/test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 608 B |
3
DemoProject/include/globalVars.hpp
Normal file
3
DemoProject/include/globalVars.hpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define PROJECT_NAME "DemoProject"
|
||||
86
DemoProject/src/main.cpp
Normal file
86
DemoProject/src/main.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
#include <iostream>
|
||||
#include "GL/gl3w.h"
|
||||
#include "globalVars.hpp"
|
||||
#include "WindowGlfw.hpp"
|
||||
#include "OpenGLRenderingBackend.hpp"
|
||||
#include "imgui/imgui.h"
|
||||
#include "shader/defaultShaderHandler.cpp"
|
||||
#include "DefaultRendererOpenGL.hpp"
|
||||
#include "BehaviourScripts/RectBase.hpp"
|
||||
#include "BehaviourScripts/Renderable.hpp"
|
||||
#include "BehaviourScripts/Camera.hpp"
|
||||
#include "elements/Sprite.hpp"
|
||||
#include "elements/Texture.hpp"
|
||||
#include "elements/Layer.hpp"
|
||||
#include "elements/Scene.hpp"
|
||||
#include "EditorSubsystem.hpp"
|
||||
|
||||
using namespace TSE;
|
||||
using namespace TSE::GLFW;
|
||||
using namespace TSE::EDITOR;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
IWindow* wnd = new WindowGlfw("DemoProject", 600, 400, new OpenGLRenderingBackend(Color::aqua, false, 4, true));
|
||||
EditorSubsystem editor;
|
||||
LoadBasicShaders(600, 400);
|
||||
|
||||
DefaultRendererOpenGL rnd = DefaultRendererOpenGL(*BasicShader::Instance());
|
||||
|
||||
#pragma region obj1
|
||||
|
||||
Transformable* obj1 = new Transformable("testObj");
|
||||
|
||||
RectBase rb = RectBase();
|
||||
obj1->AddBehaviourScript(&rb);
|
||||
Material mat = Material("testMat", BasicShader::Instance());
|
||||
mat.SetValue<Color>("mainColor", Color::black);
|
||||
Renderable r = Renderable(&mat);
|
||||
obj1->AddBehaviourScript(&r);
|
||||
obj1->position = Vector3(0,0,0);
|
||||
obj1->scale = Vector3(8,1,1);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
Layer game("game");
|
||||
|
||||
game.AddTransformable(obj1);
|
||||
|
||||
Scene scene;
|
||||
scene.AddLayer(&game);
|
||||
scene.AddLayer(&editor.editorLayer);
|
||||
|
||||
//((Camera*)(editor.editorLayer.GetAllObjects()[0]->GetBehaviourScriptAt(0)))->SetRenderTarget(wnd);
|
||||
|
||||
editor.hv.SetScene(&scene);
|
||||
|
||||
while(!wnd->ShouldClose())
|
||||
{
|
||||
wnd->Clear();
|
||||
rnd.Begin();
|
||||
|
||||
scene.Render(rnd, *wnd);
|
||||
|
||||
rnd.End();
|
||||
rnd.Flush();
|
||||
|
||||
scene.DoneRender();
|
||||
|
||||
//editor.sv.Render();
|
||||
editor.controller.Update();
|
||||
//ImGui::ShowDemoWindow();
|
||||
wnd->Update();
|
||||
scene.Update();
|
||||
}
|
||||
UnLoadBasicShaders();
|
||||
Transformable::DeleteAll();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
extern "C" {
|
||||
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; // NVIDIA
|
||||
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; // AMD
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user