#include "../color.h"
#include "../gapi.h"
#include "../position.h"
#include "./position.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
◆ _gm3_depth_compare()
| int _gm3_depth_compare |
( |
const void * | a, |
|
|
const void * | b ) |
◆ gm3_draw_image()
| int gm3_draw_image |
( |
gm3Image * | img, |
|
|
double | x, |
|
|
double | y, |
|
|
double | scale ) |
Draws the projected 3D scene contained within a gm3Image onto the screen.
This function sorts the projected triangles by depth (Painter's Algorithm) and then calls the gapi_draw_triangles function to render them.
- Parameters
-
| img | Pointer to the gm3Image containing the projected scene data. |
| x | The X-offset for drawing the entire image. |
| y | The Y-offset for drawing the entire image. |
| scale | The scaling factor to apply to the projected image. |
- Returns
- 1 on successful drawing, 0 if no triangles to draw, -1 on memory allocation failure.
◆ gm3_image_free()
Call this when you are completely done with the image object and want to release memory to the OS.