Implemented basic containers and ref pointers

This commit is contained in:
HOEGLER Stefan
2020-02-25 00:45:20 +01:00
parent 4c491a9378
commit a14237d6ce
31 changed files with 1212 additions and 36 deletions
+12
View File
@@ -0,0 +1,12 @@
target_sources(SeeleEngine
PRIVATE
Graphics.h
Graphics.cpp
View.h
WindowManager.h
WindowManager.cpp
Window.h
Window.cpp
GraphicsResources.h)
add_subdirectory(Vulkan/)
+12 -3
View File
@@ -1,11 +1,20 @@
#include "Graphics.h"
#include <iostream>
#include <map>
Graphics::Graphics()
Seele::Graphics::Graphics()
{
Array<uint8> arr;
arr.add('2');
arr.add('4');
std::cout << "Test" << std::endl;
for (auto a : arr)
{
std::cout << "Element: " << a << std::endl;
}
}
Graphics::~Graphics()
Seele::Graphics::~Graphics()
{
}
+28 -6
View File
@@ -1,6 +1,28 @@
class Graphics
{
public:
Graphics();
~Graphics();
};
#pragma once
#include "MinimalEngine.h"
#include "GraphicsResources.h"
namespace Seele {
class Window;
class Graphics
{
public:
static Graphics& getInstance()
{
static Graphics instance;
return instance;
}
void init(GraphicsInitializer initializer);
void beginFrame();
void endFrame();
//Singleton
private:
Graphics();
Graphics(Graphics const&) = delete;
void operator=(Graphics const&) = delete;
~Graphics();
};
}
+9
View File
@@ -0,0 +1,9 @@
#pragma once
namespace Seele
{
struct GraphicsInitializer
{
const char* windowLayoutFile;
};
}
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include "Window.h"
// A view is a part of the window, which can be anything from a viewport to an editor
class View
{
public:
private:
Window::Section* owner;
};
+12
View File
@@ -0,0 +1,12 @@
#include "Window.h"
#include "Graphics.h"
#include <iostream>
Seele::Window::Window(const WindowCreateInfo& createInfo)
{
}
Seele::Window::~Window()
{
}
+39
View File
@@ -0,0 +1,39 @@
#pragma once
#include "MinimalEngine.h"
namespace Seele {
struct WindowCreateInfo
{
int32 width;
int32 height;
const char* title;
};
class Window
{
public:
Window(const WindowCreateInfo& createInfo);
~Window();
private:
// 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
struct Section
{
};
Section top;
Section bot;
Section left;
Section right;
Section center;
uint32 width;
uint32 height;
};
}
+16
View File
@@ -0,0 +1,16 @@
#include "WindowManager.h"
Seele::WindowManager::WindowManager(GraphicsInitializer initializer)
{
//TODO Parse layout file
WindowCreateInfo mainWindowInfo;
mainWindowInfo.title = "SeeleEngine";
mainWindowInfo.width = 1280;
mainWindowInfo.height = 720;
Window* mainWindow = new Window(mainWindowInfo);
windows.add(mainWindow);
}
Seele::WindowManager::~WindowManager()
{
}
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include "GraphicsResources.h"
#include "Window.h"
#include "Containers/Array.h"
namespace Seele
{
class WindowManager
{
public:
WindowManager(GraphicsInitializer initializer);
~WindowManager();
private:
Array<RefPtr<Window>> windows;
};
}