|
@ -9,8 +9,8 @@ |
|
|
using namespace std; |
|
|
using namespace std; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gint height = 500; |
|
|
|
|
|
gint width = 500; |
|
|
|
|
|
|
|
|
gint height = 720; |
|
|
|
|
|
gint width = 1280; |
|
|
|
|
|
|
|
|
Raster raster(width, height); |
|
|
Raster raster(width, height); |
|
|
|
|
|
|
|
@ -19,11 +19,11 @@ Raster raster(width, height); |
|
|
*/ |
|
|
*/ |
|
|
void example() { |
|
|
void example() { |
|
|
Image* image = Image::loadFromFile("/home/blobt/Documents/dev/cpp/3dbase/image/scale.jpg"); |
|
|
Image* image = Image::loadFromFile("/home/blobt/Documents/dev/cpp/3dbase/image/scale.jpg"); |
|
|
|
|
|
|
|
|
|
|
|
//Image* image = Image::loadFromFile("/home/blobt/Documents/dev/cpp/3dbase2/assets/images/test.jpg");
|
|
|
Raster::Vertex ver1 = { |
|
|
Raster::Vertex ver1 = { |
|
|
int2(-50, 10), float2(0.0f, 0.0f), Rgba(255, 0, 0), |
|
|
|
|
|
int2(-50, 110), float2(0.0f, 1.0f), Rgba(255, 0, 0), |
|
|
|
|
|
int2(50, 10), float2(1.0f, 0.0f), Rgba(255, 0, 0) |
|
|
|
|
|
|
|
|
int2(10, 10), float2(0.0f, 0.0f), Rgba(255, 0, 0), |
|
|
|
|
|
int2(500, -500), float2(1.0f, 1.0f), Rgba(255, 0, 0), |
|
|
|
|
|
int2(10, -500), float2(0.0f, 1.0f), Rgba(255, 0, 0) |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
raster.drawTriangle(ver1, image); |
|
|
raster.drawTriangle(ver1, image); |
|
|