Raster.h 888 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <Atomic/Math/Vector2.h>
  3. #include <Atomic/Math/Vector3.h>
  4. using namespace Atomic;
  5. namespace AtomicGlow
  6. {
  7. /// A callback to sample the environment. Return false to terminate rasterization.
  8. typedef bool (*RasterSamplingCallback)(void* param, int x, int y, const Vector3& barycentric,const Vector3& dx, const Vector3& dy, float coverage);
  9. class Raster
  10. {
  11. public:
  12. // Process the given triangle. Returns false if rasterization was interrupted by the callback.
  13. static bool DrawTriangle(bool antialias, const Vector2& extents, bool enableScissors, const Vector2 v[3], RasterSamplingCallback cb, void* param);
  14. // Process the given quad. Returns false if rasterization was interrupted by the callback.
  15. static bool DrawQuad(bool antialias, const Vector2& extents, bool enableScissors, const Vector2 v[4], RasterSamplingCallback cb, void* param);
  16. };
  17. }