The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
Loading...
Searching...
No Matches
triangle_renderer Struct Reference

Functor for rendering triangle shapes. More...

#include <renderers.hpp>

Public Member Functions

void operator() (SDL_Renderer *renderer, float pos_x, float pos_y, float size, SDL_Color color) const
 Renders a triangle shape at the specified position.
 

Detailed Description

Functor for rendering triangle shapes.

This struct provides an operator to render filled triangles at specified positions

Member Function Documentation

◆ operator()()

void triangle_renderer::operator() ( SDL_Renderer * renderer,
float pos_x,
float pos_y,
float size,
SDL_Color color ) const

Renders a triangle shape at the specified position.

Parameters
rendererThe SDL renderer used for drawing
pos_xThe x coordinate of the triangle's center
pos_yThe y coordinate of the triangle's center
sizeThe size of the triangle (height)
colorThe color to fill the triangle with

Uses scan-line algorithm to fill the triangle efficiently.

Parameters
rendererThe SDL renderer used for drawing
pos_xThe x coordinate of the triangle's center
pos_yThe y coordinate of the triangle's center
sizeThe size of the triangle (height)
colorThe color to fill the triangle with

The documentation for this struct was generated from the following files: