mirror of
https://git.coom.tech/drummyfish/small3dlib.git
synced 2024-11-21 20:39:57 +01:00
Add wireframe mode
This commit is contained in:
parent
5f09e37291
commit
b932a39e51
1 changed files with 9 additions and 0 deletions
|
@ -132,6 +132,7 @@ S3L_Vec4 toLight;
|
||||||
int8_t light = 1;
|
int8_t light = 1;
|
||||||
int8_t fog = 0;
|
int8_t fog = 0;
|
||||||
int8_t noise = 0;
|
int8_t noise = 0;
|
||||||
|
int8_t wire = 0;
|
||||||
int8_t transparency = 0;
|
int8_t transparency = 0;
|
||||||
int8_t mode = 0;
|
int8_t mode = 0;
|
||||||
S3L_Vec4 n0, n1, n2, nt;
|
S3L_Vec4 n0, n1, n2, nt;
|
||||||
|
@ -236,6 +237,12 @@ void drawPixel(S3L_PixelInfo *p)
|
||||||
previousTriangle = p->triangleIndex;
|
previousTriangle = p->triangleIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wire)
|
||||||
|
if (p->barycentric[0] != 0 &&
|
||||||
|
p->barycentric[1] != 0 &&
|
||||||
|
p->barycentric[2] != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
uint8_t r,g,b;
|
uint8_t r,g,b;
|
||||||
|
|
||||||
int8_t transparent = 0;
|
int8_t transparent = 0;
|
||||||
|
@ -475,6 +482,8 @@ int main()
|
||||||
fog = !fog;
|
fog = !fog;
|
||||||
else if (event.key.keysym.scancode == SDL_SCANCODE_N)
|
else if (event.key.keysym.scancode == SDL_SCANCODE_N)
|
||||||
noise = !noise;
|
noise = !noise;
|
||||||
|
else if (event.key.keysym.scancode == SDL_SCANCODE_W)
|
||||||
|
wire = !wire;
|
||||||
else if (event.key.keysym.scancode == SDL_SCANCODE_SPACE)
|
else if (event.key.keysym.scancode == SDL_SCANCODE_SPACE)
|
||||||
{
|
{
|
||||||
modelIndex = (modelIndex + 1) % modelsTotal;
|
modelIndex = (modelIndex + 1) % modelsTotal;
|
||||||
|
|
Loading…
Reference in a new issue