Add triangle filling with a solid color

This commit is contained in:
austin committed 2020-07-01 17:42:46 -07:00
1 parent 33cb124d77
commit f642b0ec02
5 files changed
+211 -2

No files matched your search

+25
View File
@@ -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
+10
View File
@@ -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