graphic.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef __GRAPHIC__
00019
#define __GRAPHIC__
00020
00021
#include <ptf/core/singleton.hpp>
00022
#include <SDL.h>
00023
#ifdef MAC
00024
#include <OpenGL/gl.h>
00025
#include <OpenGL/glu.h>
00026
#else
00027
#include <GL/gl.h>
00028
#include <GL/glu.h>
00029
#endif
00030
#include <vector>
00031
00032
00033
using std::vector;
00034
00040 typedef struct {
00041 int x, y;
00042 }
Point;
00043
00051 typedef struct {
00052 int x, y;
00053 float u, v;
00054 }
PointTex;
00055
00059 class Graphic :
public Singleton<Graphic> {
00060
public:
00061
Graphic();
00062
~Graphic();
00063
bool createWindow(
int,
int,
bool);
00064
void setBGColor(
float,
float,
float);
00065
void setFGColor(
float,
float,
float);
00066
void drawFixationCross();
00067
void drawFixationCross(
int,
int);
00068
void drawLine(
Point,
Point);
00069
void drawTriangle(
Point,
Point,
Point);
00070
void drawRectangle(
Point,
Point,
Point,
Point);
00071
void drawUnfilledCircle(
Point,
float);
00072
void drawCircle(
Point,
float);
00073
void clear();
00074
void swap();
00075
int addTexture(
char*);
00076
void drawTexturedRectangle(
PointTex,
PointTex,
PointTex,
PointTex,
int);
00077
private:
00078
int width, height, bpp;
00079
bool windowOpen;
00080 vector<GLuint> textures;
00081 SDL_Surface *display;
00082
void initOpenGL();
00083 };
00084
00085
#endif
Generated on Fri Dec 17 14:54:23 2004 for Psychological Test Framework by
1.3.8