rasterizer.h 623 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef RASTERIZER_H
  2. #define RASTERIZER_H
  3. #include "SDL.h"
  4. #include "canvas.h"
  5. #include "model.h"
  6. class Rasterizer{
  7. public:
  8. Rasterizer(Canvas *canvas) :mCanvas(canvas){}
  9. void drawModels(Model * models);
  10. void testPattern();
  11. void makeCoolPattern();
  12. private:
  13. static const Uint32 PIXEL_FORMAT = SDL_PIXELFORMAT_RGBA8888;
  14. static const SDL_PixelFormat* mappingFormat;
  15. Uint32 getPixelColor(int x, int y);
  16. void setPixelColor(Uint32 color, int x, int y);
  17. int convertCoordinates(int x, int y);
  18. Canvas * mCanvas;
  19. };
  20. #endif