Don't use default VAO (#487)

* Don't use default VAO

* Don't use a VAO on OpenGL 2.1
This commit is contained in:
Khangaroo 2024-11-11 20:08:21 -05:00 committed by GitHub
parent aa830ce456
commit 1babad1640
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,6 +67,7 @@ static struct ShaderProgram shader_program_pool[CC_MAX_SHADERS];
static uint8_t shader_program_pool_size = 0; static uint8_t shader_program_pool_size = 0;
static uint8_t shader_program_pool_index = 0; static uint8_t shader_program_pool_index = 0;
static GLuint opengl_vbo; static GLuint opengl_vbo;
static GLuint opengl_vao;
static int tex_cache_size = 0; static int tex_cache_size = 0;
static int num_textures = 0; static int num_textures = 0;
@ -707,6 +708,11 @@ static void gfx_opengl_init(void) {
glGenBuffers(1, &opengl_vbo); glGenBuffers(1, &opengl_vbo);
glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo); glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo);
if (vmajor >= 3 && !is_es) {
glGenVertexArrays(1, &opengl_vao);
glBindVertexArray(opengl_vao);
}
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);