0.3.1
Rendering

Files

file  mic3d.h
 

Data Structures

struct  sort_list
 Not yet documented. More...
 
union  indices
 Not yet documented. More...
 
struct  flags
 Not yet documented. More...
 
struct  polygon
 Not yet documented. More...
 
struct  attribute
 Not yet documented. More...
 
struct  mesh
 Not yet documented. More...
 
struct  indices.__unnamed140__
 Not yet documented. More...
 
union  attribute.control
 Not yet documented. More...
 
struct  attribute.control.__unnamed143__
 Not yet documented. More...
 

Typedefs

typedef enum render_flags render_flags_t
 Not yet documented.
 
typedef uint16_t texture_slot_t
 Not yet documented.
 
typedef uint16_t gst_slot_t
 Not yet documented.
 
typedef struct sort_list sort_list_t
 Not yet documented.
 
typedef enum sort_type sort_type_t
 Not yet documented.
 
typedef enum read_dir read_dir_t
 Not yet documented.
 
typedef enum plane_type plane_type_t
 Not yet documented.
 
typedef enum command_type command_type_t
 Not yet documented.
 
typedef enum link_type link_type_t
 Not yet documented.
 
typedef union indices indices_t
 Not yet documented.
 
typedef struct flags flags_t
 Not yet documented.
 
typedef struct polygon polygon_t
 Not yet documented.
 
typedef struct attribute attribute_t
 Not yet documented.
 
typedef struct mesh mesh_t
 Not yet documented.
 

Enumerations

enum  render_flags
 Not yet documented. More...
 
enum  sort_type
 Not yet documented. More...
 
enum  read_dir
 Not yet documented. More...
 
enum  plane_type
 Not yet documented. More...
 
enum  command_type
 Not yet documented. More...
 
enum  link_type
 Not yet documented. More...
 

Functions

void render_enable (render_flags_t flags)
 Enable render flag(s).
 
void render_disable (render_flags_t flags)
 Disable render flag(s).
 
void render_flags_set (render_flags_t flags)
 Set flag(s).
 
void render_perspective_set (angle_t fov_angle)
 Set the perspective horizontal FOV angle.
 
void render_orthographic_set (fix16_t scale)
 Set the size of the orthographic view.
 
void render_isometric_set (angle_t view_angle)
 Set the isometric view angle.
 
void render_near_level_set (uint32_t level)
 Set the position of the near plane using a level value.
 
void render_far_level_set (uint32_t level)
 Set the position of the far plane using a level value.
 
void render_sort_depth_set (sort_list_t *sort_list_buffer, uint16_t count)
 Set the sort list buffer and sort depth.
 
void render_start (void)
 Start rendering.
 
void render_end (void)
 End rendering.
 
void render_matrix_calculate (const fix16_mat43_t *world_matrix, fix16_mat43_t *view_matrix)
 Calculate the view matrix given a world matrix.
 
void render_mesh_xform (const mesh_t *mesh, const fix16_mat43_t *world_matrix)
 Render a mesh_t.
 
void render_cmdt_insert (const vdp1_cmdt_t *cmdt, fix16_t depth_z)
 Insert a vdp1_cmdt_t at a depth.
 
void render_cmdt_nocheck_insert (const vdp1_cmdt_t *cmdt, fix16_t depth_z)
 Insert a vdp1_cmdt_t at a depth.
 
vdp1_cmdt_trender_cmdts_alloc (uint32_t count)
 Not yet documented.
 
void render_points_xform (const fix16_mat43_t *world_matrix, const fix16_vec3_t *points, uint32_t count, xformed_point_t *xformed_points)
 Transform points.
 
void render_debug_log (char *buffer, size_t len)
 Not yet documented.
 

Detailed Description


Data Structure Documentation

◆ sort_list

struct sort_list

Not yet documented.

Data Fields
uint16_t head Not yet documented.

◆ indices

union indices

Not yet documented.

Data Fields
struct indices.__unnamed140__ __unnamed__ Not yet documented.
uint16_t p[4] Not yet documented.

◆ flags

struct flags

Not yet documented.

Data Fields
sort_type_t sort_type:3 Not yet documented.
plane_type_t plane_type:1 Not yet documented.
bool use_texture:1 Not yet documented.

