make it actually render something

This commit is contained in:
Jeffrey Crowell 2022-05-30 13:13:21 -04:00
commit 9e082fd92f

View file

@ -86,7 +86,7 @@ void CheckOpenGLError(const char* stmt, const char* fname, int line)
} }
} }
#ifdef __APPLE__ #ifdef NOOOOOOOOO
#define GL_CHECK(stmt) do { \ #define GL_CHECK(stmt) do { \
stmt; \ stmt; \
CheckOpenGLError(#stmt, __FILE__, __LINE__); \ CheckOpenGLError(#stmt, __FILE__, __LINE__); \
@ -96,7 +96,7 @@ void CheckOpenGLError(const char* stmt, const char* fname, int line)
#endif #endif
static struct GLTexture opengl_tex[2]; static struct GLTexture opengl_tex[0x1000000];
static GLint opengl_curtex = 0; static GLint opengl_curtex = 0;
static map<pair<uint64_t, uint32_t>, struct ShaderProgram> shader_program_pool; static map<pair<uint64_t, uint32_t>, struct ShaderProgram> shader_program_pool;
@ -683,8 +683,8 @@ static void gfx_opengl_set_use_alpha(bool use_alpha) {
static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t buf_vbo_num_tris) { static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t buf_vbo_num_tris) {
//printf("flushing %d tris\n", buf_vbo_num_tris); //printf("flushing %d tris\n", buf_vbo_num_tris);
GL_CHECK(glBufferData(GL_ARRAY_BUFFER, sizeof(float) * buf_vbo_len, buf_vbo, GL_STREAM_DRAW)); glBufferData(GL_ARRAY_BUFFER, sizeof(float) * buf_vbo_len, buf_vbo, GL_STREAM_DRAW);
GL_CHECK(glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris)); glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris);
} }
static void gfx_opengl_init(void) { static void gfx_opengl_init(void) {