修改光栅化代码,使用同一套tile绘制机制
This commit is contained in:
@@ -8,16 +8,7 @@ DV_CORE_BEGIN_NAMESPACE
|
||||
|
||||
class DV_CORE_API Rasterizer
|
||||
{
|
||||
//Draw Line
|
||||
public:
|
||||
typedef std::function<void(const std::pair<int32_t, int32_t>&, float)> DrawLineCallback;
|
||||
|
||||
//Bresenham's line algorithm
|
||||
static void drawLine(int32_t canvasWidth, int32_t canvasHeight,
|
||||
const fVector2& start, const fVector2& end,
|
||||
DrawLineCallback callback);
|
||||
|
||||
//Draw Triangle
|
||||
//Draw Triangle with Larrabee
|
||||
public:
|
||||
typedef std::function<void(const std::pair<int32_t, int32_t>& pos, const fVector3& percent)> DrawTriangleCallback;
|
||||
|
||||
@@ -40,8 +31,9 @@ public:
|
||||
const fVector2& v0, const fVector2& v1, const fVector2& v2,
|
||||
DrawTriangleCallback callback, bool ccw=true, const DebugParam* debugParam=nullptr);
|
||||
|
||||
//Scaleline algorithm
|
||||
static void drawTriangleScanline(int32_t canvasWidth, int32_t canvasHeight,
|
||||
public:
|
||||
//BoundingBox algorithm
|
||||
static void drawTriangleBoundingBox(int32_t canvasWidth, int32_t canvasHeight,
|
||||
const fVector2& v0, const fVector2& v1, const fVector2& v2,
|
||||
DrawTriangleCallback callback, bool ccw = true);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user