summaryrefslogtreecommitdiff
path: root/src/ral
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-11 23:00:26 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-11 23:00:26 +1000
commitb03bde3d412148cd573f5f14012cdd270f309947 (patch)
tree848af582079a60787cc5a5f8138e7ca6d508f2ee /src/ral
parent48a703e52490cb52fd32e54e3e37f7e70462a267 (diff)
starting work on immediate mode drawing
Diffstat (limited to 'src/ral')
-rw-r--r--src/ral/backends/opengl/backend_opengl.c5
-rw-r--r--src/ral/backends/opengl/opengl_helpers.h4
2 files changed, 4 insertions, 5 deletions
diff --git a/src/ral/backends/opengl/backend_opengl.c b/src/ral/backends/opengl/backend_opengl.c
index 7862a81..3822220 100644
--- a/src/ral/backends/opengl/backend_opengl.c
+++ b/src/ral/backends/opengl/backend_opengl.c
@@ -57,8 +57,7 @@ bool GPU_Backend_Init(const char* window_name, struct GLFWwindow* window,
}
// All of these are no-ops in OpenGL
-void GPU_Backend_Shutdown() { /* TODO */
-}
+void GPU_Backend_Shutdown() { /* TODO */ }
bool GPU_Device_Create(GPU_Device* out_device) { return true; }
void GPU_Device_Destroy(GPU_Device* device) {}
bool GPU_Swapchain_Create(GPU_Swapchain* out_swapchain) { return true; }
@@ -430,7 +429,7 @@ PUB void GPU_WriteTextureRegion(GPU_CmdEncoder* encoder, TextureHandle dst, u32
bool GPU_Backend_BeginFrame() {
glViewport(0, 0, context.swapchain.dimensions.x * 2, context.swapchain.dimensions.y * 2);
- glClearColor(0.8f, 0.8f, 0.8f, 1.0f);
+ glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
return true;
}
diff --git a/src/ral/backends/opengl/opengl_helpers.h b/src/ral/backends/opengl/opengl_helpers.h
index 0450c74..8a78de5 100644
--- a/src/ral/backends/opengl/opengl_helpers.h
+++ b/src/ral/backends/opengl/opengl_helpers.h
@@ -57,7 +57,7 @@ static u32 opengl_bindcreate_vao(GPU_Buffer* buf, VertexDescription desc) {
// Attributes
u32 attr_count = desc.attributes_count;
- printf("N attributes %d\n", attr_count);
+ // printf("N attributes %d\n", attr_count);
u64 offset = 0;
size_t vertex_size = desc.use_full_vertex_size ? sizeof(Vertex) : VertexDesc_CalcStride(&desc);
for (u32 i = 0; i < desc.attributes_count; i++) {
@@ -67,7 +67,7 @@ static u32 opengl_bindcreate_vao(GPU_Buffer* buf, VertexDescription desc) {
desc.attr_names[i]);
glEnableVertexAttribArray(i); // nth index
size_t this_offset = VertexAttribSize(desc.attributes[i]);
- printf("offset total %lld this attr %zu\n", offset, this_offset);
+ // printf("offset total %lld this attr %zu\n", offset, this_offset);
offset += this_offset;
}
glBindBuffer(GL_ARRAY_BUFFER, 0);