cbd53d7048a9240a2c0410f7c83cc126bb8b6057
[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 extern void Graphics_Init(const char * caption, int w, int h); //Initialise graphics
21 extern void Graphics_Destroy(); //Destroy graphics
22 extern void Graphics_Update(); //Update view
23 extern void Graphics_Clear(float r, float g, float b); //Clear screen
24 extern void Graphics_Pixel(int x[DIMENSIONS], float r, float g, float b); //Draw single pixel
25 extern void Graphics_Line(int x1[DIMENSIONS], int x2[DIMENSIONS], float r, float g, float b); //Draw straight line
26 extern void Graphics_Circle(int x[2], float radius, float r, float g, float b); //Draw circle
27
28 extern void Process_Events(); //Handle any events from the SDL system
29
30 extern 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