Added scene renderer

This commit is contained in:
HOEGLER Stefan
2020-03-05 11:43:38 +01:00
parent 4c2535931e
commit 328edf5196
23 changed files with 334 additions and 113 deletions
+38 -8
View File
@@ -1,5 +1,6 @@
#pragma once
#include "MinimalEngine.h"
#include "GraphicsResources.h"
#include "View.h"
namespace Seele {
// A window is divided into 5 sections, using a border layout
@@ -13,23 +14,52 @@ namespace Seele {
// +-------------BOTTOM----------------+
// In every section, there can be any number
// of views, when there are multiple, they stack to tabs
struct Section
class Section
{
public:
Section()
{}
void resizeArea(Rect area)
{
this->area = area;
}
void beginFrame()
{
views[0]->beginFrame();
}
void endFrame()
{
views[0]->endFrame();
}
void addView(PView view)
{
view->applyArea(area);
views.add(view);
}
void clearViews(PView view)
{
views.clear();
}
void removeView(PView view)
{
views.remove(views.find(view));
}
private:
Rect area;
Array<PView> views;
};
DECLARE_REF(Section)
class Graphics;
class Window
{
public:
Window(const WindowCreateInfo& createInfo);
~Window();
void beginFrame();
void endFrame();
private:
void* windowHandle;
Section top;
Section bot;
Section left;
Section right;
Section center;
PSection center;
uint32 width;
uint32 height;
Graphics* graphics;