embedded-software
reusable software modules for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
render_engine.c File Reference
#include "render_engine.h"
#include <math.h>
#include <stdlib.h>
#include "subsystem.h"
#include "uart.h"
#include "terminal.h"
Include dependency graph for render_engine.c:

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...
 

Macro Definition Documentation

#define M_PI   3.14159265358979323846

Function Documentation

void changeTerminalColor ( uint8_t  channel,
uint8_t  color 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void changeTerminalCursorLocation ( uint8_t  channel,
uint8_t  x,
uint8_t  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int compareTriangles ( const void *  a,
const void *  b 
)

Here is the caller graph for this function:

rounding_t dotProduct ( vector_t  a,
vector_t  b 
)

Here is the caller graph for this function:

void paintPixel ( framebuffer_t frame,
uint16_t  x,
uint16_t  y,
uint8_t  color 
)

Here is the caller graph for this function:

void paintPixelf ( framebuffer_t frame,
rounding_t  x,
rounding_t  y,
uint8_t  color 
)

Here is the call graph for this function:

Here is the caller graph for this function:

point_t pointToScreen ( vector_t  delta,
rounding_t  camHAngle,
rounding_t  camVAngle,
rounding_t  angleHPixel,
rounding_t  angleVPixel,
uint8_t  halfWidth,
uint8_t  halfHeight 
)

Here is the caller graph for this function:

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.

Parameters
channelUART channel to output the framebuffer over.
framebufferFramebuffer to display on the console.

Here is the call graph for this function:

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.

Parameters
worldWorld data that contains the list of triangles in 3D space to render.
cameraCamera data that contains the location and direction of the camera.
framebufferOutput of the rendering process populates an existing framebuffer.

Here is the call graph for this function:

void writeTerminalBlock ( uint8_t  channel,
uint8_t  data 
)

Here is the caller graph for this function:

void writeTerminalNumber ( uint8_t  channel,
uint8_t  number 
)

Here is the call graph for this function:

Here is the caller graph for this function: