Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
circle.h File Reference
#include <SDL.h>
#include <vec2.h>

Go to the source code of this file.

Functions

void DrawFilledCircle (Vec2 center, int radius, SDL_Color color)
 
bool IsRectOverlappingCircle (SDL_Rect rect, Vec2 circleCenter, float radius)
 
SDL_Texture * CreateCircleTexture (int radius, SDL_Color color)
 
void DrawCircleOutline (Vec2 center, int radius, SDL_Color color)
 Draws an unfilled circle directly to the renderer.
 
SDL_Texture * CreateCircleOutlineTexture (int radius, SDL_Color color, int thickness)
 Creates a texture containing an unfilled circle.
 
SDL_Texture * CreateHalfCircleOutlineTexture (int radius, Vec2 direction, SDL_Color color, int thickness)
 Creates a texture containing an unfilled half-circle outline oriented in a specific direction.
 
void DrawFilledHalfCircle (Vec2 center, int radius, Vec2 direction, SDL_Color color)
 Draws a filled half-circle in a specified direction.
 
SDL_Texture * CreateHalfCircleTexture (int radius, Vec2 direction, SDL_Color color)
 Creates a half-circle texture oriented in the specified direction.
 

Function Documentation

◆ CreateCircleOutlineTexture()

SDL_Texture * CreateCircleOutlineTexture ( int  radius,
SDL_Color  color,
int  thickness 
)

Creates a texture containing an unfilled circle.

Parameters
radiusRadius of the circle
colorColor of the circle outline
thicknessLine thickness (1 for thin outline)
Returns
SDL_Texture* containing the circle outline

◆ CreateCircleTexture()

SDL_Texture * CreateCircleTexture ( int  radius,
SDL_Color  color 
)

◆ CreateHalfCircleOutlineTexture()

SDL_Texture * CreateHalfCircleOutlineTexture ( int  radius,
Vec2  direction,
SDL_Color  color,
int  thickness 
)

Creates a texture containing an unfilled half-circle outline oriented in a specific direction.

Parameters
radiusRadius of the half-circle
directionDirection vector determining the orientation
colorColor of the half-circle outline
thicknessLine thickness (1 for thin outline)
Returns
SDL_Texture* containing the half-circle outline

◆ CreateHalfCircleTexture()

SDL_Texture * CreateHalfCircleTexture ( int  radius,
Vec2  direction,
SDL_Color  color 
)

Creates a half-circle texture oriented in the specified direction.

Parameters
radiusRadius of the half-circle
directionDirection vector determining the orientation
colorColor of the half-circle
Returns
SDL_Texture* containing the half-circle

◆ DrawCircleOutline()

void DrawCircleOutline ( Vec2  center,
int  radius,
SDL_Color  color 
)

Draws an unfilled circle directly to the renderer.

Parameters
centerCenter position of the circle
radiusRadius of the circle
colorColor of the circle outline

◆ DrawFilledCircle()

void DrawFilledCircle ( Vec2  center,
int  radius,
SDL_Color  color 
)

◆ DrawFilledHalfCircle()

void DrawFilledHalfCircle ( Vec2  center,
int  radius,
Vec2  direction,
SDL_Color  color 
)

Draws a filled half-circle in a specified direction.

Renders a half-circle filled with the specified color, oriented in the direction provided by the direction vector.

Parameters
centerCenter position of the half-circle
radiusRadius of the half-circle
directionDirection vector determining the orientation
colorColor of the half-circle

◆ IsRectOverlappingCircle()

bool IsRectOverlappingCircle ( SDL_Rect  rect,
Vec2  circleCenter,
float  radius 
)