library: add _bolt_count_contexts to gl

This commit is contained in:
Adam
2024-02-05 18:31:36 +00:00
parent fea6ab4725
commit aad8a6984e
2 changed files with 11 additions and 0 deletions

View File

@@ -20,6 +20,16 @@ struct GLContext* _bolt_context() {
return current_context;
}
size_t _bolt_context_count() {
size_t ret = 0;
for (size_t i = 0; i < CONTEXTS_CAPACITY; i += 1) {
if (contexts[i].id != 0) {
ret += 1;
}
}
return ret;
}
void _bolt_create_context(void* egl_context, void* shared) {
for (size_t i = 0; i < CONTEXTS_CAPACITY; i += 1) {
struct GLContext* ptr = &contexts[i];

View File

@@ -140,6 +140,7 @@ struct GLTexture2D* _bolt_context_get_texture(struct GLContext*, unsigned int);
struct GLVertexArray* _bolt_context_get_vao(struct GLContext*, unsigned int);
struct GLContext* _bolt_context();
size_t _bolt_context_count();
void _bolt_create_context(void*, void*);
void _bolt_make_context_current(void*);
void _bolt_destroy_context(void*);