Files
Seele/src/Engine/Graphics/Window.h
T

68 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
2020-03-05 11:43:38 +01:00
#include "GraphicsResources.h"
#include "View.h"
namespace Seele {
2020-03-02 19:07:49 +01:00
// A window is divided into 5 sections, using a border layout
// +--------------TOP------------------+
// | |
// L R
// E I
// F CENTER G
// T H
// | T
// +-------------BOTTOM----------------+
// In every section, there can be any number
// of views, when there are multiple, they stack to tabs
2020-03-05 11:43:38 +01:00
class Section
{
2020-03-05 11:43:38 +01:00
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;
};
DEFINE_REF(Section)
2020-03-05 11:43:38 +01:00
class Graphics;
class Window
{
public:
Window(const WindowCreateInfo& createInfo, PGraphics graphics);
~Window();
2020-03-05 11:43:38 +01:00
void beginFrame();
void endFrame();
private:
2020-03-02 19:07:49 +01:00
void* windowHandle;
2020-03-05 11:43:38 +01:00
PSection center;
uint32 width;
uint32 height;
PGraphics graphics;
};
DEFINE_REF(Window)
}