You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
621 B

5 years ago
  1. #pragma once
  2. #include "CELLMath.hpp"
  3. namespace CELL
  4. {
  5. class Raster
  6. {
  7. public:
  8. Rgba* _buffer;
  9. int _width;
  10. int _height;
  11. public:
  12. Raster(int w,int h,void* buffer);
  13. ~Raster(void);
  14. void clear();
  15. void drawPoint(int x,int y, Rgba color,int ptSize);
  16. public:
  17. inline void setPixel(unsigned x,unsigned y,Rgba color)
  18. {
  19. if (x >= _width || y >= _height)
  20. {
  21. return;
  22. }
  23. _buffer[y * _width + x] = color;
  24. }
  25. };
  26. }