Fireset
Loading...
Searching...
No Matches
render.h
1// Copyright (c) 2025 Henrique Rodrigues Santos
2// Licensed under the MIT License
3// Repo: https://github.com/saintsHr/Fireset
4
5#pragma once
6
7#include <GL/gl.h>
8#include <stdint.h>
9#include "fireset/vertex.h"
10#include "fireset/image.h"
11
17
24typedef struct{
25 uint8_t r;
26 uint8_t g;
27 uint8_t b;
28}FsColor;
29
41
53
63
76
82typedef struct{
84 float length;
85 float angle;
86 float thickness;
88}FsLine;
89
101
109void fsDrawPixel(const FsPoint* p);
110
118void fsDrawLine(const FsLine* line);
119
127void fsDrawTriangle(const FsTriangle* tri);
128
136void fsDrawQuad(const FsQuad* quad);
137
145void fsDrawCircle(const FsCircle* circle);
146
158void fsDrawSprite(const FsSprite* sprite);
159
168void fsOrthoSet(int width, int height);
169
177void fsClear(FsColor color);
178
188FsColor FsColor_new(uint8_t r, uint8_t g, uint8_t b);
189
void fsDrawSprite(const FsSprite *sprite)
Draws a 2D sprite.
Definition render.c:115
void fsDrawPixel(const FsPoint *p)
Draws a pixel.
Definition render.c:28
void fsClear(FsColor color)
Clears the window.
Definition render.c:142
void fsDrawCircle(const FsCircle *circle)
Draws a circle.
Definition render.c:87
void fsDrawTriangle(const FsTriangle *tri)
Draws a triangle.
Definition render.c:9
void fsDrawQuad(const FsQuad *quad)
Draws a quadrilateral.
Definition render.c:65
void fsDrawLine(const FsLine *line)
Draws a line.
Definition render.c:44
void fsOrthoSet(int width, int height)
Sets the orthographic projection.
Definition render.c:153
FsColor FsColor_new(uint8_t r, uint8_t g, uint8_t b)
Creates a color.
Definition render.c:161
Circle primitive.
Definition render.h:69
FsVec2 position
Definition render.h:70
float angle
Definition render.h:73
int segments
Definition render.h:74
FsColor color
Definition render.h:72
FsVec2 size
Definition render.h:71
RGB color representation.
Definition render.h:24
uint8_t b
Definition render.h:27
uint8_t r
Definition render.h:25
uint8_t g
Definition render.h:26
Line primitive.
Definition render.h:82
FsVec2 position
Definition render.h:83
float thickness
Definition render.h:86
FsColor color
Definition render.h:87
float length
Definition render.h:84
float angle
Definition render.h:85
Point primitive.
Definition render.h:59
FsVec2 position
Definition render.h:60
FsColor color
Definition render.h:61
Quadrilateral primitive.
Definition render.h:35
float angle
Definition render.h:39
FsVec2 position
Definition render.h:36
FsColor color
Definition render.h:38
FsVec2 size
Definition render.h:37
Sprite structure.
Definition render.h:95
FsVec2 position
Definition render.h:96
FsTexture * texture
Definition render.h:98
FsVec2 size
Definition render.h:97
float angle
Definition render.h:99
Texture data structure.
Definition image.h:22
Triangle primitive.
Definition render.h:47
FsVec2 size
Definition render.h:49
FsColor color
Definition render.h:50
float angle
Definition render.h:51
FsVec2 position
Definition render.h:48
2D vector.
Definition vertex.h:20