Implemented basic containers and ref pointers
This commit is contained in:
@@ -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/)
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
struct GraphicsInitializer
|
||||
{
|
||||
const char* windowLayoutFile;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "Window.h"
|
||||
#include "Graphics.h"
|
||||
#include <iostream>
|
||||
|
||||
Seele::Window::Window(const WindowCreateInfo& createInfo)
|
||||
{
|
||||
}
|
||||
|
||||
Seele::Window::~Window()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user