Add OpenGLCommandList
This commit is contained in:
49
engine/include/XCEngine/RHI/OpenGL/OpenGLCommandList.h
Normal file
49
engine/include/XCEngine/RHI/OpenGL/OpenGLCommandList.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
class OpenGLBuffer;
|
||||
class OpenGLVertexArray;
|
||||
class OpenGLShader;
|
||||
class OpenGLTexture;
|
||||
|
||||
enum class PrimitiveType {
|
||||
Points,
|
||||
Lines,
|
||||
LineStrip,
|
||||
Triangles,
|
||||
TriangleStrip,
|
||||
TriangleFan
|
||||
};
|
||||
|
||||
class OpenGLCommandList {
|
||||
public:
|
||||
OpenGLCommandList();
|
||||
~OpenGLCommandList();
|
||||
|
||||
void Clear(float r, float g, float b, float a, unsigned int buffers);
|
||||
|
||||
void SetPipelineState(void* pipelineState);
|
||||
void SetVertexBuffer(unsigned int buffer, size_t offset, size_t stride);
|
||||
void SetIndexBuffer(unsigned int buffer, unsigned int type);
|
||||
|
||||
void Draw(PrimitiveType type, unsigned int vertexCount, unsigned int startVertex);
|
||||
void DrawIndexed(PrimitiveType type, unsigned int indexCount, unsigned int startIndex, int baseVertex);
|
||||
|
||||
void BindVertexArray(unsigned int vao);
|
||||
void UseShader(unsigned int program);
|
||||
|
||||
void SetViewport(int x, int y, int width, int height);
|
||||
|
||||
private:
|
||||
unsigned int m_primitiveType;
|
||||
unsigned int m_currentVAO;
|
||||
unsigned int m_currentProgram;
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user