implemented basic renderer
This commit is contained in:
parent
be1abc3762
commit
5ba261c72c
11 changed files with 295 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
|||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "buffer.h"
|
||||
|
||||
int ctx_init()
|
||||
{
|
||||
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
|
||||
|
@ -18,3 +20,9 @@ void ctx_clear_screen(float r, float g, float b, float a)
|
|||
glClearColor(r, g, b, a);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void ctx_draw_elements(VertexArrayObject* vao)
|
||||
{
|
||||
bind_vao(*vao);
|
||||
glDrawElements(GL_TRIANGLES, vao->elements, GL_UNSIGNED_INT, (void*)0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue