GrooveStomp's 3D Software Renderer  0.1.0
graphics.h
Go to the documentation of this file.
1 /******************************************************************************
2  GrooveStomp's 3D Software Renderer
3  Copyright (c) 2019 Aaron Oman (GrooveStomp)
4 
5  File: graphics.h
6  Created: 2019-07-16
7  Updated: 2019-08-25
8  Author: Aaron Oman
9  Notice: GNU GPLv3 License
10 
11  Based off of: One Lone Coder Console Game Engine Copyright (C) 2018 Javidx9
12  This program comes with ABSOLUTELY NO WARRANTY.
13  This is free software, and you are welcome to redistribute it under certain
14  conditions; See LICENSE for details.
15  ******************************************************************************/
16 
19 
20 #ifndef GRAPHICS_VERSION
21 #define GRAPHICS_VERSION "0.1.0"
22 
23 #include "SDL2/SDL.h"
24 
25 struct triangle;
26 struct texture;
27 
43 struct graphics *
44 GraphicsInit(char *title, int width, int height, int scale);
45 
48 void
50 
56 void
58 
64 void
66 
71 void
72 GraphicsClearScreen(struct graphics *graphics, unsigned int color);
73 
74 
82 void
83 GraphicsTriangleWireframe(struct graphics *graphics, struct triangle triangle, unsigned int color);
84 
94 void
95 GraphicsTriangleSolid(struct graphics *graphics, struct triangle triangle, unsigned int color);
96 
106 void
107 GraphicsTriangleTextured(struct graphics *graphics, struct triangle tri, struct texture *texture);
108 
109 #endif // GRAPHICS_VERSION
void GraphicsDeinit(struct graphics *graphics)
De-initializes and frees memory for the given graphics object.
Definition: graphics.c:97
Triangular mesh face.
Definition: math.h:61
void GraphicsClearScreen(struct graphics *graphics, unsigned int color)
Sets all pixels in the screen to the given color.
Definition: graphics.c:129
RGBA color quad.
Definition: color.h:30
struct graphics * GraphicsInit(char *title, int width, int height, int scale)
Creates and initializes a new graphics object isntance.
Definition: graphics.c:58
Graphics state.
Definition: graphics.c:46
void GraphicsTriangleSolid(struct graphics *graphics, struct triangle triangle, unsigned int color)
Draw a triangle with the given set of x and y coordinates.
Definition: graphics.c:424
void GraphicsTriangleTextured(struct graphics *graphics, struct triangle tri, struct texture *texture)
Draw a textured triangle with the given set of x and y coordinates.
Definition: graphics.c:257
void GraphicsEnd(struct graphics *graphics)
Prepares the graphics subsystem for presentation, then presents.
Definition: graphics.c:122
void GraphicsTriangleWireframe(struct graphics *graphics, struct triangle triangle, unsigned int color)
Draw a triangle with the given set of x and y coordinates.
Definition: graphics.c:411
Structure representing a texture image.
Definition: texture.h:23
void GraphicsBegin(struct graphics *graphics)
Initializes the graphics subsystem for drawing routines.
Definition: graphics.c:118