Shader: Added code to load compiled shader
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <Graphics/Graphics.h>
|
||||
#include <Graphics/GraphicsConfig.h>
|
||||
#include <Graphics/RenderPass.h>
|
||||
#include <Windows.h>
|
||||
|
||||
#include <Core/Common/String.h>
|
||||
#include <Core/Memory/Utils.h>
|
||||
@@ -59,6 +58,20 @@ void JulietApplication::Init()
|
||||
{
|
||||
AttachToWindow(GraphicsDevice, MainWindow);
|
||||
|
||||
{
|
||||
// Create graphics pipeline
|
||||
// TODO: Assets management that handles path to assets or something.
|
||||
String shaderPath = WrapString("../../../Assets/compiled/Triangle.vert.dxil");
|
||||
ShaderCreateInfo shaderCI = {};
|
||||
shaderCI.Stage = ShaderStage::Vertex;
|
||||
shaderCI.EntryPoint = WrapString("main");
|
||||
Shader* shader = CreateShader(GraphicsDevice, shaderPath, shaderCI);
|
||||
if (shader)
|
||||
{
|
||||
DestroyShader(GraphicsDevice, shader);
|
||||
}
|
||||
}
|
||||
|
||||
GameCode.Functions = reinterpret_cast<void**>(&Game);
|
||||
GameCode.FunctionCount = ArraySize(GameFunctionTable);
|
||||
GameCode.FunctionNames = GameFunctionTable;
|
||||
@@ -167,12 +180,14 @@ JulietApplication& GetEditorApplication()
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
CreateMutex(0, false, L"Local\\Juliet.App");
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
MessageBox(nullptr, L"An instance of Juliet is already running.", L"Juliet", MB_OK | MB_ICONEXCLAMATION);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// Allow only one instance to be launched.
|
||||
// Need to create Mutex code in the lib because i dont want to include windows.h in this file anymore
|
||||
// CreateMutex(0, false, L"Local\\Juliet.App");
|
||||
// if (GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
// {
|
||||
// MessageBox(nullptr, L"An instance of Juliet is already running.", L"Juliet", MB_OK | MB_ICONEXCLAMATION);
|
||||
// return EXIT_FAILURE;
|
||||
// }
|
||||
|
||||
StartApplication(EditorApplication, JulietInit_Flags::Display);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user