summaryrefslogtreecommitdiff
path: root/src/renderer/backends/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/backends/opengl')
-rw-r--r--src/renderer/backends/opengl/backend_opengl.c7
-rw-r--r--src/renderer/backends/opengl/backend_opengl.h4
-rw-r--r--src/renderer/backends/opengl/opengl_helpers.h1
3 files changed, 9 insertions, 3 deletions
diff --git a/src/renderer/backends/opengl/backend_opengl.c b/src/renderer/backends/opengl/backend_opengl.c
index ba9435e..de6b71a 100644
--- a/src/renderer/backends/opengl/backend_opengl.c
+++ b/src/renderer/backends/opengl/backend_opengl.c
@@ -44,7 +44,7 @@ bool gpu_backend_init(const char* window_name, struct GLFWwindow* window) {
resource_pools_init(&context.pool_arena, context.resource_pools);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
@@ -132,7 +132,7 @@ gpu_cmd_encoder gpu_cmd_encoder_create() {
void gpu_cmd_encoder_destroy(gpu_cmd_encoder* encoder) {}
void gpu_cmd_encoder_begin(gpu_cmd_encoder encoder) {}
void gpu_cmd_encoder_begin_render(gpu_cmd_encoder* encoder, gpu_renderpass* renderpass) {
- rgba clear_colour = STONE_900;
+ rgba clear_colour = STONE_800;
glClearColor(clear_colour.r, clear_colour.g, clear_colour.b, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
@@ -181,7 +181,8 @@ void encode_bind_shader_data(gpu_cmd_encoder* encoder, u32 group, shader_data* d
glBufferSubData(GL_UNIFORM_BUFFER, 0, ubo_buf->size, data->data);
} else if (binding.type == SHADER_BINDING_TEXTURE) {
gpu_texture* tex = TEXTURE_GET(binding.data.texture.handle);
- glActiveTexture(GL_TEXTURE0 + i);
+ glActiveTexture(GL_TEXTURE0);
+ // glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, tex->id);
}
}
diff --git a/src/renderer/backends/opengl/backend_opengl.h b/src/renderer/backends/opengl/backend_opengl.h
index 348eb41..f3b4eb7 100644
--- a/src/renderer/backends/opengl/backend_opengl.h
+++ b/src/renderer/backends/opengl/backend_opengl.h
@@ -45,6 +45,10 @@ typedef struct gpu_texture {
void *pad
} gpu_texture;
+typedef struct opengl_support {
+
+} opengl_support;
+
u32 shader_create_separate(const char *vert_shader, const char *frag_shader);
void uniform_vec3f(u32 program_id, const char *uniform_name, vec3 *value);
diff --git a/src/renderer/backends/opengl/opengl_helpers.h b/src/renderer/backends/opengl/opengl_helpers.h
index a3c4014..41018cb 100644
--- a/src/renderer/backends/opengl/opengl_helpers.h
+++ b/src/renderer/backends/opengl/opengl_helpers.h
@@ -43,6 +43,7 @@ static opengl_vertex_attr format_from_vertex_attr(vertex_attrib_type attr) {
}
static u32 opengl_bindcreate_vao(gpu_buffer* buf, vertex_description desc) {
+ DEBUG("Vertex format name %s", desc.debug_label);
// 1. Bind the buffer
glBindBuffer(GL_ARRAY_BUFFER, buf->id.vbo);
// 2. Create new VAO