Loading...
Searching...
No Matches
rectangle.c
Go to the documentation of this file.
#include "arc/graphics/rectangle.h"
#include "renderer.h"
#include <stdlib.h>
void ARC_Rect_Render(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){
SDL_SetRenderDrawColor((SDL_Renderer *)renderer, color->r, color->g, color->b, color->a);
SDL_RenderDrawRect((SDL_Renderer *)renderer, (SDL_Rect *) rect);
}
void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){
SDL_SetRenderDrawColor((SDL_Renderer *)renderer, color->r, color->g, color->b, color->a);
SDL_RenderFillRect((SDL_Renderer *)renderer, (SDL_Rect *) rect);
}
void ARC_FRect_Render(ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color){
ARC_Rect casted = ARC_FRect_CastToRect(rect);
ARC_Rect_Render(&casted, renderer, color);
}
void ARC_FRect_RenderFill(ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color){
ARC_Rect casted = ARC_FRect_CastToRect(rect);
ARC_Rect_RenderFill(&casted, renderer, color);
}
rectangle.h
ARC_Rect_Render
void ARC_Rect_Render(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color)
Definition rectangle.c:5
ARC_Rect_RenderFill
void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color)
Definition rectangle.c:10
ARC_Renderer
struct ARC_RendererType ARC_Renderer
Definition renderer.h:16
ARC_FRect_CastToRect
ARC_Rect ARC_FRect_CastToRect(ARC_FRect *rect)
casts FRect to Rect
Definition rectangle.c:25
ARC_FRect_Render
void ARC_FRect_Render(ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color)
Definition rectangle.c:15
ARC_FRect_RenderFill
void ARC_FRect_RenderFill(ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color)
Definition rectangle.c:20
renderer.h
ARC_Color
Definition color.h:10
ARC_Color::a
uint8_t a
Definition color.h:11
ARC_Color::r
uint8_t r
Definition color.h:11
ARC_Color::b
uint8_t b
Definition color.h:11
ARC_Color::g
uint8_t g
Definition color.h:11
ARC_FRect
Definition rectangle.h:26
ARC_Rect
Definition rectangle.h:12