2020-02-25 00:44:40 +01:00
|
|
|
#include "WindowManager.h"
|
2020-03-15 15:58:01 +01:00
|
|
|
#include "Vulkan/VulkanGraphics.h"
|
2020-02-25 00:44:40 +01:00
|
|
|
|
2020-03-05 11:43:38 +01:00
|
|
|
Seele::WindowManager::WindowManager()
|
2020-02-25 00:44:40 +01:00
|
|
|
{
|
2020-03-24 21:05:32 +01:00
|
|
|
graphics = new Vulkan::Graphics();
|
2020-03-15 15:58:01 +01:00
|
|
|
GraphicsInitializer initializer;
|
|
|
|
|
graphics->init(initializer);
|
2020-04-12 15:47:19 +02:00
|
|
|
TextureCreateInfo info;
|
|
|
|
|
info.width = 4096;
|
|
|
|
|
info.height = 4096;
|
|
|
|
|
Gfx::PTexture2D testTexture = graphics->createTexture2D(info);
|
|
|
|
|
BulkResourceData resourceData;
|
|
|
|
|
resourceData.size = 4096;
|
|
|
|
|
resourceData.data = new uint8[4096];
|
|
|
|
|
for (int i = 0; i < 4096; ++i)
|
|
|
|
|
{
|
|
|
|
|
resourceData.data[i] = (uint8)i;
|
|
|
|
|
}
|
|
|
|
|
Gfx::PUniformBuffer testUniform = graphics->createUniformBuffer(resourceData);
|
2020-02-25 00:44:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Seele::WindowManager::~WindowManager()
|
|
|
|
|
{
|
|
|
|
|
}
|
2020-03-05 11:43:38 +01:00
|
|
|
|
2020-04-12 15:47:19 +02:00
|
|
|
void Seele::WindowManager::addWindow(const WindowCreateInfo &createInfo)
|
2020-03-05 11:43:38 +01:00
|
|
|
{
|
2020-04-12 15:47:19 +02:00
|
|
|
Gfx::PWindow window = graphics->createWindow(createInfo);
|
2020-03-05 11:43:38 +01:00
|
|
|
windows.add(window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Seele::WindowManager::beginFrame()
|
|
|
|
|
{
|
|
|
|
|
for (auto window : windows)
|
|
|
|
|
{
|
|
|
|
|
window->beginFrame();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Seele::WindowManager::endFrame()
|
|
|
|
|
{
|
|
|
|
|
for (auto window : windows)
|
|
|
|
|
{
|
|
|
|
|
window->endFrame();
|
|
|
|
|
}
|
|
|
|
|
}
|