◆ polygon

struct polygon

Not yet documented.

Data Fields
flags_t flags Not yet documented.
indices_t indices Not yet documented.

◆ attribute

struct attribute

Not yet documented.

Data Fields
union attribute.control control Not yet documented.
vdp1_cmdt_draw_mode_t draw_mode Not yet documented.
vdp1_cmdt_color_t color Not yet documented.
texture_slot_t texture_slot Not yet documented.
gst_slot_t shading_slot Not yet documented.

◆ mesh

struct mesh

Not yet documented.

Data Fields
const fix16_vec3_t * points Not yet documented.
uint32_t points_count Not yet documented.
const fix16_vec3_t * normals Not yet documented.
const polygon_t * polygons Not yet documented.
const attribute_t * attributes Not yet documented.
uint32_t polygons_count Not yet documented.

◆ indices.__unnamed140__

struct indices.__unnamed140__

Not yet documented.

Data Fields
uint16_t p0 Not yet documented.
uint16_t p1 Not yet documented.
uint16_t p2 Not yet documented.
uint16_t p3 Not yet documented.

◆ attribute.control

union attribute.control

Not yet documented.

Data Fields
struct attribute.control.__unnamed143__ __unnamed__ Not yet documented.
uint16_t raw Not yet documented.

◆ attribute.control.__unnamed143__

struct attribute.control.__unnamed143__

Not yet documented.

Data Fields
link_type_t link_type:3 Not yet documented.
read_dir_t read_dir:2 Not yet documented.
command_type_t command:4 Not yet documented.

Enumeration Type Documentation

◆ render_flags

Not yet documented.

Enumerator
RENDER_FLAGS_NONE 

Not yet documented.

RENDER_FLAGS_LIGHTING 

Not yet documented.

RENDER_FLAGS_NO_CLEAR 

Not yet documented.

RENDER_FLAGS_ALL 

Not yet documented.

◆ sort_type

enum sort_type

Not yet documented.

Enumerator
SORT_TYPE_BFR 

Not yet documented.

SORT_TYPE_MIN 

Not yet documented.

SORT_TYPE_MAX 

Not yet documented.

SORT_TYPE_CENTER 

Not yet documented.

◆ read_dir

enum read_dir

Not yet documented.

Enumerator
READ_DIR_NORMAL 

Not yet documented.

READ_DIR_H 

Not yet documented.

READ_DIR_V 

Not yet documented.

READ_DIR_HV 

Not yet documented.

◆ plane_type

enum plane_type

Not yet documented.

Enumerator
PLANE_TYPE_SINGLE 

Not yet documented.

PLANE_TYPE_DOUBLE 

Not yet documented.

◆ command_type

Not yet documented.

Enumerator
COMMAND_TYPE_SPRITE 

Not yet documented.

COMMAND_TYPE_SCALED_SPRITE 

Not yet documented.

COMMAND_TYPE_DISTORTED_SPRITE 

Not yet documented.

COMMAND_TYPE_POLYGON 

Not yet documented.

COMMAND_TYPE_POLYLINE 

Not yet documented.

COMMAND_TYPE_LINE 

Not yet documented.

◆ link_type

enum link_type

Not yet documented.

Enumerator
LINK_TYPE_JUMP_NEXT 

Not yet documented.

LINK_TYPE_JUMP_ASSIGN 

Not yet documented.

LINK_TYPE_JUMP_CALL 

Not yet documented.

LINK_TYPE_JUMP_RETURN 

Not yet documented.

LINK_TYPE_SKIP_NEXT 

Not yet documented.

LINK_TYPE_SKIP_ASSIGN 

Not yet documented.

LINK_TYPE_SKIP_CALL 

Not yet documented.

LINK_TYPE_SKIP_RETURN 

Not yet documented.

Function Documentation

◆ render_enable()

void render_enable ( render_flags_t  flags)

Enable render flag(s).

Equivalent to setting flags (bitwise OR).

Parameters
flags
See also
render_start
render_mesh_xform
render_end

◆ render_disable()

void render_disable ( render_flags_t  flags)

Disable render flag(s).

Equivalent to clearing flags (bitwise AND with flags negated).

Parameters
flags

◆ render_flags_set()

void render_flags_set ( render_flags_t  flags)

