MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
mgdl-light.h
1#pragma once
2
3#include "mgdl-types.h"
4#include "mgdl-color.h"
5#include "mgdl-opengl.h"
6
7enum LightType
8{
9 Point,
10 Spot,
11 Directional
12};
13typedef enum LightType LightType;
14
15/* Representes a light in a 3D scene.
16 * Contains color and light properties
17 */
18struct Light
19{
20 float intensity;
21 LightType type;
22 float spotHalfAngle;
23 float constantAttenuation;
24 float LinearAttenuation;
25 float QuadraticAttenuation;
26 const char* name;
27
28 //
29 GLfloat position[4];
30 GLfloat direction[4];
31 GLfloat diffuse[4];
32 GLfloat specular[4];
33 GLfloat ambient[4];
34
35 GLint glIndex;
36};
37
38typedef struct Light Light;
39
40#ifdef __cplusplus
41extern "C"
42{
43#endif
44
45 Light* Light_Create(void);
46 void Light_SetPosition(Light* light, V3f position);
47 void Light_SetDirection(Light* light, V3f direction);
48 void Light_SetColor(Light* light, Color4f* color);
49 void Light_SetAmbientColor(Light* light, Color4f* color);
50 void Light_Enable(Light* light);
51 void Light_Disable(Light* light);
52 void Light_Apply(Light* light);
53
54 V3f Light_GetDirection(Light* light);
55
56
57#ifdef __cplusplus
58}
59#endif
Color struct and functions.
Library types, macros, defines and enums header.
Definition mgdl-color.h:54
Definition mgdl-light.h:19