00001 #include <SDL.h>
00002
00003 #ifndef INCLUDED_VIEWER
00004 #define INCLUDED_VIEWER
00005
00006 #ifndef INCLUDED_VIEWER_TYPES
00007 # include "viewer_types.h"
00008 #endif
00009
00010 #include "TaskManager.h"
00011
00012 extern TaskManager *manager;
00013
00014 class Viewer{
00015 public:
00016
00017 static int width;
00018 static int height;
00019 static int bpp;
00020 static int spe_num;
00021 int rgb_size[3];
00022 Uint32 video_flags;
00023 SDL_Surface *screen;
00024 Uint32 *pixels;
00025
00026 float zRow[MAX_WIDTH][MAX_HEIGHT];
00027
00028 Viewer(int b=32, int w=640, int h=480);
00029 Viewer(int b=32, int w=640, int h=480, int spenum = 1);
00030 void sdl_init();
00031 void init();
00032 int get_ticks();
00033 bool quit_check();
00034 void quit();
00035 void screen_clear();
00036 void swap_buffers();
00037 void write_pixel(int x, int y,float z, Uint32 rgb);
00038 void write_line(float x1, float y1, float x2, float y2, Uint32 rgb);
00039 void write_triangle(float x1, float y1, float x2, float y2, float x3, float y3, Uint32 rgb);
00040 void clean_pixels();
00041 void graph_line();
00042
00043
00044 void run_init(char *xml);
00045 void run_loop();
00046 void run_finish();
00047 void run_draw();
00048
00049 void zRow_init();
00050 };
00051
00052 #endif