OCRudoku
v1.0
Resolve word grid with ease
|
Functions | |
SDL_Rect | anchore_to_rect (SDL_Window *window, anchore_point anchore) |
Converts an anchore_point to an SDL_Rect based on the window size. | |
void | render_full_anchored_image_file (const char *file, SDL_Renderer *renderer, SDL_Window *window, anchore_point anchore) |
Renders an image file to the renderer using an anchore_point for positioning. | |
int | process_events (SDL_Event *event, SDL_Window *window) |
Processes SDL events and handles window events. | |
anchore_point | rect_to_anchore (SDL_Rect rect) |
Converts an SDL_Rect to an anchore_point. | |
SDL_Rect | to_positive_rect (SDL_Rect rect) |
Converts an SDL_Rect to a positive SDL_Rect. | |
anchore_point | pixel_to_pourcent_anchore (SDL_Window *window, anchore_point anch) |
Converts pixel-based anchore_point offsets to percentage-based offsets. | |
SDL_Rect | get_surface_full_rect (SDL_Surface *surface) |
Gets the full rectangle of an SDL_Surface. | |
SDL_Rect anchore_to_rect | ( | SDL_Window * | window, |
anchore_point | anchore ) |
Converts an anchore_point to an SDL_Rect based on the window size.
This function takes an anchore_point structure and converts it into an SDL_Rect structure. The conversion is based on the size of the given SDL_Window. The resulting SDL_Rect will be positioned and sized according to the anchore_point's properties.
window | A pointer to the SDL_Window from which the size will be obtained. |
anchore | The anchore_point structure containing the anchoring information. |
SDL_Rect get_surface_full_rect | ( | SDL_Surface * | surface | ) |
Gets the full rectangle of an SDL_Surface.
This function returns an SDL_Rect structure that represents the full area of the given SDL_Surface. The rectangle's position will be set to (0, 0) and its width and height will match the surface's width and height.
surface | A pointer to the SDL_Surface from which the rectangle will be obtained. |
anchore_point pixel_to_pourcent_anchore | ( | SDL_Window * | window, |
anchore_point | anch ) |
Converts pixel-based anchore_point offsets to percentage-based offsets.
This function takes an anchore_point structure with pixel-based offsets and converts them to percentage-based offsets relative to the size of the given SDL_Window. The resulting anchore_point will have its offsets expressed as percentages of the window's width and height.
window | A pointer to the SDL_Window from which the size will be obtained. |
anch | The anchore_point structure containing the pixel-based offsets. |
int process_events | ( | SDL_Event * | event, |
SDL_Window * | window ) |
Processes SDL events and handles window events.
This function processes SDL events and handles specific window events such as quitting the application and resizing the window. It returns an integer value indicating the type of event processed.
event | A pointer to the SDL_Event structure containing the event information. |
window | A pointer to the SDL_Window associated with the event. |
anchore_point rect_to_anchore | ( | SDL_Rect | rect | ) |
Converts an SDL_Rect to an anchore_point.
This function takes an SDL_Rect structure and converts it into an anchore_point structure. The conversion is based on the position and size of the given SDL_Rect. The resulting anchore_point will have its offsets set according to the SDL_Rect's properties.
rect | The SDL_Rect structure containing the rectangle information. |
void render_full_anchored_image_file | ( | const char * | file, |
SDL_Renderer * | renderer, | ||
SDL_Window * | window, | ||
anchore_point | anchore ) |
Renders an image file to the renderer using an anchore_point for positioning.
This function renders an image file to the specified SDL_Renderer. The image is positioned and sized according to the provided anchore_point structure, which is converted to an SDL_Rect based on the size of the given SDL_Window.
file | The path to the image file to be rendered. |
renderer | A pointer to the SDL_Renderer where the image will be rendered. |
window | A pointer to the SDL_Window from which the size will be obtained. |
anchore | The anchore_point structure containing the anchoring information. |
SDL_Rect to_positive_rect | ( | SDL_Rect | rect | ) |
Converts an SDL_Rect to a positive SDL_Rect.
This function takes an SDL_Rect structure and ensures that its width and height are positive values. If the width or height is negative, it adjusts the x or y position accordingly and converts the width or height to a positive value.
rect | The SDL_Rect structure to be converted. |