X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=types.h;fp=types.h;h=573418d241b3f2d55e45a9f479580adb84334820;hp=0000000000000000000000000000000000000000;hb=d3465c5cd0e6e9b414e669e8c8aa464b03f2fd24;hpb=b24fabe7a11b7e6d6d53aff68ea37df448fb53d2 diff --git a/types.h b/types.h new file mode 100644 index 0000000..573418d --- /dev/null +++ b/types.h @@ -0,0 +1,69 @@ +/** + * Type definition file + * @author Ashley Tyndall (20915779), Jenna de la Harpe (20367932) + */ + +#include +#include + +#ifndef TYPES_H +#define TYPES_H + +// Type definitions for vertex-coordinates, normals, texture-coordinates, +// and triangles (via the indices of 3 vertices). +typedef GLfloat vertex[3]; +typedef GLfloat normal[3]; +typedef GLfloat texCoord[2]; +typedef GLint vertexIndex; +typedef vertexIndex triangle[3]; + +// A type for a mesh +typedef struct { + int nVertices; // The number of vertices in the mesh + vertex* vertices; // Array with coordinates of vertices + normal* normals; // Array with normals of vertices + texCoord* texCoords; // Array with texture-coordinates of vertices + int nTriangles; // The number of triangles in the mesh + triangle* triangles; // Array of trangles via 3 indices into "vertices" +} mesh; + +// A type for a 2D texture, with height and width in pixels +typedef struct { + int height; + int width; + GLubyte *rgbData; // Array of bytes with the colour data for the texture +} texture; + +typedef struct { + // You'll need to add scale, rotation, material, mesh number, etc., + // to this structure + float x,y,z; +} SceneObject; + +// Menu enum +enum menu { + // Main menu + M_ROTATE_MOVE_CAMERA, + M_POSITION_SCALE, + M_ROTATION_TEXTURE_SCALE, + M_EXIT, + + // Material submenu + M_MATERIAL_ALL_RGB, + M_MATERIAL_AMBIENT_RGB, + M_MATERIAL_DIFFUSE_RGB, + M_MATERIAL_SPECULAR_RGB, + M_MATERIAL_ALL_ADSS, + M_MATERIAL_RED_ADSS, + M_MATERIAL_GREEN_ADSS, + M_MATERIAL_BLUE_ADSS, + + // Light submenu + M_LIGHT_MOVE_LIGHT_1, + M_LIGHT_RGBALL_LIGHT_1, + M_LIGHT_MOVE_LIGHT_2, + M_LIGHT_RGBALL_LIGHT_2 +}; + +#endif /* TYPES_H */ +