hyporo-cpp/source/hyporo/gpu/opengl/device.hpp

66 lines
1.8 KiB
C++
Raw Normal View History

2022-10-03 18:51:34 +05:00
#pragma once
#include "../device.hpp"
namespace hpr::gpu::opengl
{
class Device : public gpu::Device
{
protected:
bool p_isInitialized;
public:
// Constructors
Device();
2022-10-27 22:27:50 +05:00
~Device() override;
2022-10-03 18:51:34 +05:00
2022-10-05 21:10:51 +05:00
// Member functions
// Setup
bool initialize() override;
bool destroy() override;
// State
void faceCulling(bool enableFaceCulling, CullMode faceCullingMode = CullMode::None) override;
// Buffers
void createVertexBuffer(Buffer **buffer, int size, char* data) override;
void createIndexBuffer(Buffer **buffer, int size, char* data) override;
void useVertexBuffer(Buffer* buffer, int stride, int offset) override;
void useIndexBuffer(Buffer* buffer, int offset) override;
void destroyBuffer(Buffer*& buffer) override;
// Shaders
void createVertexShader(Shader** shader, const std::string& filename, const std::string& label) override;
void createFragmentShader(Shader** shader, const std::string& filename, const std::string& label) override;
void createGeometryShader(Shader** shader, const std::string& filename, const std::string& label) override;
void destroyShader(Shader*& shader) override;
// Shader programs
virtual void createShaderProgram(ShaderProgram** program);
virtual void attachShader(ShaderProgram* program, Shader* shader);
virtual void linkProgram(ShaderProgram* program);
virtual void useShaderProgram(ShaderProgram* program);
virtual void destroyShaderProgram(ShaderProgram*& program, bool withShaders = false);
// Textures
virtual void createTexture(Texture** texture, const std::string& filename);
virtual void useTexture(Texture* texture, int slot);
virtual void destroyTexture(Texture*& texture);
2022-10-03 18:51:34 +05:00
};
}