13#ifdef GALAXY_WIN_PLATFORM
21 : m_quads {
Settings::max_quads(), 4,
galaxy::graphics::gen_default_indices()}
23 , m_pipeline {nullptr}
48 glBindFramebuffer(GL_FRAMEBUFFER, pass.
target);
54 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
61 for (
const auto& feature : pipeline.
enabled)
66 for (
const auto& feature : pipeline.
disabled)
76 glUseProgram(pipeline.
shader);
77 glActiveTexture(GL_TEXTURE0);
93 for (
auto& vert : cmd.vertices)
125 glDrawElements(
static_cast<unsigned int>(cmd.type), cmd.vao->count(), GL_UNSIGNED_INT, cmd.vao->offset());
130#ifdef GALAXY_WIN_PLATFORM
#define GALAXY_DISABLE_WARNING_POP
#define GALAXY_DISABLE_WARNING(x)
#define GALAXY_DISABLE_WARNING_PUSH
Macro for windows platform detection.
Data & get_data() noexcept
Get camera view and proj.
ShaderBuffer m_camera_storage
std::vector< RenderCmd > m_commands
RenderCommands.
std::vector< RenderData > m_uniform_data
void end_pass(Camera &camera)
ShaderBuffer m_uniform_storage
Shader uniform data.
VertexBatch m_quads
All quads get batched.
void push_cmd(RenderCmd &&cmd)
Try not to push too many non-quads, only quads are batched.
void bind_pipeline(RenderPipeline &pipeline)
void begin_pass(RenderPass &pass)
void prepare()
Called only in the update loop when we need to refresh data to render.
RenderPipeline * m_pipeline
void bind() const
Bind buffer.
void buffer(const unsigned int count, Object *data)
Buffer data.
void set_index(const GLBufferBinding index)
Set vertex shader binding point.
void bind() const noexcept
Bind this batchs vertex array object.
void push(const std::vector< Vertex > &vertices) noexcept
Add vertex and index data to batch.
void flush() noexcept
Copy all data to GPU.
int count() const noexcept
Get the index count.
void prepare() noexcept
Sets up counters to begin pushing vertices.
void * offset() noexcept
Gets index offset.
@ UNIFORMS
Shader uniforms.
@ CAMERA
Camera transform data.
Data required to draw an object.
The configuration for drawing something.
glm::vec4 scissor
OpenGL scissor region. https://gamedev.stackexchange.com/a/40713.
glm::vec4 viewport
This is the glViewport. z,w is width/height.
unsigned int target
This is the framebuffer to draw to.
glm::vec4 clear_col
Colour buffer clear colour.
float clear_depth
Depth buffer clear depth.
unsigned int blend_equation
glBlendEquation.
unsigned int cull_face
glCullFace.
std::vector< unsigned int > enabled
glEnable features.
unsigned int blend_function
glBlendFunc for GL_SRC_ALPHA.
unsigned int depth_func
glDepthFunc.
std::vector< unsigned int > disabled
glDisable features.
unsigned int shader
Pipeline Ubershader.
Helper class to encapsulate our global settings we want to quickly access across app.