#include <RenderManager.hpp>
|
| void | init () override |
| void | process () override |
| void | shutdown () override |
| void | initialize3DView (View3DConfig config) |
| | Initialize a new 3D view.
|
| void | cleanup3DView () |
| | Cleans up the 3D view, resetting the state.
|
| bool | uploadTexture (int &textureID, const GL_TEXTURE_TYPE_ENUM texType, const int sizeX, const int sizeY, int param, const void *bitmap) |
| | Uploads a texture to the GPU.
|
| void | renderModelComponent (MDL3Model &model) |
| | Renders a MDL3 model.
|
| void | renderModelComponent (MDL3Model &model, ae::q20_12_t posX, ae::q20_12_t posY, ae::q20_12_t posZ, uint32_t rotX, uint32_t rotY, uint32_t rotZ, ae::q20_12_t scale=ae::q20_12_t{1}) |
| | Renders a MDL3 model.
|
| void | renderTexturedBillboard (BillboardData bb, const int texture, bool faceCamera, ae::q20_12_t camX, ae::q20_12_t camY, ae::q20_12_t camZ) |
| | Renders a textured billboard.
|
| void | renderDisplayList (const void *displayList, const int texture) |
| | Renders a textured model.
|
| void | deleteTexture (int &texture) |
| | Deletes a texture from the GPU and resets its ID.
|
|
| static const ae::q20_12_t | DEGREE_MODIFIER = ae::q20_12_t{1 << 15} / ae::q20_12_t{360} |
Definition at line 14 of file RenderManager.hpp.
◆ RenderManager()
| RenderManager::RenderManager |
( |
| ) |
|
|
privatedefault |
◆ cleanup3DView()
| void RenderManager::cleanup3DView |
( |
| ) |
|
◆ deleteTexture()
| void RenderManager::deleteTexture |
( |
int & | texture | ) |
|
Deletes a texture from the GPU and resets its ID.
- Parameters
-
| texture | The ID of the texture to delete. This will be set to -1 after deletion. |
Definition at line 271 of file RenderManager.cpp.
◆ init()
| void RenderManager::init |
( |
| ) |
|
|
inlineoverride |
◆ initialize3DView()
Initialize a new 3D view.
- Parameters
-
| config | The configuration for the 3D view. |
This function initializes the 3D view with the specified configuration. It does all of the general configuration, and also activates Fog and Outlines if they are present in the configuration.
- Note
- This function will check config.outlineColor and config.fogRed respectively to determine if outlins or fog need to be enabled. If these values are -1, then that feature will not be enabled. The general setting for these features is not affected. This means if these values are -1, GL_FOG or GL_OUTLINE should not be activated in config.settings, else they will work of default data. In turn GL_FOG or GL_OUTLINE will need to be activated in config.settings if they are desired, as this is not handled automatically.
Definition at line 44 of file RenderManager.cpp.
◆ process()
| void RenderManager::process |
( |
| ) |
|
|
inlineoverride |
◆ renderDisplayList()
| void RenderManager::renderDisplayList |
( |
const void * | displayList, |
|
|
const int | texture ) |
Renders a textured model.
- Parameters
-
| displayList | Pointer to the display list of the model to render. |
| texture | The ID of the texture to use for rendering. |
- Warning
- This function should not be used outside of RenderManager as it will soon be inlined & private. Calls from outside of RenderManager should start using renderMeshComponent() instead.
Definition at line 255 of file RenderManager.cpp.
◆ renderModelComponent() [1/2]
| void RenderManager::renderModelComponent |
( |
MDL3Model & | model | ) |
|
Renders a MDL3 model.
- Parameters
-
| model | The 3D model to render. |
- Note
- This function will render the model at the origin (0, 0, 0) with no rotation or scaling applied. It is intended for environment models. There is a separate function for rendering with transformations.
Definition at line 135 of file RenderManager.cpp.
◆ renderModelComponent() [2/2]
| void RenderManager::renderModelComponent |
( |
MDL3Model & | model, |
|
|
ae::q20_12_t | posX, |
|
|
ae::q20_12_t | posY, |
|
|
ae::q20_12_t | posZ, |
|
|
uint32_t | rotX, |
|
|
uint32_t | rotY, |
|
|
uint32_t | rotZ, |
|
|
ae::q20_12_t | scale = ae::q20_12_t{1} ) |
Renders a MDL3 model.
- Parameters
-
| model | The 3D model to render. |
| posX | The X position of the model. |
| posY | The Y position of the model. |
| posZ | The Z position of the model. |
| rotX | The X rotation of the model. |
| rotY | The Y rotation of the model. |
| rotZ | The Z rotation of the model. |
| scale | The scale of the model (default 1). |
Definition at line 150 of file RenderManager.cpp.
◆ renderTexturedBillboard()
| void RenderManager::renderTexturedBillboard |
( |
BillboardData | bb, |
|
|
const int | texture, |
|
|
bool | faceCamera, |
|
|
ae::q20_12_t | camX, |
|
|
ae::q20_12_t | camY, |
|
|
ae::q20_12_t | camZ ) |
Renders a textured billboard.
- Parameters
-
| bb | The billboard data to render. |
| texture | The ID of the texture to use for rendering. |
| faceCamera | Whether the billboard should face the camera. |
| camX | The X position of the camera. |
| camY | The Y position of the camera. |
| camZ | The Z position of the camera. |
Definition at line 196 of file RenderManager.cpp.
◆ shutdown()
| void RenderManager::shutdown |
( |
| ) |
|
|
inlineoverride |
◆ uploadTexture()
| bool RenderManager::uploadTexture |
( |
int & | textureID, |
|
|
const GL_TEXTURE_TYPE_ENUM | texType, |
|
|
const int | sizeX, |
|
|
const int | sizeY, |
|
|
int | param, |
|
|
const void * | bitmap ) |
Uploads a texture to the GPU.
- Parameters
-
| textureID | The ID of the texture to upload. |
| texType | The type of the texture to upload (i.e. RGB16, RGBA, ...). |
| sizeX | The width of the texture in pixels. |
| sizeY | The height of the texture in pixels. |
| param | The parameters of the texture. |
| bitmap | Pointer to the texture data to load. |
- Returns
- True if the texture was successfully uploaded, false otherwise.
- Note
- Will delete old texture if textureID is not -1, and will set textureID to the new texture ID.
glTexImage2D can return 0 on failure, we can use this to catch out of VRAM errors, etc.
Definition at line 102 of file RenderManager.cpp.
◆ Singleton< RenderManager >
◆ activeTexture
| int RenderManager::activeTexture = -1 |
|
private |
◆ DEGREE_MODIFIER
| const ae::q20_12_t RenderManager::DEGREE_MODIFIER = ae::q20_12_t{1 << 15} / ae::q20_12_t{360} |
|
inlinestaticprivate |
◆ math
| MathManager& RenderManager::math = MathManager::getInstance() |
|
private |
The documentation for this class was generated from the following files: