embedded-software
reusable software modules for embedded systems
|
#include "render_engine.h"
#include <math.h>
#include <stdlib.h>
#include "subsystem.h"
#include "uart.h"
#include "terminal.h"
Macros | |
#define | M_PI 3.14159265358979323846 |
Functions | |
point_t | pointToScreen (vector_t delta, rounding_t camHAngle, rounding_t camVAngle, rounding_t angleHPixel, rounding_t angleVPixel, uint8_t halfWidth, uint8_t halfHeight) |
rounding_t | dotProduct (vector_t a, vector_t b) |
int | compareTriangles (const void *a, const void *b) |
void | paintPixel (framebuffer_t *frame, uint16_t x, uint16_t y, uint8_t color) |
void | paintPixelf (framebuffer_t *frame, rounding_t x, rounding_t y, uint8_t color) |
void | changeTerminalCursorLocation (uint8_t channel, uint8_t x, uint8_t y) |
void | writeTerminalNumber (uint8_t channel, uint8_t number) |
void | changeTerminalColor (uint8_t channel, uint8_t color) |
void | writeTerminalBlock (uint8_t channel, uint8_t data) |
void | Render_Engine_RenderFrame (world_t *world, camera_t *camera, framebuffer_t *frame) |
Render a frame. More... | |
void | Render_Engine_DisplayFrame (uint8_t channel, framebuffer_t *frame) |
Display a frame. More... | |
#define M_PI 3.14159265358979323846 |
void changeTerminalColor | ( | uint8_t | channel, |
uint8_t | color | ||
) |
void changeTerminalCursorLocation | ( | uint8_t | channel, |
uint8_t | x, | ||
uint8_t | y | ||
) |
int compareTriangles | ( | const void * | a, |
const void * | b | ||
) |
rounding_t dotProduct | ( | vector_t | a, |
vector_t | b | ||
) |
void paintPixel | ( | framebuffer_t * | frame, |
uint16_t | x, | ||
uint16_t | y, | ||
uint8_t | color | ||
) |
void paintPixelf | ( | framebuffer_t * | frame, |
rounding_t | x, | ||
rounding_t | y, | ||
uint8_t | color | ||
) |
point_t pointToScreen | ( | vector_t | delta, |
rounding_t | camHAngle, | ||
rounding_t | camVAngle, | ||
rounding_t | angleHPixel, | ||
rounding_t | angleVPixel, | ||
uint8_t | halfWidth, | ||
uint8_t | halfHeight | ||
) |
void Render_Engine_DisplayFrame | ( | uint8_t | channel, |
framebuffer_t * | framebuffer | ||
) |
Display a frame.
Output the contents of a framebuffer over a UART channel. Before writing, this function makes sure the UART buffer is empty. As there is so much data sent over UART, buffers get in the way of operation. This directly accesses the HAL UART code to get around the buffer of the UART code. This method is blocking during the writing process.
channel | UART channel to output the framebuffer over. |
framebuffer | Framebuffer to display on the console. |
void Render_Engine_RenderFrame | ( | world_t * | world, |
camera_t * | camera, | ||
framebuffer_t * | framebuffer | ||
) |
Render a frame.
Renders a frame of data based on a list of triangles in the world object. Make sure the array in the framebuffer has been created as this will not create the needed array for you. This method is blocking during the rendering process.
world | World data that contains the list of triangles in 3D space to render. |
camera | Camera data that contains the location and direction of the camera. |
framebuffer | Output of the rendering process populates an existing framebuffer. |
void writeTerminalBlock | ( | uint8_t | channel, |
uint8_t | data | ||
) |
void writeTerminalNumber | ( | uint8_t | channel, |
uint8_t | number | ||
) |