Add triangle filling with a solid color
This commit is contained in:
5 files changed
+211
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#ifndef COLOR_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
struct ColorU32
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t b;
|
||||
uint8_t g;
|
||||
uint8_t r;
|
||||
uint8_t a;
|
||||
};
|
||||
|
||||
uint32_t u32;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#define COLOR_H
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef GEOMETRY_H
|
||||
|
||||
#include "point.h"
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
|
||||
// STRUCTURES
|
||||
struct Face
|
||||
{
|
||||
unsigned int vertIndex[3];
|
||||
@@ -33,6 +35,14 @@ struct Mesh
|
||||
};
|
||||
|
||||
|
||||
// PUBLIC FUNCTIONS
|
||||
void FillTriangle(
|
||||
uint32_t *buffer, int width, uint32_t color,
|
||||
float x0, float y0,
|
||||
float x1, float y1,
|
||||
float x2, float y2);
|
||||
|
||||
|
||||
#define GEOMETRY_H
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user