MLX42 1.0
MLX42
Loading...
Searching...
No Matches
mlx_exit.c File Reference
#include "MLX42/MLX42_Int.h"
Include dependency graph for mlx_exit.c:

Go to the source code of this file.

Functions

static void mlx_free_image (void *content)
 
void mlx_close_window (mlx_t *mlx)
 
void mlx_terminate (mlx_t *mlx)
 

Function Documentation

◆ mlx_close_window()

void mlx_close_window ( mlx_t mlx)

Notifies MLX that it should stop rendering and exit the main loop. This is not the same as terminate, this simply tells MLX to close the window.

Parameters
[in]mlxThe MLX instance handle.

Definition at line 26 of file mlx_exit.c.

27{
30}
#define MLX_NONNULL(var)
Definition MLX42_Int.h:46
GLuint GLsizei GLsizei * length
Definition glad.h:3372
Definition MLX42.h:361
void * window
Definition MLX42.h:362
Here is the caller graph for this function:

◆ mlx_free_image()

static void mlx_free_image ( void content)
static

Definition at line 17 of file mlx_exit.c.

18{
19 mlx_image_t* img = content;
20
21 mlx_freen(4, img->context, img->pixels, img->instances, img);
22}
bool mlx_freen(int32_t count,...)
Definition mlx_utils.c:89
GLint void * img
Definition glad.h:3003
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mlx_terminate()

void mlx_terminate ( mlx_t mlx)

All of glfw & glads resources are cleaned up by the terminate function. Now it's time to clean up our own mess.

Definition at line 36 of file mlx_exit.c.

37{
39
40 mlx_ctx_t *const mlxctx = mlx->context;
41
42 glUseProgram(0);
43 glLinkProgram(mlxctx->shaderprogram);
44 glDeleteProgram(mlxctx->shaderprogram);
46 mlx_lstclear((mlx_list_t**)(&mlxctx->hooks), &free);
47 mlx_lstclear((mlx_list_t**)(&mlxctx->render_queue), &free);
49 mlx_freen(2, mlxctx, mlx);
50}
void mlx_lstclear(mlx_list_t **lst, void(*del)(void *))
Definition mlx_list.c:33
#define glDeleteProgram
Definition glad.h:3359
#define glLinkProgram
Definition glad.h:3428
#define glUseProgram
Definition glad.h:3434
static void mlx_free_image(void *content)
Definition mlx_exit.c:17
void * context
Definition MLX42.h:363
Here is the call graph for this function:
Here is the caller graph for this function: