switch front faces to be CCW instead of CW

This commit is contained in:
Sven Balzer
2025-09-25 06:01:16 +02:00
parent ec34b2df61
commit 8633cff3cb
3 changed files with 23 additions and 23 deletions
+13 -13
View File
@@ -113,9 +113,9 @@ struct Vertex {
static Vertex vertices[] = {
{{ -0.5f, 0.5f }},
{{ 0.5f, 0.5f }},
{{ 0.5f, -0.5f }},
{{ -0.5f, -0.5f }},
{{ 0.5f, -0.5f }},
{{ 0.5f, 0.5f }},
};
static Uint16 indices[] = {
@@ -127,27 +127,27 @@ static Uint16 indices[] = {
static Vertex grid_vertices[] = {
// LEFT
{{ -0.5f, 0.5f }},
{{ -0.5f + grid_line_size, 0.5f }},
{{ -0.5f + grid_line_size, -0.5f + grid_line_size }},
{{ -0.5f, -0.5f + grid_line_size }},
{{ -0.5f + grid_line_size, -0.5f + grid_line_size }},
{{ -0.5f + grid_line_size, 0.5f }},
// TOP
{{ -0.5f + grid_line_size, 0.5f }},
{{ 0.5f, 0.5f }},
{{ 0.5f, 0.5f - grid_line_size }},
{{ -0.5f + grid_line_size, 0.5f - grid_line_size }},
{{ 0.5f, 0.5f - grid_line_size }},
{{ 0.5f, 0.5f }},
// RIGHT
{{ 0.5f - grid_line_size, 0.5f - grid_line_size }},
{{ 0.5f, 0.5f - grid_line_size }},
{{ 0.5f, -0.5f }},
{{ 0.5f - grid_line_size, -0.5f }},
{{ 0.5f, -0.5f }},
{{ 0.5f, 0.5f - grid_line_size }},
// BOTTOM
{{ -0.5f, -0.5f + grid_line_size }},
{{ 0.5f - grid_line_size, -0.5f + grid_line_size }},
{{ 0.5f - grid_line_size, -0.5f }},
{{ -0.5f, -0.5f }},
{{ 0.5f - grid_line_size, -0.5f }},
{{ 0.5f - grid_line_size, -0.5f + grid_line_size }},
};
static Uint16 grid_indices[] = {
@@ -805,7 +805,7 @@ static bool recreate_graphics_pipelines() {
.primitive = {
.topology = WGPUPrimitiveTopology_TriangleList,
.stripIndexFormat = WGPUIndexFormat_Undefined,
.frontFace = WGPUFrontFace_CW,
.frontFace = WGPUFrontFace_CCW,
.cullMode = WGPUCullMode_Back,
.unclippedDepth = false,
},
@@ -958,7 +958,7 @@ static bool recreate_graphics_pipelines() {
.primitive = {
.topology = WGPUPrimitiveTopology_TriangleList,
.stripIndexFormat = WGPUIndexFormat_Undefined,
.frontFace = WGPUFrontFace_CW,
.frontFace = WGPUFrontFace_CCW,
.cullMode = WGPUCullMode_Back,
.unclippedDepth = false,
},
@@ -1051,7 +1051,7 @@ static bool recreate_graphics_pipelines() {
.primitive = {
.topology = WGPUPrimitiveTopology_TriangleList,
.stripIndexFormat = WGPUIndexFormat_Undefined,
.frontFace = WGPUFrontFace_CW,
.frontFace = WGPUFrontFace_CCW,
.cullMode = WGPUCullMode_Back,
.unclippedDepth = false,
},