Gama C Library
Gama C API Documentation
gm3Image Struct Reference

Structure representing the 2D projected output of a 3D scene. More...

#include <image.h>

Data Fields

gmPosvertices
gmColorcolors
size_t * triangles
double * depths
size_t n_vertices
size_t n_colors
size_t n_triangles
size_t cap_vertices
size_t cap_colors
size_t cap_triangles
size_t cap_depths
struct { 
   gm3Pos *   world_verts 
   size_t   cap_world 
   void *   sort_buf 
   size_t   cap_sort 
   double *   tri 
   gmColor *   cols 
   size_t   cap_tri 
_internal

Detailed Description

Structure representing the 2D projected output of a 3D scene.

This struct acts as a buffer containing the 2D screen-space coordinates, colors, and indices of triangles generated by the 3D projection pipeline. It also manages internal scratch buffers for optimization.

Field Documentation

◆ [struct]

struct { ... } gm3Image::_internal

Internal scratch buffers for rendering optimizations.

◆ cap_colors

size_t gm3Image::cap_colors

Allocated capacity for colors array.

◆ cap_depths

size_t gm3Image::cap_depths

Allocated capacity for depths array.

◆ cap_sort

size_t gm3Image::cap_sort

Allocated capacity for sort_buf.

◆ cap_tri

size_t gm3Image::cap_tri

Allocated capacity for tri and cols.

◆ cap_triangles

size_t gm3Image::cap_triangles

Allocated capacity for triangles (indices) array.

◆ cap_vertices

size_t gm3Image::cap_vertices

Allocated capacity for vertices array.

◆ cap_world

size_t gm3Image::cap_world

Allocated capacity for world_verts.

◆ colors

gmColor* gm3Image::colors

Array of colors, one per triangle.

◆ cols

gmColor* gm3Image::cols

Temp storage for sorted triangle colors.

◆ depths

double* gm3Image::depths

Array of average Z-depths, one per triangle, used for sorting.

◆ n_colors

size_t gm3Image::n_colors

Current number of colors stored (should match n_triangles).

◆ n_triangles

size_t gm3Image::n_triangles

Current number of triangles stored.

◆ n_vertices

size_t gm3Image::n_vertices

Current number of vertices stored.

◆ sort_buf

void* gm3Image::sort_buf

Temp storage for sorting triangles by depth.

◆ tri

double* gm3Image::tri

Temp storage for sorted triangle vertex data (x1,y1,x2,y2,x3,y3).

◆ triangles

size_t* gm3Image::triangles

Array of vertex indices, 3 per triangle.

◆ vertices

gmPos* gm3Image::vertices

Array of 2D screen-space vertex positions.

◆ world_verts

gm3Pos* gm3Image::world_verts

Temp storage for 3D world coordinates before projection.


The documentation for this struct was generated from the following file: