f977bd9ae4c60e0713f1a9be6967795659e9baf8
[matches/honours.git] / course / semester2 / pprog / assignment0 / graphics.h
1 /**
2  * @file graphics.h
3  * @purpose Wrapper to the SDL and OpenGL libraries, used for N-Body simulator. Declarations.
4  * @author Sam Moore
5  * @date August 2012
6  */
7
8 #ifndef _GRAPHICS_H
9 #define _GRAPHICS_H
10
11 #include <stdlib.h>
12 #include <SDL/SDL.h>
13 #include <SDL/SDL_opengl.h>
14
15 #ifndef DIMENSIONS //Check so that DIMENSIONS can be defined elsewhere (ie in "nbody.h")
16         #define DIMENSIONS 2 
17 #endif //DIMENSIONS
18
19
20 void Graphics_Init(const char * caption, int w, int h); //Initialise graphics
21 void Graphics_Destroy(); //Destroy graphics
22 void Graphics_Update(); //Update view
23 void Graphics_Clear(float r, float g, float b); //Clear screen
24 void Graphics_Pixel(int x[DIMENSIONS], float r, float g, float b); //Draw single pixel
25 void Graphics_Line(int x1[DIMENSIONS], int x2[DIMENSIONS], float r, float g, float b); //Draw straight line
26 void Graphics_Circle(int x[2], float radius, float r, float g, float b); //Draw circle
27
28
29
30 void Graphics_DrawPixel(int x[DIMENSIONS], float r, float g, float b);
31
32
33 #endif //_GRAPHICS_H
34
35 //EOF

UCC git Repository :: git.ucc.asn.au