properly destroying windows and fonts
This commit is contained in:
parent
08d3521b61
commit
f54f639db5
|
@ -22,9 +22,7 @@ mg_font create_font()
|
|||
{
|
||||
//NOTE(martin): create font
|
||||
str8 fontPath = mp_app_get_resource_path(mem_scratch(), "../resources/OpenSansLatinSubset.ttf");
|
||||
// char* fontPathCString = str8_to_cstring(mem_scratch(), fontPath);
|
||||
|
||||
char* fontPathCString = "resources/OpenSansLatinSubset.ttf";
|
||||
char* fontPathCString = str8_to_cstring(mem_scratch(), fontPath);
|
||||
|
||||
FILE* fontFile = fopen(fontPathCString, "r");
|
||||
if(!fontFile)
|
||||
|
@ -238,8 +236,11 @@ int main()
|
|||
frameTime = mp_get_time(MP_CLOCK_MONOTONIC) - startTime;
|
||||
}
|
||||
|
||||
mg_font_destroy(font);
|
||||
mg_canvas_destroy(canvas);
|
||||
mg_surface_destroy(surface);
|
||||
mp_window_destroy(window);
|
||||
|
||||
mp_terminate();
|
||||
|
||||
return(0);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* file: glsl_shaders.h
|
||||
* note: string literals auto-generated by embed_text.py
|
||||
* date: 09/022023
|
||||
* date: 10/022023
|
||||
*
|
||||
**********************************************************************/
|
||||
#ifndef __GLSL_SHADERS_H__
|
||||
|
|
|
@ -2306,7 +2306,6 @@ void mg_font_destroy(mg_font fontHandle)
|
|||
free(fontData->glyphMap);
|
||||
free(fontData->glyphs);
|
||||
free(fontData->outlines);
|
||||
|
||||
free(fontData);
|
||||
mg_resource_handle_recycle(&__mgData.fonts, fontHandle.h);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue