OCRudoku  v1.0
Resolve word grid with ease
Loading...
Searching...
No Matches
EZ_button.c File Reference
#include <err.h>
#include "EZ_button.h"
Include dependency graph for EZ_button.c:

Functions

void EZ_process_button (SDL_Window *window, SDL_Renderer *renderer, SDL_Event *event, EZ_INTERACTIBLE *inter, void *data)
 Processes button events for an EZ_button.
 
EZ_buttonEZ_create_button (char *back_img, SDL_Renderer *renderer, anchore_point dst_anchore)
 Creates an EZ_button with the specified background image and anchoring point.
 

Function Documentation

◆ EZ_create_button()

EZ_button * EZ_create_button ( char * back_img,
SDL_Renderer * renderer,
anchore_point dst_anchore )

Creates an EZ_button with the specified background image and anchoring point.

This function loads an image from the specified file path, creates an SDL texture from it, and initializes an EZ_button structure with the given renderer and anchoring point.

Parameters
back_imgThe file path to the background image for the button.
rendererThe SDL_Renderer used for rendering the button.
dst_anchoreThe anchoring point for the button.
Returns
A pointer to the newly created EZ_button.

◆ EZ_process_button()

void EZ_process_button ( SDL_Window * window,
SDL_Renderer * renderer,
SDL_Event * event,
EZ_INTERACTIBLE * inter,
void * data )

Processes button events for an EZ_button.

This function handles SDL mouse button events for an EZ_button. It checks if the left mouse button is pressed down or released while over the button, and triggers the appropriate callbacks if set.

Parameters
windowThe SDL_Window where the button is rendered.
rendererThe SDL_Renderer used for rendering.
eventThe SDL_Event containing the event data.
interThe EZ_INTERACTIBLE associated with the button.
dataA pointer to the EZ_button data.