Set flag(s).

Equivalent to assigment of flags.

Parameters
flags

◆ render_perspective_set()

void render_perspective_set ( angle_t  fov_angle)

Set the perspective horizontal FOV angle.

This is the full horizontal field of view angle.

Parameters
fov_angle
See also
camera_type_set

◆ render_orthographic_set()

void render_orthographic_set ( fix16_t  scale)

Set the size of the orthographic view.

Scale the orthographic view. Typically this would be a large value like 10 to 20.

Parameters
scale
See also
camera_type_set

◆ render_isometric_set()

void render_isometric_set ( angle_t  view_angle)

Set the isometric view angle.

Typically 45 degrees.

Parameters
view_angle
See also
camera_type_set

◆ render_near_level_set()

void render_near_level_set ( uint32_t  level)

Set the position of the near plane using a level value.

level ranges from 0 to 7. Not yet fully documented.

Parameters
level

◆ render_far_level_set()

void render_far_level_set ( uint32_t  level)

Set the position of the far plane using a level value.

level ranges from 0 to 7. Not yet fully documented.

Parameters
level

◆ render_sort_depth_set()

void render_sort_depth_set ( sort_list_t sort_list_buffer,
uint16_t  count 
)

Set the sort list buffer and sort depth.

Required. Set the sort depth.

Parameters
sort_list_buffer
count
See also
render_mesh_xform

◆ render_start()

void render_start ( void  )

Start rendering.

Must be called before calling render_mesh_xform.

◆ render_end()

void render_end ( void  )

End rendering.

Must be called after rendering. After, you can call vdp1_sync_render, then vdp1_sync.

void render_start(void)
Start rendering.
void render_mesh_xform(const mesh_t *mesh, const fix16_mat43_t *world_matrix)
Render a mesh_t.
void render_end(void)
End rendering.
void vdp1_sync_render(void)
Not yet documented.
void vdp1_sync_wait(void)
Not yet documented.
void vdp1_sync(void)
Not yet documented.

◆ render_matrix_calculate()

void render_matrix_calculate ( const fix16_mat43_t world_matrix,
fix16_mat43_t view_matrix 
)

Calculate the view matrix given a world matrix.

Calculate the view matrix using the camera and world matrix.

Parameters
[in]world_matrix
[out]view_matrix
See also
camera_lookat
camera_moveto

◆ render_mesh_xform()

void render_mesh_xform ( const mesh_t mesh,
const fix16_mat43_t world_matrix 
)

Render a mesh_t.

The workhorse of Mic3D. Given a world_matrix, render a mesh. Must be called after render_start.

Parameters
[in]mesh
[in]world_matrix
See also
render_start
render_end

◆ render_cmdt_insert()

void render_cmdt_insert ( const vdp1_cmdt_t cmdt,
fix16_t  depth_z 
)

Insert a vdp1_cmdt_t at a depth.

Recall that the depth is negative. render_cmdt_insert will cull if the cmdt is inserted outside the frustrum.

Parameters
[in]cmdt
depth_z
See also
render_cmdt_nocheck_insert

◆ render_cmdt_nocheck_insert()

void render_cmdt_nocheck_insert ( const vdp1_cmdt_t cmdt,
fix16_t  depth_z 
)

Insert a vdp1_cmdt_t at a depth.

Recall that the depth is negative. The difference is that no frustrum checks will be performed.

Parameters
[in]cmdt
depth_z
See also
render_cmdt_insert

◆ render_cmdts_alloc()

vdp1_cmdt_t * render_cmdts_alloc ( uint32_t  count)

Not yet documented.

Warning
Not yet implemented.
Parameters
count
Returns
Not yet documented.

◆ render_points_xform()

void render_points_xform ( const fix16_mat43_t world_matrix,
const fix16_vec3_t points,
uint32_t  count,
xformed_point_t xformed_points 
)

Transform points.

Given a world_matrix, a set of count points, transform them (depending on the camera,

See also
camera_type_set) into xformed_points.
Parameters
[in]world_matrix
[in]points
count
[out]xformed_points

◆ render_debug_log()

void render_debug_log ( char *  buffer,
size_t  len 
)

Not yet documented.

Parameters
buffer
len
Warning
Not yet implemented.