CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
RendererUtility.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
14
20
21namespace CeresEngine {
22
24 static constexpr std::size_t defaultBindlessBufferAlignment = 256;
25
28 public:
33 static Matrix4 getCubeMapProjection(double near = 0.1, double far = 10.0);
34
37
40 static const Matrix4& getCubeMapView(UInt32 layer);
41
45 static GPUVertexFormat createVertexFormat(const VertexDeclaration& vertexDeclaration);
47
49
53
56 CE_ASSERT(device != nullptr);
57 return getBindlessBufferAlignment(*device);
58 }
59 };
60
61} // namespace CeresEngine
#define CE_ASSERT(...)
Definition Macros.hpp:323
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUDevice.hpp:357
A class that contains general utility methods for the renderer.
Definition RendererUtility.hpp:27
static GPUBufferSize getBindlessBufferAlignment(const GPUDevicePtr &device)
Gets the optimal bindless buffer alignment for consecutive objects.
Definition RendererUtility.hpp:55
static GPUVertexFormat createVertexFormat(const VertexBufferLayout &layout)
static const GPUVertexFormat & getDefaultMeshVertexFormat()
static Matrix4 getCubeMapProjection(double near=0.1, double far=10.0)
Gets the cube map projection matrix.
static GPUVertexFormat createVertexFormat(const VertexDeclaration &vertexDeclaration)
Converts the VertexDeclaration into a GPUVertexFormat for a shader.
static GPUBufferSize getBindlessBufferAlignment(GPUDevice &device)
Gets the optimal bindless buffer alignment for consecutive objects.
static const Array< Matrix4, 6 > & getCubeMapViews()
An array of views for cube map projections.
static const Matrix4 & getCubeMapView(UInt32 layer)
Gets the cube map projection view matrix for the given layer.
Definition Application.hpp:19
GPUMemorySize GPUBufferSize
A type that represents a buffer size.
Definition GPUBuffer.hpp:86
std::array< T, N > Array
Array is a container that encapsulates fixed size arrays.
Definition Array.hpp:17
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition GPUVertexFormat.hpp:77
Determines how a vertex buffer is laid out in memory.
Definition VertexDeclaration.hpp:318
Determines how vertices are laid-out on a vertex buffer or a mesh data.
Definition VertexDeclaration.hpp:205