cubos::core::gl namespace

Graphics module.

Namespaces

namespace impl
Namespace to store the abstract types implemented by the render device implementations.

Classes

struct FramebufferDesc
Describes a framebuffer.
struct RasterStateDesc
Decribes a rasterizer state.
struct DepthStencilStateDesc
Describes a depth stencil state.
struct BlendStateDesc
Describes a blend state.
struct SamplerDesc
Describes a sampler.
struct Texture1DDesc
Describes a 1D texture.
struct Texture2DDesc
Describes a 2D texture.
struct Texture2DArrayDesc
Describes a 2D texture array.
struct Texture3DDesc
Describes a 3D texture.
struct CubeMapDesc
Describes a cube map.
struct CubeMapArrayDesc
Describes a cube map array.
struct ConstantBufferElement
Describes an element in a constant buffer.
struct ConstantBufferStructure
Describes the structure of a constant buffer.
struct VertexElement
Describes a vertex element.
struct VertexArrayDesc
Describes a vertex array.
class RenderDevice
Interface used to wrap low-level rendering APIs such as OpenGL.

Enums

enum class Property { MaxAnisotropy, ComputeSupported }
Render device properties that can be queried at runtime.
enum class Usage { Default, Dynamic, Static }
Usage mode for buffers and textures.
enum class Type { Byte, Short, Int, UByte, UShort, UInt, NByte, NShort, NUByte, NUShort, Float }
Data type.
enum class IndexFormat { UShort, UInt }
Index format.
enum class TextureFormat { R8SNorm, R16SNorm, RG8SNorm, RG16SNorm, RGBA8SNorm, RGBA16SNorm, R8UNorm, R16UNorm, RG8UNorm, RG16UNorm, RGBA8UNorm, RGBA16UNorm, R8SInt, R16SInt, RG8SInt, RG16SInt, RGBA8SInt, RGBA16SInt, R8UInt, R16UInt, RG8UInt, RG16UInt, RGBA8UInt, RGBA16UInt, R16Float, R32Float, RG16Float, RG32Float, RGB16Float, RGB32Float, RGBA16Float, RGBA32Float, Depth16, Depth32, Depth24Stencil8, Depth32Stencil8 }
Texture format.
enum class AddressMode { Repeat, Mirror, Clamp, Border }
Texture address mode.
enum class TextureFilter { None, Nearest, Linear }
Texture filter type.
enum class Winding { CW, CCW }
Triangle winding mode.
enum class Face { Front, Back, FrontAndBack }
Specifies a face.
enum class RasterMode { Wireframe, Fill }
Rasterizer mode.
enum class Compare { Never, Less, LEqual, Greater, GEqual, Equal, NEqual, Always }
Comparison function.
enum class StencilAction { Zero, Keep, Replace, Increment, IncrementWrap, Decrement, DecrementWrap, Invert }
Stencil action.
enum class BlendFactor { Zero, One, SrcColor, InvSrcColor, DstColor, InvDstColor, SrcAlpha, InvSrcAlpha, DstAlpha, InvDstAlpha }
Blend factor.
enum class BlendOp { Add, Substract, RevSubstract, Min, Max }
Blend operation.
enum class Stage { Vertex, Geometry, Pixel, Compute }
Shader stage type.
enum class CubeFace { PositiveX = 0, NegativeX = 1, PositiveY = 2, NegativeY = 3, PositiveZ = 4, NegativeZ = 5 }
Cube map face.
enum class MemoryBarriers { None = 0, VertexBuffer = 1, IndexBuffer = 2, ConstantBuffer = 4, ImageAccess = 8, TextureAccess = 16, Framebuffer = 32, All = VertexBuffer | IndexBuffer | ConstantBuffer | ImageAccess | TextureAccess | Framebuffer }
Memory barrier flags for synchronization.
enum class Access { Read, Write, ReadWrite }
Access mode for a resource.

Typedefs

using Framebuffer = std::shared_ptr<impl::Framebuffer>
Handle to a framebuffer.
using RasterState = std::shared_ptr<impl::RasterState>
Handle to a rasterizer state.
using DepthStencilState = std::shared_ptr<impl::DepthStencilState>
Handle to a depth stencil state.
using BlendState = std::shared_ptr<impl::BlendState>
Handle to a blend state.
using PixelPackBuffer = std::shared_ptr<impl::PixelPackBuffer>
Handle to a pixel pack buffer.
using Sampler = std::shared_ptr<impl::Sampler>
Handle to a sampler.
using Texture1D = std::shared_ptr<impl::Texture1D>
Handle to a 1D texture.
using Texture2D = std::shared_ptr<impl::Texture2D>
Handle to a 2D texture.
using Texture2DArray = std::shared_ptr<impl::Texture2DArray>
Handle to a 2D texture array.
using Texture3D = std::shared_ptr<impl::Texture3D>
Handle to a 3D texture.
using CubeMap = std::shared_ptr<impl::CubeMap>
Handle to a cube map.
using CubeMapArray = std::shared_ptr<impl::CubeMapArray>
Handle to a cube map array.
using ConstantBuffer = std::shared_ptr<impl::ConstantBuffer>
Handle to a constant buffer.
using IndexBuffer = std::shared_ptr<impl::IndexBuffer>
Handle to an index buffer.
using VertexBuffer = std::shared_ptr<impl::VertexBuffer>
Handle to a vertex buffer.
using VertexArray = std::shared_ptr<impl::VertexArray>
Handle to a vertex array.
using ShaderStage = std::shared_ptr<impl::ShaderStage>
Handle to a shader stage.
using ShaderPipeline = std::shared_ptr<impl::ShaderPipeline>
Handle to a shader pipeline.
using ShaderBindingPoint = impl::ShaderBindingPoint*
Handle to a shader binding point.
using Timer = std::shared_ptr<impl::Timer>
Handle to a timer.
using PipelinedTimer = std::shared_ptr<impl::PipelinedTimer>
Handle to a pipelined timer.

Functions

auto generateScreenQuad(RenderDevice& renderDevice, const ShaderPipeline& pipeline, VertexArray& va) -> CUBOS_CORE_API void
Creates the resources required to draw a quad that fills the screen and returns its VertexArray.

Function documentation

CUBOS_CORE_API void cubos::core::gl::generateScreenQuad(RenderDevice& renderDevice, const ShaderPipeline& pipeline, VertexArray& va)

Creates the resources required to draw a quad that fills the screen and returns its VertexArray.

Parameters
renderDevice RenderDevice to be used for generation of the quad.
pipeline Pipeline to associate the quad's VertexArray with.
va out Handle of the quad's VertexArray.

The quad provided by this function consists of two one sided triangles, with vertices containing the 2D position and UV coordinates. This function assumes the shader pipeline provided takes as input attributes a vec2 position and a vec2 uv.