Graphics pipeline creation is working
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
#include <Core/Logging/LogTypes.h>
|
||||
#include <Graphics/Graphics.h>
|
||||
#include <Graphics/GraphicsConfig.h>
|
||||
#include <Graphics/GraphicsPipeline.h>
|
||||
#include <Graphics/RenderPass.h>
|
||||
|
||||
#include <Core/Common/String.h>
|
||||
#include <Core/Memory/Utils.h>
|
||||
#include <cstdlib>
|
||||
#include <Graphics/GraphicsPipeline.h>
|
||||
|
||||
// TODO : Replace with message box from framework + call main and not winmain + subsystem
|
||||
// TODO : Think how to do the draw pipeline.
|
||||
@@ -49,6 +49,9 @@ void JulietApplication::Init()
|
||||
Log(LogLevel::Message, LogCategory::Tool, "%s", CStr(GetBasePath()));
|
||||
|
||||
GraphicsConfig config;
|
||||
#if JULIET_DEBUG
|
||||
config.EnableDebug = true;
|
||||
#endif
|
||||
GraphicsDevice = CreateGraphicsDevice(config);
|
||||
|
||||
MainWindow = CreatePlatformWindow("Juliet Editor", 1280, 720);
|
||||
@@ -81,13 +84,18 @@ void JulietApplication::Init()
|
||||
pipelineCI.VertexShader = vertexShader;
|
||||
pipelineCI.FragmentShader = fragmentShader;
|
||||
pipelineCI.PrimitiveType = PrimitiveType::TriangleList;
|
||||
pipelineCI.TargetInfo = {
|
||||
.ColorTargetDescriptions = &colorTargetDescription,
|
||||
.NumColorTargets = 1,
|
||||
};
|
||||
pipelineCI.RasterizerState.FillMode = FillMode::Solid;
|
||||
pipelineCI.TargetInfo = { .ColorTargetDescriptions = &colorTargetDescription,
|
||||
.NumColorTargets = 1,
|
||||
.DepthStencilFormat = {},
|
||||
.HasDepthStencilTarget = false };
|
||||
pipelineCI.RasterizerState.FillMode = FillMode::Solid;
|
||||
|
||||
GraphicsPipeline* mainPipeline = CreateGraphicsPipeline(GraphicsDevice, pipelineCI);
|
||||
GraphicsPipeline = CreateGraphicsPipeline(GraphicsDevice, pipelineCI);
|
||||
if (GraphicsPipeline == nullptr)
|
||||
{
|
||||
LogError(LogCategory::Game, "Failed to create graphics pipeline!");
|
||||
Running = false;
|
||||
}
|
||||
|
||||
if (vertexShader)
|
||||
{
|
||||
@@ -97,6 +105,11 @@ void JulietApplication::Init()
|
||||
{
|
||||
DestroyShader(GraphicsDevice, fragmentShader);
|
||||
}
|
||||
|
||||
if (Running == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
GameCode.Functions = reinterpret_cast<void**>(&Game);
|
||||
@@ -114,8 +127,16 @@ void JulietApplication::Shutdown()
|
||||
{
|
||||
Log(LogLevel::Message, LogCategory::Tool, "Shutting down Juliet Application...");
|
||||
|
||||
Game.Shutdown();
|
||||
ShutdownHotReloadCode(GameCode);
|
||||
if (GameCode.IsValid)
|
||||
{
|
||||
Game.Shutdown();
|
||||
ShutdownHotReloadCode(GameCode);
|
||||
}
|
||||
|
||||
if (GraphicsPipeline)
|
||||
{
|
||||
DestroyGraphicsPipeline(GraphicsDevice, GraphicsPipeline);
|
||||
}
|
||||
|
||||
if (MainWindow && GraphicsDevice)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user