src/glcontext.c

changeset 115
e5f8c99b0987
parent 110
29f8d0d586f8
--- a/src/glcontext.c	Sat May 10 15:42:56 2025 +0200
+++ b/src/glcontext.c	Sat May 10 18:51:45 2025 +0200
@@ -45,21 +45,6 @@
     }
 }
 
-static int asc_primitives_init(AscGLContext *context) {
-    asc_dprintf("Create primitives for the GL context of active window.");
-    asc_mesh_allocate_buffers(context->primitives, ASC_PRIMITIVE_COUNT);
-
-    asc_primitives_init_plane(&context->primitives[ASC_PRIMITIVE_PLANE_IDX]);
-    // TODO: more primitives
-
-    return asc_error_catch_all_gl();
-}
-
-static void asc_primitives_destroy(AscGLContext *context) {
-    asc_dprintf("Destroy primitives in GL context of active window.");
-    asc_mesh_free_buffers((AscMesh*)&context->primitives, sizeof(context->primitives) / sizeof(AscMesh));
-}
-
 static int asc_shader_initialize_predefined(AscGLContext *ctx) {
     int ret = 0;
     ret |= asc_shader_sprite_init(&ctx->shader.sprite);
@@ -145,12 +130,6 @@
         glEnable(GL_DEBUG_OUTPUT);
         glDebugMessageCallback(asc_gl_debug_callback, NULL);
 
-        if (asc_primitives_init(ctx)) {
-            asc_error("Creating primitive meshes failed");
-            SDL_GL_DeleteContext(ctx->glctx);
-            return false;
-        }
-
         if (asc_shader_initialize_predefined(ctx)) {
             asc_error("Initializing predefined shaders failed");
             SDL_GL_DeleteContext(ctx->glctx);
@@ -180,7 +159,6 @@
     cxListFree(ctx->cleanup_funcs);
     asc_texture_destroy_predefined(ctx);
     asc_shader_destroy_predefined(ctx);
-    asc_primitives_destroy(ctx);
 
     // destroy the GL context and the window
     SDL_GL_DeleteContext(ctx->glctx);

mercurial