LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
Loading...
Searching...
No Matches
lg_cubemap.c File Reference

Functions

LG_CubeMaplg_cubemap_new (LG_CubeMap_Paths *textures)
 
void lg_cubemap_free (LG_CubeMap *cubemap)
 
LG_CubeMap_Paths lg_cubemap_paths (const char *s[], lg_path_type t)
 
const Vertexlg_skybox ()
 
size_t lg_sizeof_skybox ()
 

Variables

static const Vertex skybox []
 

Detailed Description

 === Wrapper funcs to more easily create and manage cubemaps and skyboxes ===

Function Documentation

◆ lg_cubemap_new()

LG_CubeMap * lg_cubemap_new ( LG_CubeMap_Paths textures)

Create a new cubemap

A LG_CubeMap is just a LG_Texture made of 6 images

Although texture LG_Path is not used, it is set to LG_CubeMap_Paths->path[0], ie the first image

Parameters
texturesAn array of 6 image paths in {right, left, top, bottom, front, back} order
Returns
A new cubemap if OK, NULL on error

◆ lg_cubemap_free()

void lg_cubemap_free ( LG_CubeMap cubemap)

Remove cubemap from texture list AND free associated resources

Parameters
cubemapA pointer to a LG_CubeMap

◆ lg_cubemap_paths()

LG_CubeMap_Paths lg_cubemap_paths ( const char *  s[],
lg_path_type  t 
)

Return a LG_CubeMap_Paths, ie an array of 6 LG_path, from 6 strings and a lg_path_type

LG_CubeMap_Paths and CUBEMAP_N_FACES are defined in lg_textures.h

Parameters
s[]An array of CUBEMAP_N_FACES (= 6) const strings
tA lg_path_type
Returns
A LG_CubeMap_Paths

◆ lg_skybox()

const Vertex * lg_skybox ( )

Return a skybox

Returns
A static skybox as an array of Vertex

◆ lg_sizeof_skybox()

size_t lg_sizeof_skybox ( )

Get size of a skybox

Returns
The size of a static skybox