Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
OpenGLPipeline.hpp
1/*
2Copyright (C) 2016-2019,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_OPENGLPIPELINE_HPP
17#define AEONGAMES_OPENGLPIPELINE_HPP
18#include <cstdint>
19#include <vector>
20#include <string_view>
21#include "OpenGLVariable.hpp"
22#include "OpenGLUniformBlock.hpp"
23#include "aeongames/Pipeline.hpp"
24
25namespace AeonGames
26{
27 class OpenGLRenderer;
30 {
31 public:
33 OpenGLPipeline ( const OpenGLRenderer& aOpenGLRenderer, const Pipeline& aPipeline );
35 OpenGLPipeline ( OpenGLPipeline&& aOpenGLPipeline );
36 OpenGLPipeline ( const OpenGLPipeline& ) = delete;
37 OpenGLPipeline& operator= ( const OpenGLPipeline& ) = delete;
38 OpenGLPipeline& operator= ( OpenGLPipeline&& ) = delete;
41 GLint GetProgramId() const;
43 const std::vector<OpenGLVariable>& GetVertexAttributes () const;
45 const OpenGLUniformBlock* GetUniformBlock ( uint32_t name ) const;
47 const GLuint GetSamplerLocation ( uint32_t name_hash ) const;
48 private:
49 void ReflectAttributes();
50 void ReflectUniforms();
51 const OpenGLRenderer& mOpenGLRenderer;
52 const Pipeline* mPipeline{};
53 GLint mProgramId{};
54 std::vector<OpenGLVariable> mAttributes{};
55 std::vector<OpenGLSamplerLocation> mSamplerLocations{};
56 std::vector<OpenGLUniformBlock> mUniformBlocks{};
57 };
58}
59#endif
OpenGLPipeline(const OpenGLRenderer &aOpenGLRenderer, const Pipeline &aPipeline)
Construct from a renderer and pipeline resource.
GLint GetProgramId() const
Get the linked shader program identifier.
const OpenGLUniformBlock * GetUniformBlock(uint32_t name) const
Get a uniform block by its name hash, or nullptr if not found.
const std::vector< OpenGLVariable > & GetVertexAttributes() const
Get the reflected vertex attribute descriptions.
const GLuint GetSamplerLocation(uint32_t name_hash) const
Get the uniform location of a sampler by its name hash.
OpenGL rendering backend implementing the Renderer interface.
Rendering pipeline resource.
Definition Pipeline.hpp:122
<- This is here just for the literals
Definition AABB.hpp:31
Describes an OpenGL uniform block with its binding and member variables.