init commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "dvc_config.h"
|
||||
#include "math/dvc_vector2.h"
|
||||
#include "math/dvc_vector3.h"
|
||||
|
||||
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
|
||||
public:
|
||||
typedef std::function<void(const std::pair<int32_t, int32_t>& pos, const fVector3& percent)> DrawTriangleCallback;
|
||||
|
||||
//Larrabee algorithm
|
||||
static void drawTriangleLarrabee(int32_t canvasWidth, int32_t canvasHeight,
|
||||
const fVector2& v0, const fVector2& v1, const fVector2& v2,
|
||||
DrawTriangleCallback callback, bool ccw=true);
|
||||
|
||||
//Scaleline algorithm
|
||||
static void drawTriangleScanline(int32_t canvasWidth, int32_t canvasHeight,
|
||||
const fVector3& v0, const fVector3& v1, const fVector3& v2,
|
||||
DrawTriangleCallback callback);
|
||||
};
|
||||
|
||||
DV_CORE_END_NAMESPACE
|
||||
Reference in New Issue
Block a user