Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
GraphicsAPI.h
Go to the documentation of this file.
1#pragma once
2#include <memory>
3#include <string>
4#include <vector>
5#include <GL/glew.h>
6
7namespace eng
8{
9 class ShaderProgram;
10 class Material;
11 class Mesh;
12
13 enum class BlendMode
14 {
16 Alpha,
19 };
20
22 {
23 public:
24 bool Init();
25 std::shared_ptr<ShaderProgram> CreateShaderProgram(const std::string& vertexSource,
26 const std::string& fragmentSource);
27 const std::shared_ptr<ShaderProgram>& GetDefaultShaderProgram();
28 const std::shared_ptr<ShaderProgram>& GetDefault2DShaderProgram();
29 GLuint CreateVertexBuffer(const std::vector<float>& vertices);
30 GLuint CreateIndexBuffer(const std::vector<uint32_t>& indices);
31
32 void SetClearColor(float r, float g, float b, float a);
33 void ClearBuffers();
34 void SetDepthTestEnabled(bool enabled);
35 void SetBlendMode(BlendMode mode);
36
37 void BindShaderProgram(ShaderProgram* shaderProgram);
39 void BindMesh(Mesh* mesh);
40 void UnbindMesh(Mesh* mesh);
41 void DrawMesh(Mesh* mesh);
42
43 private:
44 std::shared_ptr<ShaderProgram> m_defaultShaderProgram;
45 std::shared_ptr<ShaderProgram> m_default2DShaderProgram;
46 };
47}
unsigned int GLuint
Definition GLForward.h:11
std::shared_ptr< Material > material
std::shared_ptr< Mesh > mesh
void DrawMesh(Mesh *mesh)
const std::shared_ptr< ShaderProgram > & GetDefaultShaderProgram()
void UnbindMesh(Mesh *mesh)
void BindMesh(Mesh *mesh)
void SetDepthTestEnabled(bool enabled)
GLuint CreateIndexBuffer(const std::vector< uint32_t > &indices)
GLuint CreateVertexBuffer(const std::vector< float > &vertices)
std::shared_ptr< ShaderProgram > CreateShaderProgram(const std::string &vertexSource, const std::string &fragmentSource)
void BindMaterial(Material *material)
void SetClearColor(float r, float g, float b, float a)
void SetBlendMode(BlendMode mode)
void BindShaderProgram(ShaderProgram *shaderProgram)
const std::shared_ptr< ShaderProgram > & GetDefault2DShaderProgram()
BlendMode
Definition GraphicsAPI.h:14