Start work on vulkan renderer; misc engine changes

This commit is contained in:
Bailey Harrison 2022-09-11 19:32:19 +01:00
parent 5cb810b4b0
commit 7ae447b392
4 changed files with 9 additions and 16 deletions

View File

@ -6,7 +6,10 @@
namespace gfx {
struct GFX_API Device {
// Do not use a pointer to this class, always cast to the proper implementation to avoid V-Table overhead
struct GFX_API IDevice {
virtual void setViewport(uint32_t top_left_x, uint32_t top_left_y, uint32_t width, uint32_t height) = 0;
@ -17,7 +20,7 @@ namespace gfx {
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);
virtual void drawElements(Primitive primitive, IndexBufferFormat format, uint32_t count, uint32_t offset) = 0;
virtual void drawArrays() = 0;
};

View File

@ -14,8 +14,7 @@ namespace components {
CustomComponent(Object* parent);
virtual ~CustomComponent() = 0;
virtual void onInit();
virtual void onUpdate(glm::mat4 t);
virtual void onUpdate(glm::mat4 t) {}
};

View File

@ -77,7 +77,7 @@ static glm::vec2 getViewportSize()
void Camera::usePerspective(float fovDeg)
{
constexpr float NEAR = 0.1f;
constexpr float FAR = 1000.0f;
constexpr float FAR = 100000.0f;
m_mode = Modes::PERSPECTIVE;
m_fovDeg = fovDeg;

View File

@ -4,6 +4,7 @@ namespace components {
CustomComponent::CustomComponent(Object* parent) : Component(parent, TypeEnum::CUSTOM)
{
}
CustomComponent::~CustomComponent()
@ -11,14 +12,4 @@ namespace components {
}
void CustomComponent::onInit()
{
}
void CustomComponent::onUpdate(glm::mat4 t)
{
}
}