Fireset
Loading...
Searching...
No Matches
render.h
1// Copyright (c) 2025-2026 Henrique Rodrigues Santos
2// Licensed under the MIT License
3// Github: https://github.com/saintsHr/Fireset
4
5#pragma once
6
7#include <GL/gl.h>
8#include <stdint.h>
9#include "fireset/vector.h"
10#include "fireset/image.h"
11#include "fireset/color.h"
12
19typedef enum {
20 FS_DIRECTION_UP,
21 FS_DIRECTION_RIGHT,
22 FS_DIRECTION_DOWN,
23 FS_DIRECTION_LEFT
24} FsDirection;
25
31
43
55
61typedef struct{
64} FsPoint;
65
78
84typedef struct{
86 float length;
87 float angle;
88 float thickness;
90} FsLine;
91
104
121double fsLookAt(FsVec2 origin, FsVec2 target, FsDirection forward);
122
131void fsDrawPoint(const FsPoint* p, int zindex);
132
141void fsDrawLine(const FsLine* line, int zindex);
142
151void fsDrawTriangle(const FsTriangle* tri, int zindex);
152
161void fsDrawQuad(const FsQuad* quad, int zindex);
162
171void fsDrawCircle(const FsCircle* circle, int zindex);
172
185void fsDrawSprite(const FsSprite* sprite, int zindex);
186
195void fsOrthoSet(int width, int height);
196
204void fsClear(FsColor color);
205
void fsDrawTriangle(const FsTriangle *tri, int zindex)
Draws a triangle.
Definition render.c:42
double fsLookAt(FsVec2 origin, FsVec2 target, FsDirection forward)
Calculates the angle to face a target position.
Definition render.c:10
void fsDrawCircle(const FsCircle *circle, int zindex)
Draws a circle.
Definition render.c:139
void fsClear(FsColor color)
Clears the window.
Definition render.c:223
void fsDrawSprite(const FsSprite *sprite, int zindex)
Draws a 2D sprite.
Definition render.c:172
void fsOrthoSet(int width, int height)
Sets the orthographic projection.
Definition render.c:234
void fsDrawQuad(const FsQuad *quad, int zindex)
Draws a quadrilateral.
Definition render.c:113
void fsDrawLine(const FsLine *line, int zindex)
Draws a line.
Definition render.c:87
void fsDrawPoint(const FsPoint *p, int zindex)
Draws a pixel.
Definition render.c:66
Circle primitive.
Definition render.h:71
FsVec2 position
Definition render.h:72
float angle
Definition render.h:75
int segments
Definition render.h:76
FsColor color
Definition render.h:74
FsVec2 size
Definition render.h:73
RGB color representation.
Definition color.h:15
Line primitive.
Definition render.h:84
FsVec2 position
Definition render.h:85
float thickness
Definition render.h:88
FsColor color
Definition render.h:89
float length
Definition render.h:86
float angle
Definition render.h:87
Point primitive.
Definition render.h:61
FsVec2 position
Definition render.h:62
FsColor color
Definition render.h:63
Quadrilateral primitive.
Definition render.h:37
float angle
Definition render.h:41
FsVec2 position
Definition render.h:38
FsColor color
Definition render.h:40
FsVec2 size
Definition render.h:39
Sprite structure.
Definition render.h:97
int texRot
Definition render.h:102
FsVec2 position
Definition render.h:98
FsTexture * texture
Definition render.h:100
FsVec2 size
Definition render.h:99
float angle
Definition render.h:101
Texture data structure.
Definition image.h:26
Triangle primitive.
Definition render.h:49
FsVec2 size
Definition render.h:51
FsColor color
Definition render.h:52
float angle
Definition render.h:53
FsVec2 position
Definition render.h:50
2D vector.
Definition vector.h:18