Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
Skybox Class Reference
Inheritance diagram for Skybox:
Collaboration diagram for Skybox:

Public Member Functions

TextureMap load_cubemap (char(*faces)[100])
 Loads a cubemap texture from 6 individual texture faces.
 
void create_skybox (TexturedMesh *texturedMesh, char(*skyboxTexture)[100])
 Creates a skybox with the given textures.
 
void constructor (const char(*path)[100])
 Constructor for the Skybox class.
 
void load (FILE *file)
 Loads data from a file.
 
void save (FILE *file)
 Saves the current state of the Skybox to a file.
 
void render (mat4 modelMatrix, Shader activeShader, WorldShaders *shaders)
 Renders the skybox using the provided model matrix and shader.
 
- Public Member Functions inherited from Node
void constructor ()
 Constructor for the Node class.
 
void initialize_node ()
 Initializes a node.
 
void get_glow_shader (Shader *shader)
 Retrieves the glow shader.
 
void get_settings_data (void ***ptr, int *length)
 Retrieves settings data.
 
void load ()
 Loads the necessary resources or data for the node.
 
void save (FILE *file)
 Saves the current state to the specified file.
 
void prepare_render (mat4 modelMatrix, Shader activeShader)
 Renders a node using the specified model matrix and shader.
 
void render ()
 Renders the node.
 
void update_global_position (vec3 pos, vec3 rot, vec3 scale)
 Updates the global position of a node.
 
void update (vec3 pos, vec3 rot, vec3 scale)
 Updates the position, rotation, and scale of a node.
 
void on_resize ()
 Handles the resize event for the node.
 
void free ()
 Frees the resources allocated by the object.
 
void is_cshape (bool *cshape)
 Checks if the current shape is a custom shape.
 
void is_body (bool *body)
 Sets the body status of the node.
 
void is_area (bool *area)
 Checks if the current node is within a specified area.
 
void is_render_target (bool *render_target)
 Sets the render target status.
 
void is_gui_element (bool *result)
 Determines if the current node is a GUI element.
 
void add_child (Node *child)
 Adds a child node to a parent node.
 
void add_child_and_realloc (Node *child)
 Adds a child node to a parent node and reallocates memory if necessary.
 
void remove_child (Node *child)
 Removes a child node from a parent node.
 
void remove_child_and_realloc (Node *child)
 Removes a child node from a parent node and reallocates memory if necessary.
 
void remove_child_and_free (Node *child)
 Removes a child node from a parent node and frees the memory of the child node.
 
void remove_child_and_free_and_realloc (Node *child)
 Removes a child node from a parent node, frees the memory of the child node, and reallocates memory if necessary.
 
int index_of_child (Node *child)
 Retrieves the index of a child node in a parent node's children array.
 
void print (int level)
 Prints the details of a node at a specified level of indentation.
 
void emit_ready (...)
 Emits the 'ready' signal for the node.
 
void emit_update (...)
 Emits an update event for the node.
 
void emit_signal (...)
 Emits a signal if the node has a script and the script has a signal handler.
 

Additional Inherited Members

- Public Attributes inherited from Node
void * object
 
struct Node ** children
 
struct Nodeparent
 
u16 length
 
u8 type
 
u8 flags
 
vec3 pos
 
vec3 rot
 
vec3 scale
 
vec3 globalPos
 
vec3 globalRot
 
vec3 globalScale
 
Behaviorbehavior
 
BehaviorAttributeattribute
 
u8 attributes_count
 
Shader shader
 
- Static Public Attributes inherited from Node
static Shader glowShader = 0
 A static Shader variable used for glow effect.
 

Member Function Documentation

◆ load_cubemap()

TextureMap Skybox::load_cubemap ( char(*)  faces[100])
inline

Loads a cubemap texture from 6 individual texture faces.

This function takes an array of file paths to 6 texture images, each representing one face of a cubemap (right, left, top, bottom, front, back), and loads them into a single cubemap texture.

Parameters
facesAn array of 6 strings, each containing the file path to a texture image. The order of the faces should be: right, left, top, bottom, front, back.
Returns
TextureMap The loaded cubemap texture.

◆ create_skybox()

void Skybox::create_skybox ( TexturedMesh texturedMesh,
char(*)  skyboxTexture[100] 
)
inline

Creates a skybox with the given textures.

This function initializes a skybox using the provided textures and assigns it to the given textured mesh.

Parameters
texturedMeshA pointer to the TextureMap structure where the skybox will be created.
skyboxTextureA 2D array containing the file paths of the six textures for the skybox. The textures should be ordered as follows: right, left, top, bottom, front, back.
Note
Each file path in the skyboxTexture array should not exceed 200 characters.

◆ constructor()

void Skybox::constructor ( const char(*)  path[100])
inline

Constructor for the Skybox class.

This function initializes a Skybox object with the given path to the skybox textures.

Parameters
pathA pointer to an array of strings, each string representing the file path to a texture image. The array should contain exactly 6 file paths, one for each face of the skybox.

◆ load()

void Skybox::load ( FILE *  file)
inline

Loads data from a file.

This function reads data from the provided file and processes it to load the necessary information for the Skybox class.

Parameters
fileA pointer to the file to be read.

◆ save()

void Skybox::save ( FILE *  file)
inline

Saves the current state of the Skybox to a file.

This function writes the current state of the Skybox object to the specified file.

Parameters
fileA pointer to the FILE object where the Skybox state will be saved.

◆ render()

void Skybox::render ( mat4  modelMatrix,
Shader  activeShader,
WorldShaders shaders 
)
inline

Renders the skybox using the provided model matrix and shader.

This function is responsible for rendering the skybox in the scene. It uses the provided model matrix to transform the skybox and the active shader to apply the necessary shading effects. Additionally, it utilizes the world shaders for any global shader settings or configurations.

Parameters
modelMatrixModel matrix used to transform the skybox.
activeShaderThe shader program currently active for rendering.
shadersA pointer to the WorldShaders structure containing global shader settings.

The documentation for this class was generated from the following file: