Add null device

This commit is contained in:
Bailey Harrison 2022-10-24 01:14:08 +01:00
parent ce12534ad8
commit 6542b7039b
3 changed files with 43 additions and 10 deletions

View File

@ -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,8 +8,19 @@
#include "config.h"
#include "log.hpp"
#include <SDL2/SDL.h>
#include <assert.h>
#include <unordered_set>
#include <array>
#include <fstream>
#include <filesystem>
#include <optional>
namespace engine {
// structures and enums
// class definitions
struct GFXDevice::Impl {
@ -26,17 +37,37 @@ namespace engine {
TRACE("Destroying GFXDevice...");
}
void GFXDevice::draw()
void GFXDevice::drawBuffer(const gfx::Pipeline* pipeline, const gfx::Buffer* vertexBuffer, uint32_t count)
{
}
void GFXDevice::createPipeline(const char* vertShaderPath, const char* fragShaderPath)
void GFXDevice::drawIndexed(const gfx::Pipeline* pipeline, const gfx::Buffer* vertexBuffer, const gfx::Buffer* indexBuffer, uint32_t indexCount)
{
}
bool GFXDevice::createBuffer(const gfx::BufferDesc& desc, const void* data, gfx::BufferHandle* out)
void GFXDevice::renderFrame()
{
return true;
}
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()

View File

@ -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"

View File

@ -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"