engine/graphics/include/gfx_device.hpp

31 lines
889 B
C++
Raw Normal View History

2022-09-07 09:02:01 +00:00
#pragma once
#include "gfx_api.h"
#include "gfx.hpp"
namespace gfx {
// Do not use a pointer to this class, always cast to the proper implementation to avoid V-Table overhead
struct GFX_API IDevice {
2022-09-07 09:02:01 +00:00
virtual void setViewport(uint32_t top_left_x, uint32_t top_left_y, uint32_t width, uint32_t height) = 0;
virtual bool createShader(ShaderType type, const char* source, Shader& out) = 0;
virtual bool createProgram(int count, const Shader* shaders, Program& out) = 0;
virtual bool createBuffer(BufferType type, const void* data, Buffer& out) = 0;
virtual void bufferData(const void* data, Buffer buffer) = 0;
virtual void bufferSubData(uint32_t offset, uint32_t size, const void* data, Buffer buffer) = 0;
virtual void drawElements(Primitive primitive, IndexBufferFormat format, uint32_t count, uint32_t offset) = 0;
2022-09-07 09:02:01 +00:00
virtual void drawArrays() = 0;
};
}