Gama C Library
Gama C API Documentation
light.h File Reference
#include "../color.h"
#include "position.h"

Go to the source code of this file.

Data Structures

struct  gm3Light
 Represents a single light source in a 3D scene. More...

Functions

int gm3_light_create (gm3Light *l)
 Initializes a gm3Light struct with default values.

Variables

const gm3Light gm3_default_light
 A default gm3Light instance.

Function Documentation

◆ gm3_light_create()

int gm3_light_create ( gm3Light * l)

Initializes a gm3Light struct with default values.

Parameters
lA pointer to the gm3Light struct to initialize.
Returns
0 on success, -1 if l is NULL.

Variable Documentation

◆ gm3_default_light

const gm3Light gm3_default_light
Initial value:
= {
.position = {0, 1, 0},
.direction = {0, -1, 1},
.color = 0xCCCCCCFF,
.intensity = 0.5,
.ambient = 0.5,
}

A default gm3Light instance.

Initializes a light source at {0, 1, 0} pointing towards {0, -1, 1}, with a white color, medium intensity, and some ambient light.