mirror of
https://github.com/Adamcake/Bolt.git
synced 2026-04-22 18:06:52 -04:00
library: add _bolt_count_contexts to gl
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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*);
|
||||
|
||||
Reference in New Issue
Block a user