From 6542b7039b7121c51ed74bfc5985427b79f4c2ae Mon Sep 17 00:00:00 2001 From: bailwillharr Date: Mon, 24 Oct 2022 01:14:08 +0100 Subject: [PATCH] Add null device --- src/gfx_device_null.cpp | 51 +++++++++++++++++++++++++++++-------- src/gfx_device_opengl45.cpp | 1 + src/gfx_device_vulkan.cpp | 1 + 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/gfx_device_null.cpp b/src/gfx_device_null.cpp index 61110a3..6874ecd 100644 --- a/src/gfx_device_null.cpp +++ b/src/gfx_device_null.cpp @@ -1,6 +1,6 @@ -// The implementation of the graphics layer using Vulkan 1.3. -// This uses SDL specific code +// This implementation of the graphics layer does nothing +//#define ENGINE_BUILD_NULLGFX #ifdef ENGINE_BUILD_NULLGFX #include "gfx_device.hpp" @@ -8,12 +8,23 @@ #include "config.h" #include "log.hpp" +#include + +#include +#include +#include +#include +#include +#include + namespace engine { + // structures and enums + // class definitions struct GFXDevice::Impl { - + }; GFXDevice::GFXDevice(const char* appName, const char* appVersion, SDL_Window* window) @@ -26,17 +37,37 @@ namespace engine { TRACE("Destroying GFXDevice..."); } - void GFXDevice::draw() - { - } - - void GFXDevice::createPipeline(const char* vertShaderPath, const char* fragShaderPath) + void GFXDevice::drawBuffer(const gfx::Pipeline* pipeline, const gfx::Buffer* vertexBuffer, uint32_t count) { } - bool GFXDevice::createBuffer(const gfx::BufferDesc& desc, const void* data, gfx::BufferHandle* out) + void GFXDevice::drawIndexed(const gfx::Pipeline* pipeline, const gfx::Buffer* vertexBuffer, const gfx::Buffer* indexBuffer, uint32_t indexCount) { - return true; + } + + void GFXDevice::renderFrame() + { + + } + + gfx::Pipeline* GFXDevice::createPipeline(const char* vertShaderPath, const char* fragShaderPath, const gfx::VertexFormat& vertexFormat) + { + return nullptr; + } + + void GFXDevice::destroyPipeline(const gfx::Pipeline* pipeline) + { + + } + + gfx::Buffer* GFXDevice::createBuffer(gfx::BufferType type, uint64_t size, const void* data) + { + return nullptr; + } + + void GFXDevice::destroyBuffer(const gfx::Buffer* buffer) + { + } void GFXDevice::waitIdle() diff --git a/src/gfx_device_opengl45.cpp b/src/gfx_device_opengl45.cpp index 8648681..dfd89c2 100644 --- a/src/gfx_device_opengl45.cpp +++ b/src/gfx_device_opengl45.cpp @@ -1,6 +1,7 @@ // The implementation of the graphics layer using OpenGL 4.5 // This uses SDL specific code +//#undef ENGINE_BUILD_OPENGL #ifdef ENGINE_BUILD_OPENGL #include "gfx_device.hpp" diff --git a/src/gfx_device_vulkan.cpp b/src/gfx_device_vulkan.cpp index c20fbfe..19c51cb 100644 --- a/src/gfx_device_vulkan.cpp +++ b/src/gfx_device_vulkan.cpp @@ -1,6 +1,7 @@ // The implementation of the graphics layer using Vulkan 1.3. // This uses SDL specific code +//#undef ENGINE_BUILD_VULKAN #ifdef ENGINE_BUILD_VULKAN #include "gfx_device.hpp"