/
d.vision
/
division_engine_core
Обзор
Документация
Войти
/
d.vision
/
division_engine_core
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/context.c
66 строк
2 KB
Den163
Renamed all division_engine to division for convenient typing
20 май 2025, 00:20
20 май 2025, 00:20
683494c
Код
Авторство
О чём код?
#if DIVISION_USE_STB #if __ARM_NEON__ #define STBI_NEON #endif #define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION #include <stb_image.h> #include <stb_image_write.h> #endif #include "division_engine_core/context.h" #include "division_engine_core/font_internal.h" #include "division_engine_core/input_internal.h" #include "division_engine_core/render_pass_internal.h" #include "division_engine_core/renderer_internal.h" #include "division_engine_core/shader_internal.h" #include "division_engine_core/texture_internal.h" #include "division_engine_core/types/division_lifecycle.h" #include "division_engine_core/uniform_buffer_internal.h" #include "division_engine_core/vertex_buffer_internal.h" bool division_context_initialize(const DivisionSettings* settings, DivisionContext* ctx) { *ctx = (DivisionContext){0}; if (!division_renderer_context_alloc(ctx, settings)) return false; if (!division_shader_context_alloc(ctx, settings)) return false; if (!division_vertex_buffer_context_alloc(ctx, settings)) return false; if (!division_uniform_buffer_context_alloc(ctx, settings)) return false; if (!division_texture_context_alloc(ctx, settings)) return false; if (!division_render_pass_context_alloc(ctx, settings)) return false; if (!division_input_context_alloc(ctx, settings)) return false; if (!division_font_context_alloc(ctx, settings)) return false; return true; } DIVISION_EXPORT void division_context_register_lifecycle( DivisionContext* context, const DivisionLifecycle* lifecycle ) { context->lifecycle = *lifecycle; } void division_context_finalize(DivisionContext* ctx) { division_render_pass_context_free(ctx); division_texture_context_free(ctx); division_uniform_buffer_context_free(ctx); division_vertex_buffer_context_free(ctx); division_shader_context_free(ctx); division_renderer_context_free(ctx); division_input_context_free(ctx); division_font_context_free(ctx); }