|
Hymn to Beauty
C++ 3D Engine
|
Low-level renderer implementing OpenGL. More...
#include <OpenGLRenderer.hpp>
Public Member Functions | |
| OpenGLRenderer (Utility::Window *window) | |
| Create new OpenGL renderer. More... | |
| ~OpenGLRenderer () final | |
| Destructor. More... | |
| CommandBuffer * | CreateCommandBuffer () final |
| Create a command buffer. More... | |
| void | BeginFrame () final |
| Begin a new frame. More... | |
| void | Submit (CommandBuffer *commandBuffer) final |
| Submit a command buffer for execution. More... | |
| void | Present () final |
| Present the rendered image to the swap chain. More... | |
| Buffer * | CreateBuffer (Buffer::BufferUsage bufferUsage, uint32_t size, const void *data=nullptr) final |
| Buffer * | CreateTemporaryBuffer (Buffer::BufferUsage bufferUsage, uint32_t size, const void *data=nullptr) final |
| VertexDescription * | CreateVertexDescription (unsigned int attributeCount, const VertexDescription::Attribute *attributes, bool indexBuffer=false) final |
| Create a vertex description. More... | |
| GeometryBinding * | CreateGeometryBinding (const VertexDescription *vertexDescription, Buffer *vertexBuffer, GeometryBinding::IndexType indexType=GeometryBinding::IndexType::NONE, const Buffer *indexBuffer=nullptr) final |
| Create a geometry binding. More... | |
| Shader * | CreateShader (const ShaderSource &shaderSource, Shader::Type type) final |
| Create a shader. More... | |
| ShaderProgram * | CreateShaderProgram (std::initializer_list< const Shader * > shaders) final |
| Create a shader program. More... | |
| Texture * | CreateTexture (const glm::uvec2 size, Texture::Format format, int components, unsigned char *data) final |
| Create a texture. More... | |
| const Sampler * | GetSampler (Sampler::Filter filter, Sampler::Clamping clamping) const final |
| Get a sampler. More... | |
| Texture * | CreateRenderTarget (const glm::uvec2 &size, Texture::Format format) final |
| Create a render target. More... | |
| void | FreeRenderTarget (Texture *renderTarget) final |
| Free a render target. More... | |
| GraphicsPipeline * | CreateGraphicsPipeline (const ShaderProgram *shaderProgram, const GraphicsPipeline::Configuration &configuration, const VertexDescription *vertexDescription=nullptr) final |
| Create a graphics pipeline. More... | |
| ComputePipeline * | CreateComputePipeline (const ShaderProgram *shaderProgram) final |
| Create a compute pipeline. More... | |
| void | Wait () final |
| Wait for all rendering to finish. More... | |
| unsigned char * | ReadImage (Texture *texture) final |
| Read a render texture color image. More... | |
| const std::vector< Profiling::Event > & | GetTimeline () const final |
| Get profiling timeline. More... | |
| const OptionalFeatures & | GetOptionalFeatures () const final |
| Get which optional features are supported. More... | |
| const OpenGLShaderProgram * | GetBlitShaderProgram () const |
| Get the shader program used for blitting. More... | |
| GLuint | GetFreeQuery () |
| Get a free query. More... | |
Public Member Functions inherited from Video::LowLevelRenderer | |
| LowLevelRenderer () | |
| Create a new low-level renderer. More... | |
| virtual | ~LowLevelRenderer () |
| Destructor. More... | |
| virtual Buffer * | CreateBuffer (Buffer::BufferUsage bufferUsage, unsigned int size, const void *data=nullptr)=0 |
| Create a GPU buffer. More... | |
| virtual Buffer * | CreateTemporaryBuffer (Buffer::BufferUsage bufferUsage, unsigned int size, const void *data=nullptr)=0 |
| Create a temporary GPU buffer. More... | |
| void | SetProfiling (bool profiling) |
| Set whether to profile. More... | |
| bool | IsProfiling () const |
| Get whether profiling is active. More... | |
Low-level renderer implementing OpenGL.
|
explicit |
Create new OpenGL renderer.
| window | The window to render to. |
|
final |
Destructor.
|
finalvirtual |
Begin a new frame.
Implements Video::LowLevelRenderer.
|
final |
|
finalvirtual |
|
finalvirtual |
Create a compute pipeline.
| shaderProgram | The shader program to use. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Create a geometry binding.
| vertexDescription | Description of the attributes in the vertex buffer. |
| vertexBuffer | Buffer containing the vertex data. |
| indexType | The type of values in the index buffer. |
| indexBuffer | Index buffer. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Create a graphics pipeline.
| shaderProgram | The shader program to use. |
| configuration | The configuration of the pipeline. |
| vertexDescription | The description of the vertex input to the pipeline. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Create a render target.
| size | The size of the texture, in pixels. |
| format | The format of the texture. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Create a shader.
| shaderSource | The source of the shader, generated by the shader processor. |
| type | The type of shader to create. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Create a shader program.
Link together shaders into a shader program that can be run on the GPU.
Sample:
| shaders | List of shaders to link together. |
Implements Video::LowLevelRenderer.
|
final |
|
finalvirtual |
Create a texture.
| size | The size of the texture, in pixels. |
| format | The format of the texture. |
| components | The number of components in the texture, 0 if no texture data is supplied. |
| data | The texture data to upload, or nullptr. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Create a vertex description.
| attributeCount | The number of vertex attributes. |
| attributes | The array of attributes. |
| indexBuffer | Whether to use an index buffer. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Free a render target.
| renderTarget | The render target to free. |
Implements Video::LowLevelRenderer.
| const OpenGLShaderProgram * Video::OpenGLRenderer::GetBlitShaderProgram | ( | ) | const |
Get the shader program used for blitting.
| GLuint Video::OpenGLRenderer::GetFreeQuery | ( | ) |
Get a free query.
|
finalvirtual |
Get which optional features are supported.
Implements Video::LowLevelRenderer.
|
finalvirtual |
Get a sampler.
| filter | The interpolation to apply. |
| clamping | How to handle sampling outside the texture dimensions. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Get profiling timeline.
Implements Video::LowLevelRenderer.
|
finalvirtual |
Present the rendered image to the swap chain.
Implements Video::LowLevelRenderer.
|
finalvirtual |
Read a render texture color image.
| texture | The texture to read. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Submit a command buffer for execution.
| commandBuffer | The command buffer to submit. |
Implements Video::LowLevelRenderer.
|
finalvirtual |
Wait for all rendering to finish.
Implements Video::LowLevelRenderer.