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.

33 lines
697 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. void drawLine(float2 pt1,float2 pt2,Rgba color1,Rgba color2);
  17. public:
  18. inline void setPixel(unsigned x,unsigned y,Rgba color)
  19. {
  20. if (x >= _width || y >= _height)
  21. {
  22. return;
  23. }
  24. _buffer[y * _width + x] = color;
  25. }
  26. };
  27. }