X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment1%2Fsingle-thread%2Fgraphics.h;h=24a7a33181349bc9309a7748890c866e50e17998;hb=20979b1c07eda73b7f86b2fe8cb66eb58d959e04;hp=b3f9dc54686671a1c5d06f53bc4882ef0d838958;hpb=7a341db1fbf5db94b711135b2a79e852c6fb1bc4;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment1/single-thread/graphics.h b/course/semester2/pprog/assignment1/single-thread/graphics.h index b3f9dc54..24a7a331 100644 --- a/course/semester2/pprog/assignment1/single-thread/graphics.h +++ b/course/semester2/pprog/assignment1/single-thread/graphics.h @@ -5,16 +5,23 @@ * @file graphics.h * @author Sam Moore (20503628) 2012 - adapted from template program provided by UWA * @purpose N-Body simulator - declarations of all graphics related functions - * NOTE: I prefer to keep graphics entirely seperate from the simulation as much as possible, hence seperate files + * NOTE: I prefer to keep graphics seperate from the simulation as much as possible, hence seperate files */ #include + +#define GLUT +//#define SDL + +#ifdef GLUT #include +#include +#endif //GLUT #include "nbody.h" #define WIDTH 800 -#define HEIGHT 800 +#define HEIGHT 640 #define POINT_SIZE 1 #define POSITION_X 112 #define POSITION_Y 20 @@ -24,17 +31,31 @@ #define WORLD_TOP 10000 #define VIEW_ANGLE 45 #define RHO 100 -#define WORLD_NEAR 0.1 +#define WORLD_NEAR 0.0001 #define WORLD_FAR 1000000 #define BALL_SIZE 0.5 #define REFRESH_RATE 0.001 -#define LINE_SIZE 1000 -void Graphics_Init(void); + +void Graphics_Run(int argc, char ** argv); void Graphics_Display(void); void Graphics_Keyboard(unsigned char key, int mouse_x, int mouse_y); void Graphics_Reshape(int width, int height); -void Graphics_Animate(void); + + +#define FLYING_CAMERA + +#ifdef FLYING_CAMERA +typedef struct +{ + float p[DIMENSIONS]; // Translation position of the camera + + float x[DIMENSIONS]; + float y[DIMENSIONS]; + float z[DIMENSIONS]; + +} Camera; +#endif //FLYING_CAMERA #endif //_GRAPHICS_H