OCRudoku  v1.0
Resolve word grid with ease
Loading...
Searching...
No Matches
EZ_manager.h File Reference
#include <SDL2/SDL.h>
Include dependency graph for EZ_manager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void EZ_process_events (SDL_Window *window, SDL_Renderer *renderer, char *flags)
 Processes all pending events for the application.
 
void EZ_draw_menu (SDL_Window *window, SDL_Renderer *renderer)
 Draws the current menu on the screen.
 
int EZ_select_menu (int selected_menu)
 Selects a menu to be the current menu.
 
void EZ_unload_menus (void)
 Unloads all menus and frees associated resources.
 

Variables

EZ_MENUEZ_menus [3]
 

Function Documentation

◆ EZ_draw_menu()

void EZ_draw_menu ( SDL_Window * window,
SDL_Renderer * renderer )

Draws the current menu on the screen.

This function checks if the current menu index is within the valid range and if the current menu's drawable elements are visible. It then sets the render draw color to the background color of the current menu and clears the renderer. After that, it iterates through all drawable elements of the current menu, sets their respective colors, and renders them to the screen.

Parameters
windowA pointer to the SDL_Window.
rendererA pointer to the SDL_Renderer.
Exceptions
Ifthe current_menu index is out of range, the function will terminate the program with an error message.

◆ EZ_process_events()

void EZ_process_events ( SDL_Window * window,
SDL_Renderer * renderer,
char * flags )

Processes all pending events for the application.

This function polls for all pending SDL events and processes them accordingly. It handles window events, such as closing the window, and sends other events to the current menu for further processing.

Parameters
windowA pointer to the SDL_Window.
rendererA pointer to the SDL_Renderer.
flagsA pointer to a char flag that can be set to indicate certain states, such as when the window is requested to be closed.

◆ EZ_select_menu()

int EZ_select_menu ( int selected_menu)

Selects a menu to be the current menu.

This function sets the current menu to the menu specified by the selected_menu index. It ensures that the selected_menu index is within the valid range of available menus.

Parameters
selected_menuThe index of the menu to be selected.
Returns
Returns 1 if the menu was successfully selected, 0 if the selected_menu index is out of range.

◆ EZ_unload_menus()

void EZ_unload_menus ( void )

Unloads all menus and frees associated resources.

This function iterates through all menus in the EZ_menus array and calls their respective unload_menu function if it is not NULL. This ensures that any resources allocated for the menus are properly released.

Variable Documentation

◆ EZ_menus

EZ_MENU* EZ_menus[3]
extern