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

Functions

void EZ_process_drag_select (SDL_Window *window, SDL_Renderer *renderer, SDL_Event *event, EZ_INTERACTIBLE *inter, void *data)
 Processes the drag selection events for an interactible element.
 
EZ_drag_selectEZ_create_drag_select (char *select_img, SDL_Renderer *renderer, anchore_point dst_anchore)
 Creates a new EZ_drag_select structure.
 

Function Documentation

◆ EZ_create_drag_select()

EZ_drag_select * EZ_create_drag_select ( char * select_img,
SDL_Renderer * renderer,
anchore_point dst_anchore )

Creates a new EZ_drag_select structure.

This function initializes a new EZ_drag_select structure, which is used to handle drag selection within an SDL window. It loads the specified image, creates a texture from it, and sets up the drawable and interactible components of the drag selection.

Parameters
select_imgThe path to the image file used for the drag selection.
rendererThe SDL_Renderer used for rendering the selection.
dst_anchoreThe anchore_point defining the destination anchore for the drawable.
Returns
A pointer to the newly created EZ_drag_select structure.

◆ EZ_process_drag_select()

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

Processes the drag selection events for an interactible element.

This function handles the drag selection logic for an interactible element within an SDL window. It processes mouse button down, mouse motion, and mouse button up events to manage the selection rectangle and its visibility.

Parameters
windowThe SDL_Window where the drag selection is taking place.
rendererThe SDL_Renderer used for rendering the selection.
eventThe SDL_Event containing the event data.
interThe interactible element being processed.
dataA pointer to the EZ_drag_select structure containing drag selection data.