view include/Mandelbrot.h @ 3:0f4ad525f49a

Lot's of cleanup. Applied AbstractFactory to class Fractal and derivatives. Decoupled most objects. Removed remaining standard C function calls. Improved old_views handling.
author Eris Caffee <discordia@eldalin.com>
date Sat, 23 Oct 2010 04:24:48 -0500
parents 455406f5f021
children df02a7de7fe2
line source
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) 2010 Sarah Eris Horsley Caffee
4 //
5 // mandelbrot - A simple Mandelbrot Set viewer.
6 //
7 // Mandelbrot.h
8 // Mandelbrot set calculator class definition
9 //
10 ////////////////////////////////////////////////////////////////////////////////
12 #ifndef MANDELBROT_H
13 #define MANDELBROT_H
15 #include <string>
17 #include "SDL.h"
19 #include "Fractal.h"
21 #define MANDELBROT_TYPE_NAME "Mandelbrot"
23 class Mandelbrot : public Fractal
24 {
25 public:
26 Mandelbrot();
28 bool calc_set();
29 bool init(SDL_Surface * surf);
31 const char * get_type_name();
33 private:
35 void draw_pixel(int x, int y, Uint32 * color);
36 };
38 namespace
39 {
40 class MandelbrotCreator : public FractalCreator
41 {
42 public:
43 MandelbrotCreator()
44 {
45 get_Fractal_map()["Mandelbrot"]=this;
46 }
48 virtual Fractal * create() const
49 {
50 return new Mandelbrot;
51 }
52 } theCreator;
53 }
55 #endif