#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <limits.h>
#include <string.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | CLcolour |
Defines a colour (r, g, b, a). More... | |
struct | CLvertex |
Defines 3D point (x, y, z). More... | |
struct | CLnormal |
Defines a 3D normal (i, j, k). More... | |
struct | CLtexcoord |
Defines a 2D texture coordinate (s, t). More... | |
struct | CLmatrix |
Defines a homogeneous 3D transformation matrix (4x4). More... | |
struct | CLimage |
Defines a 2D raster image. More... | |
struct | CLlight |
Defines a light. More... | |
struct | CLmaterial |
Defines a material. More... | |
struct | CLtexture |
Defines a 2D texture. More... | |
struct | CLprimitiveset |
Defines a primitive set. More... | |
struct | CLmesh |
Defines a mesh. More... | |
struct | CLmodel |
Defines a model. More... | |
struct | CLcontext |
Defines a set of materials, textures, lights, meshes, and models. More... | |
Defines | |
#define | CL_VERSION 2.0 |
#define | CL_PI 3.14159265358979323846 |
#define | CL_PI_2 1.57079632679489661923 |
#define | CL_EPSILON 1.0e-5 |
#define | CL_NONE 0 |
#define | CL_LIGHT_DISPLAY_LIST (1<<0) |
#define | CL_MATERIAL_DISPLAY_LIST (1<<1) |
#define | CL_TEXTURE_OBJECT (1<<2) |
#define | CL_COLOUR (1<<3) |
#define | CL_MATERIAL (1<<4) |
#define | CL_TEXTURE (1<<5) |
#define | CL_TEXTURE_ENV_MODE (1<<6) |
#define | CL_VERTICES (1<<7) |
#define | CL_NORMALS (1<<8) |
#define | CL_COLOURS (1<<9) |
#define | CL_TEXCOORDS (1<<10) |
#define | CL_EDGEFLAGS (1<<11) |
#define | CL_MESH_DISPLAY_LIST (1<<12) |
#define | CL_VERBOSE (1<<16) |
#define | CL_ALL -1 |
#define | CL_DEG2RAD(f) (((f) * CL_PI_2) / 90.0f) |
#define | CL_RAD2DEG(f) (((f) * 90.0f) / (CL_PI_2)) |
#define | CL_CROP(f, lb, ub) ((f) < (lb) ? (lb) : (f) > (ub) ? (ub) : (f)) |
#define | CL_MIN(a, b) ((a) > (b) ? (b) : (a)) |
#define | CL_MAX(a, b) ((a) < (b) ? (b) : (a)) |
#define | CL_BOOLEAN(a) ((bool)((a) ? GL_TRUE : GL_FALSE)) |
#define | CL_PRINTF() if (printf(__VA_ARGS__) < 0) return GL_FALSE |
#define | CL_ERROR() fprintf(stderr, "%s:%u:%s() : ERROR : ", __FILE__, __LINE__, __FUNCTION__); fprintf(stderr, __VA_ARGS__) |
#define | CL_FUNCENTRY() if (clIsEnabled(CL_VERBOSE)) printf ("%s() : ENTRY\n", __FUNCTION__) |
#define | CL_FUNCEXIT() if (clIsEnabled(CL_VERBOSE)) printf ("%s() : EXIT\n", __FUNCTION__) |
#define | CL_MALLOC(n) ((n) ? malloc(n) : 0) |
#define | CL_MEMCPY(dest, src, size) (((dest) && (src) && (size)) ? memcpy((dest), (src), (size)) : 0) |
Typedefs | |
typedef GLenum | CLenum |
typedef CLcolour | CLcolour |
typedef CLvertex | CLvertex |
typedef CLnormal | CLnormal |
typedef CLtexcoord | CLtexcoord |
typedef bool | CLedgeflag |
typedef CLmatrix | CLmatrix |
typedef CLimage | CLimage |
typedef CLlight | CLlight |
typedef CLmaterial | CLmaterial |
typedef CLtexture | CLtexture |
typedef CLprimitiveset | CLprimitiveset |
typedef CLmesh | CLmesh |
typedef CLmodel | CLmodel |
typedef CLcontext | CLcontext |
Functions | |
CLimage * | clInitImage (CLimage *image) |
CLmaterial * | clInitMaterial (CLmaterial *material) |
CLlight * | clInitLight (CLlight *light) |
CLtexture * | clInitTexture (CLtexture *texture) |
CLprimitiveset * | clInitPrimitiveSet (CLprimitiveset *primitiveset) |
CLmesh * | clInitMesh (CLmesh *mesh) |
CLcontext * | clInitContext (CLcontext *context) |
CLmodel * | clInitModel (CLmodel *model) |
CLimage * | clClearImage (CLimage *image) |
CLlight * | clClearLight (CLlight *light) |
CLmaterial * | clClearMaterial (CLmaterial *material) |
CLtexture * | clClearTexture (CLtexture *texture) |
CLprimitiveset * | clClearPrimitiveSet (CLprimitiveset *primitiveset) |
CLmesh * | clClearMesh (CLmesh *mesh) |
CLcontext * | clClearContext (CLcontext *context) |
CLmodel * | clClearModel (CLmodel *model) |
CLcolour * | clNewColour (GLvoid) |
CLvertex * | clNewVertex (GLvoid) |
CLnormal * | clNewNormal (GLvoid) |
CLtexcoord * | clNewTexCoord (GLvoid) |
CLedgeflag * | clNewEdgeFlag (GLvoid) |
CLmatrix * | clNewMatrix (GLvoid) |
CLimage * | clNewImage (GLvoid) |
CLlight * | clNewLight (GLvoid) |
CLmaterial * | clNewMaterial (GLvoid) |
CLtexture * | clNewTexture (GLvoid) |
CLprimitiveset * | clNewPrimitiveSet (GLvoid) |
CLmesh * | clNewMesh (GLvoid) |
CLcontext * | clNewContext (GLvoid) |
CLmodel * | clNewModel (GLvoid) |
void | clDeleteColour (CLcolour *colour) |
void | clDeleteVertex (CLvertex *vertex) |
void | clDeleteNormal (CLnormal *normal) |
void | clDeleteTexCoord (CLtexcoord *texcoord) |
void | clDeleteEdgeFlag (CLedgeflag *edgeflag) |
void | clDeleteMatrix (CLmatrix *matrix) |
void | clDeleteImage (CLimage *image) |
void | clDeleteLight (CLlight *light) |
void | clDeleteMaterial (CLmaterial *material) |
void | clDeleteTexture (CLtexture *texture) |
void | clDeletePrimitiveSet (CLprimitiveset *primitiveset) |
void | clDeleteMesh (CLmesh *mesh) |
void | clDeleteContext (CLcontext *context) |
void | clDeleteModel (CLmodel *model) |
CLcolour * | clCopyColour (CLcolour *dest, const CLcolour *src) |
CLvertex * | clCopyVertex (CLvertex *dest, const CLvertex *src) |
CLnormal * | clCopyNormal (CLnormal *dest, const CLnormal *src) |
CLtexcoord * | clCopyTexCoord (CLtexcoord *dest, const CLtexcoord *src) |
CLedgeflag * | clCopyEdgeFlag (CLedgeflag *dest, const CLedgeflag *src) |
CLmatrix * | clCopyMatrix (CLmatrix *dest, const CLmatrix *src) |
CLimage * | clCopyImage (CLimage *dest, const CLimage *src) |
CLlight * | clCopyLight (CLlight *dest, const CLlight *src) |
CLmaterial * | clCopyMaterial (CLmaterial *dest, const CLmaterial *src) |
CLtexture * | clCopyTexture (CLtexture *dest, const CLtexture *src) |
CLprimitiveset * | clCopyPrimitiveSet (CLprimitiveset *dest, const CLprimitiveset *src) |
CLmesh * | clCopyMesh (CLmesh *dest, const CLmesh *src) |
CLcontext * | clCopyContext (CLcontext *dest, const CLcontext *src) |
CLmodel * | clCopyModel (CLmodel *dest, const CLmodel *src) |
CLcolour * | clDefaultColour (CLcolour *colour) |
CLvertex * | clDefaultVertex (CLvertex *vertex) |
CLnormal * | clDefaultNormal (CLnormal *normal) |
CLtexcoord * | clDefaultTexCoord (CLtexcoord *texcoord) |
CLedgeflag * | clDefaultEdgeFlag (CLedgeflag *edgeflag) |
CLmatrix * | clDefaultMatrix (CLmatrix *matrix) |
CLimage * | clDefaultImage (CLimage *image) |
CLlight * | clDefaultLight (CLlight *light) |
CLmaterial * | clDefaultMaterial (CLmaterial *material) |
CLtexture * | clDefaultTexture (CLtexture *texture) |
CLprimitiveset * | clDefaultPrimitiveSet (CLprimitiveset *primitiveset) |
CLmesh * | clDefaultMesh (CLmesh *mesh) |
CLcontext * | clDefaultContext (CLcontext *context) |
CLmodel * | clDefaultModel (CLmodel *model) |
bool | clWriteColour (const CLcolour *src, FILE *file) |
bool | clWriteVertex (const CLvertex *src, FILE *file) |
bool | clWriteNormal (const CLnormal *src, FILE *file) |
bool | clWriteTexCoord (const CLtexcoord *src, FILE *file) |
bool | clWriteEdgeFlag (const CLedgeflag *src, FILE *file) |
bool | clWriteMatrix (const CLmatrix *src, FILE *file) |
bool | clWriteImage (const CLimage *src, FILE *file) |
bool | clWriteLight (const CLlight *src, FILE *file) |
bool | clWriteMaterial (const CLmaterial *src, FILE *file) |
bool | clWriteTexture (const CLtexture *src, FILE *file) |
bool | clWritePrimitiveSet (const CLprimitiveset *src, FILE *file) |
bool | clWriteMesh (const CLmesh *src, FILE *file) |
bool | clWriteContext (const CLcontext *src, FILE *file) |
bool | clWriteModel (const CLmodel *src, FILE *file) |
bool | clReadColour (CLcolour *dest, FILE *file) |
bool | clReadVertex (CLvertex *dest, FILE *file) |
bool | clReadNormal (CLnormal *dest, FILE *file) |
bool | clReadTexCoord (CLtexcoord *dest, FILE *file) |
bool | clReadEdgeFlag (CLedgeflag *dest, FILE *file) |
bool | clReadMatrix (CLmatrix *dest, FILE *file) |
bool | clReadImage (CLimage *dest, FILE *file) |
bool | clReadLight (CLlight *dest, FILE *file) |
bool | clReadMaterial (CLmaterial *dest, FILE *file) |
bool | clReadTexture (CLtexture *dest, FILE *file) |
bool | clReadPrimitiveSet (CLprimitiveset *dest, FILE *file) |
bool | clReadMesh (CLmesh *dest, FILE *file) |
bool | clReadContext (CLcontext *dest, FILE *file) |
bool | clReadModel (CLmodel *dest, FILE *file) |
bool | clPrintEnum (const CLenum *e) |
bool | clPrintColour (const CLcolour *colour) |
bool | clPrintVertex (const CLvertex *vertex) |
bool | clPrintNormal (const CLnormal *normal) |
bool | clPrintTexCoord (const CLtexcoord *texcoord) |
bool | clPrintEdgeFlag (const CLedgeflag *edgeflag) |
bool | clPrintMatrix (const CLmatrix *matrix) |
bool | clPrintImage (const CLimage *image) |
bool | clPrintLight (const CLlight *light) |
bool | clPrintMaterial (const CLmaterial *material) |
bool | clPrintTexture (const CLtexture *texture) |
bool | clPrintPrimitiveSet (const CLprimitiveset *primitiveset) |
bool | clPrintMesh (const CLmesh *mesh) |
bool | clPrintContext (const CLcontext *context) |
bool | clPrintModel (const CLmodel *model) |
bool | clPrintContextSummary (const CLcontext *context) |
bool | clPrintModelSummary (const CLmodel *model) |
A brief summary of the contents of the CLmodel. | |
void | clEnable (CLenum e) |
void | clDisable (CLenum e) |
bool | clIsEnabled (CLenum e) |
void | clUpdateLight (CLlight *light) |
void | clUpdateMaterial (CLmaterial *material) |
void | clUpdateTexture (CLtexture *texture) |
void | clUpdateMesh (CLmesh *mesh) |
void | clUpdateContext (CLcontext *context) |
void | clLoadLight (const CLlight *light) |
void | clLoadMaterial (const CLmaterial *material) |
void | clLoadTexture (const CLtexture *texture) |
void | clDrawImage (const CLimage *image) |
void | clRenderMesh (const CLmesh *mesh) |
void | clRenderMeshVisible (const CLmesh *mesh, const bool **flags) |
void | clRenderModel (const CLmodel *model) |
GLuint | clImageNumPixels (const CLimage *image) |
GLuint | clImagePixelSize (const CLimage *image) |
GLuint | clImageNumElements (const CLimage *image) |
GLuint | clImageElementSize (const CLimage *image) |
GLuint | clImageDataSize (const CLimage *image) |
unsigned int | clMeshAddPrimitiveSet (CLmesh *mesh, CLprimitiveset *primitiveset) |
unsigned int | clModelAddMesh (CLmodel *model, CLmesh *mesh) |
unsigned int | clContextAddMaterial (CLcontext *context, CLmaterial *material) |
unsigned int | clContextAddTexture (CLcontext *context, CLtexture *texture) |
unsigned int | clContextAddLight (CLcontext *context, CLlight *light) |
unsigned int | clContextAddModel (CLcontext *context, CLmodel *model) |
Definition in file cl.h.