diff --git a/src/Engine/Graphics/GraphicsResources.h b/src/Engine/Graphics/GraphicsResources.h index 5ca4334..dbccb08 100644 --- a/src/Engine/Graphics/GraphicsResources.h +++ b/src/Engine/Graphics/GraphicsResources.h @@ -13,5 +13,113 @@ namespace Seele const char* title; bool bFullscreen; }; + + class RenderCommandBase + { + }; + DECLARE_REF(RenderCommandBase); + + class DescriptorBinding + { + public: + DescriptorBinding() + : binding(0) + , descriptorType(VK_DESCRIPTOR_TYPE_MAX_ENUM) + , descriptorCount(-1) + , shaderStages(VK_SHADER_STAGE_ALL) + {} + DescriptorBinding(const DescriptorBinding& other) + : binding(other.binding) + , descriptorType(other.descriptorType) + , descriptorCount(other.descriptorCount) + , shaderStages(other.shaderStages) + {} + void operator=(const DescriptorBinding& other) + { + binding = other.binding; + descriptorType = other.descriptorType; + descriptorCount = other.descriptorCount; + shaderStages = other.shaderStages; + } + uint32_t binding; + //TODO make generic enum + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags shaderStages; + }; + DECLARE_REF(DescriptorBinding); + + class DescriptorAllocator + { + + }; + DECLARE_REF(DescriptorAllocator); + + class DescriptorSet + { + + }; + DECLARE_REF(DescriptorSet); + + class DescriptorLayout + { + + }; + DECLARE_REF(DescriptorLayout); + class PipelineLayout + { + + }; + DECLARE_REF(PipelineLayout); + class VertexDeclaration + { + + }; + DECLARE_REF(VertexDeclaration); + class GraphicsPipeline + { + + }; + DECLARE_REF(GraphicsPipeline); + class UniformBuffer + { + + }; + DECLARE_REF(UniformBuffer); + class Viewport + { + + }; + DECLARE_REF(Viewport); + class VertexBuffer + { + + }; + DECLARE_REF(VertexBuffer); + class IndexBuffer + { + + }; + DECLARE_REF(IndexBuffer); + class StructuredBuffer + { + + }; + DECLARE_REF(StructuredBuffer); + class Texture + { + + }; + DECLARE_REF(Texture); + class Texture2D : public Texture + { + + }; + DECLARE_REF(Texture2D); + class RenderPass + { + + }; + DECLARE_REF(RenderPass); } \ No newline at end of file diff --git a/src/Engine/Graphics/SceneRenderPath.cpp b/src/Engine/Graphics/SceneRenderPath.cpp index e69de29..7821405 100644 --- a/src/Engine/Graphics/SceneRenderPath.cpp +++ b/src/Engine/Graphics/SceneRenderPath.cpp @@ -0,0 +1,30 @@ +#include "SceneRenderPath.h" + +Seele::SceneRenderPath::SceneRenderPath(Graphics* graphics) + : RenderPath(graphics) +{ +} + +Seele::SceneRenderPath::~SceneRenderPath() +{ +} + +void Seele::SceneRenderPath::applyArea(Rect area) +{ +} + +void Seele::SceneRenderPath::init() +{ +} + +void Seele::SceneRenderPath::beginFrame() +{ +} + +void Seele::SceneRenderPath::render() +{ +} + +void Seele::SceneRenderPath::endFrame() +{ +} diff --git a/src/Engine/Graphics/SceneRenderPath.h b/src/Engine/Graphics/SceneRenderPath.h index 2bbc9d3..75ccc42 100644 --- a/src/Engine/Graphics/SceneRenderPath.h +++ b/src/Engine/Graphics/SceneRenderPath.h @@ -6,7 +6,7 @@ namespace Seele class SceneRenderPath : public RenderPath { public: - SceneRenderPath(); + SceneRenderPath(Graphics* graphics); virtual ~SceneRenderPath(); virtual void applyArea(Rect area) override; virtual void init() override; diff --git a/src/Engine/Graphics/SceneView.cpp b/src/Engine/Graphics/SceneView.cpp index 20fd190..1ea9f6b 100644 --- a/src/Engine/Graphics/SceneView.cpp +++ b/src/Engine/Graphics/SceneView.cpp @@ -1,15 +1,12 @@ #include "SceneView.h" #include "SceneRenderPath.h" -Seele::SceneView::SceneView() +Seele::SceneView::SceneView(Graphics* graphics) + : View(graphics) { + renderer = new SceneRenderPath(graphics); } Seele::SceneView::~SceneView() { } - -void Seele::SceneView::initRenderer() -{ - renderer = new SceneRenderPath(); -} diff --git a/src/Engine/Graphics/SceneView.h b/src/Engine/Graphics/SceneView.h index e1e9a33..7ffe538 100644 --- a/src/Engine/Graphics/SceneView.h +++ b/src/Engine/Graphics/SceneView.h @@ -5,8 +5,7 @@ namespace Seele class SceneView : public View { public: - SceneView(); + SceneView(Graphics* graphics); ~SceneView(); - virtual void initRenderer() override; }; } \ No newline at end of file diff --git a/src/Engine/Graphics/View.cpp b/src/Engine/Graphics/View.cpp index 9dfcdee..24c4e9f 100644 --- a/src/Engine/Graphics/View.cpp +++ b/src/Engine/Graphics/View.cpp @@ -1,6 +1,7 @@ #include "View.h" -Seele::View::View() +Seele::View::View(Graphics* graphics) + : graphics(graphics) { } diff --git a/src/Engine/Graphics/View.h b/src/Engine/Graphics/View.h index 5eaacf7..747894f 100644 --- a/src/Engine/Graphics/View.h +++ b/src/Engine/Graphics/View.h @@ -2,17 +2,18 @@ #include "RenderPath.h" namespace Seele { + class Graphics; // A view is a part of the window, which can be anything from a viewport to an editor class View { public: - View(); + View(Graphics* graphics); virtual ~View(); - virtual void initRenderer() = 0; void beginFrame(); void endFrame(); void applyArea(Rect area); protected: + Graphics* graphics; PRenderPath renderer; }; diff --git a/src/Engine/Graphics/Window.cpp b/src/Engine/Graphics/Window.cpp index d8184d0..c04000e 100644 --- a/src/Engine/Graphics/Window.cpp +++ b/src/Engine/Graphics/Window.cpp @@ -6,10 +6,10 @@ Seele::Window::Window(const WindowCreateInfo& createInfo) : width(createInfo.width) , height(createInfo.height) { + graphics = new VulkanGraphics(); center = new Section(); center->resizeArea(Rect(1, 1, 0, 0)); - center->addView(new SceneView()); - graphics = new VulkanGraphics(); + center->addView(new SceneView(graphics)); windowHandle = graphics->createWindow(createInfo); }