src/glcontext.c

changeset 253
6ab35fcb8676
parent 208
658bccb1bf73
equal deleted inserted replaced
252:42e8695372f7 253:6ab35fcb8676
107 ctx->active_program = 0; 107 ctx->active_program = 0;
108 108
109 return true; 109 return true;
110 } else { 110 } else {
111 asc_error("glewInit failed: %s", glewGetErrorString(err)); 111 asc_error("glewInit failed: %s", glewGetErrorString(err));
112 SDL_GL_DeleteContext(ctx->glctx); 112 SDL_GL_DestroyContext(ctx->glctx);
113 return false; 113 return false;
114 } 114 }
115 } 115 }
116 116
117 void asc_gl_context_destroy(AscGLContext *ctx) { 117 void asc_gl_context_destroy(AscGLContext *ctx) {
120 120
121 cxListFree(ctx->shaders); 121 cxListFree(ctx->shaders);
122 cxListFree(ctx->cleanup_funcs); 122 cxListFree(ctx->cleanup_funcs);
123 123
124 // destroy the GL context and the window 124 // destroy the GL context and the window
125 SDL_GL_DeleteContext(ctx->glctx); 125 SDL_GL_DestroyContext(ctx->glctx);
126 ctx->glctx = NULL; 126 ctx->glctx = NULL;
127 } 127 }
128 128
129 void asc_gl_context_add_cleanup_func(AscGLContext *ctx, void(*func)(void)) { 129 void asc_gl_context_add_cleanup_func(AscGLContext *ctx, void(*func)(void)) {
130 struct asc_gl_context_cleanup_data *data = cxListEmplace(ctx->cleanup_funcs); 130 struct asc_gl_context_cleanup_data *data = cxListEmplace(ctx->cleanup_funcs);

mercurial