|
wx_BGI_Graphics
Classic BGI-compatible graphics API with modern OpenGL extension API
|
Public C API for Phase 4 (3D Solid Primitives), Phase 5 (3D Surfaces), and Phase 6 (2D→3D Extrusion) of the wx_bgi_graphics library. More...

Go to the source code of this file.
Functions | |
| BGI_API void BGI_CALL | wxbgi_dds_set_solid_draw_mode (int mode) |
| Change the draw mode on ALL solid objects currently in the DDS scene. | |
| BGI_API void BGI_CALL | wxbgi_extrude_polygon (const float *xs, const float *ys, int n_pts, float dir_x, float dir_y, float dir_z, int cap_start, int cap_end) |
| Extrude a 2-D polygon profile along a direction vector. | |
| BGI_API void BGI_CALL | wxbgi_solid_box (float cx, float cy, float cz, float width, float depth, float height) |
| Draw an axis-aligned box centred at (cx, cy, cz). | |
| BGI_API void BGI_CALL | wxbgi_solid_cone (float cx, float cy, float cz, float radius, float height, int slices, int cap) |
| Draw a Z-aligned cone. | |
| BGI_API void BGI_CALL | wxbgi_solid_cylinder (float cx, float cy, float cz, float radius, float height, int slices, int caps) |
| Draw a Z-aligned cylinder centred at (cx, cy, cz). | |
| BGI_API int BGI_CALL | wxbgi_solid_get_draw_mode (void) |
| Returns the current solid draw mode (WXBGI_SOLID_WIREFRAME or WXBGI_SOLID_SOLID). | |
| BGI_API void BGI_CALL | wxbgi_solid_set_draw_mode (int mode) |
| Set the draw mode for subsequently created solids. | |
| BGI_API void BGI_CALL | wxbgi_solid_set_edge_color (int color) |
| Set the edge colour (BGI palette index) for subsequently created solids. | |
| BGI_API void BGI_CALL | wxbgi_solid_set_face_color (int color) |
| Set the face fill colour (BGI palette index) for subsequently created solids. | |
| BGI_API void BGI_CALL | wxbgi_solid_sphere (float cx, float cy, float cz, float radius, int slices, int stacks) |
| Draw a UV sphere centred at (cx, cy, cz). | |
| BGI_API void BGI_CALL | wxbgi_solid_torus (float cx, float cy, float cz, float major_r, float minor_r, int rings, int sides) |
| Draw a torus (donut) centred at (cx, cy, cz) in the XY plane. | |
| BGI_API void BGI_CALL | wxbgi_surface_heightmap (float ox, float oy, float oz, float cell_w, float cell_h, int rows, int cols, const float *heights) |
| Draw a height-map surface. | |
| BGI_API void BGI_CALL | wxbgi_surface_parametric (float cx, float cy, float cz, int formula, float param1, float param2, int u_steps, int v_steps) |
| Draw a parametric surface. | |
Public C API for Phase 4 (3D Solid Primitives), Phase 5 (3D Surfaces), and Phase 6 (2D→3D Extrusion) of the wx_bgi_graphics library.
All functions write to the active BGI pixel buffer AND append a retained-mode DDS object to the scene graph. Call wxbgi_render_dds() to re-render the scene through a different camera.
Coordinate convention: Z-up, right-handed world space (same as the camera and UCS systems defined in wx_bgi_3d.h).
Change the draw mode on ALL solid objects currently in the DDS scene.
This is a fast in-place update (no re-render, no JSON round-trip). Useful for switching the whole scene between wireframe and filled without rebuilding geometry.
| mode | WXBGI_SOLID_WIREFRAME (0) or WXBGI_SOLID_SOLID (1). |
| BGI_API void BGI_CALL wxbgi_extrude_polygon | ( | const float * | xs, |
| const float * | ys, | ||
| int | n_pts, | ||
| float | dir_x, | ||
| float | dir_y, | ||
| float | dir_z, | ||
| int | cap_start, | ||
| int | cap_end | ||
| ) |
Extrude a 2-D polygon profile along a direction vector.
The base profile is given as separate X and Y arrays of n_pts world-space points (Z is taken as zero for each vertex). The extrusion direction (dir_x, dir_y, dir_z) also determines the extrusion length via its magnitude.
| xs,ys | Arrays of n_pts world-space X and Y coordinates. |
| n_pts | Number of profile vertices (≥3). |
| dir_x,dir_y,dir_z | Extrusion direction vector (length = depth). |
| cap_start | Non-zero → fill the base polygon. |
| cap_end | Non-zero → fill the top polygon. |
| BGI_API void BGI_CALL wxbgi_solid_box | ( | float | cx, |
| float | cy, | ||
| float | cz, | ||
| float | width, | ||
| float | depth, | ||
| float | height | ||
| ) |
Draw an axis-aligned box centred at (cx, cy, cz).
| cx | World-space X coordinate of the box centre. |
| cy | World-space Y coordinate of the box centre. |
| cz | World-space Z coordinate of the box centre. |
| width | Extent along the world X axis. |
| depth | Extent along the world Y axis. |
| height | Extent along the world Z axis. |
| BGI_API void BGI_CALL wxbgi_solid_cone | ( | float | cx, |
| float | cy, | ||
| float | cz, | ||
| float | radius, | ||
| float | height, | ||
| int | slices, | ||
| int | cap | ||
| ) |
Draw a Z-aligned cone.
Base is at (cx, cy, cz), apex at (cx, cy, cz+height).
| cx | World-space X coordinate of the cone base centre. |
| cy | World-space Y coordinate of the cone base centre. |
| cz | World-space Z coordinate of the cone base centre. |
| radius | Base radius. |
| height | Height along Z. |
| slices | Circumference subdivisions (≥3). |
| cap | Non-zero → draw the base disc cap. |
| BGI_API void BGI_CALL wxbgi_solid_cylinder | ( | float | cx, |
| float | cy, | ||
| float | cz, | ||
| float | radius, | ||
| float | height, | ||
| int | slices, | ||
| int | caps | ||
| ) |
Draw a Z-aligned cylinder centred at (cx, cy, cz).
| cx | World-space X coordinate of the cylinder centre. |
| cy | World-space Y coordinate of the cylinder centre. |
| cz | World-space Z coordinate of the cylinder centre. |
| radius | Cylinder radius. |
| height | Total height along Z. |
| slices | Circumference subdivisions (≥3). |
| caps | Non-zero → draw top and bottom disc caps. |
Returns the current solid draw mode (WXBGI_SOLID_WIREFRAME or WXBGI_SOLID_SOLID).
Set the draw mode for subsequently created solids.
| mode | WXBGI_SOLID_WIREFRAME (0) or WXBGI_SOLID_SOLID (1). |
Set the edge colour (BGI palette index) for subsequently created solids.
Set the face fill colour (BGI palette index) for subsequently created solids.
| BGI_API void BGI_CALL wxbgi_solid_sphere | ( | float | cx, |
| float | cy, | ||
| float | cz, | ||
| float | radius, | ||
| int | slices, | ||
| int | stacks | ||
| ) |
Draw a UV sphere centred at (cx, cy, cz).
| cx | World-space X coordinate of the sphere centre. |
| cy | World-space Y coordinate of the sphere centre. |
| cz | World-space Z coordinate of the sphere centre. |
| radius | Sphere radius in world units. |
| slices | Longitude subdivisions (≥3). |
| stacks | Latitude subdivisions (≥2). |
| BGI_API void BGI_CALL wxbgi_solid_torus | ( | float | cx, |
| float | cy, | ||
| float | cz, | ||
| float | major_r, | ||
| float | minor_r, | ||
| int | rings, | ||
| int | sides | ||
| ) |
Draw a torus (donut) centred at (cx, cy, cz) in the XY plane.
| cx | World-space X coordinate of the torus centre. |
| cy | World-space Y coordinate of the torus centre. |
| cz | World-space Z coordinate of the torus centre. |
| major_r | Distance from torus centre to tube centre. |
| minor_r | Tube radius. |
| rings | Segments around the main axis (≥3). |
| sides | Segments of the tube cross-section (≥3). |
| BGI_API void BGI_CALL wxbgi_surface_heightmap | ( | float | ox, |
| float | oy, | ||
| float | oz, | ||
| float | cell_w, | ||
| float | cell_h, | ||
| int | rows, | ||
| int | cols, | ||
| const float * | heights | ||
| ) |
Draw a height-map surface.
| ox,oy,oz | World-space origin at the bottom-left corner of the grid. |
| cell_w | World-unit spacing between grid columns (X direction). |
| cell_h | World-unit spacing between grid rows (Y direction). |
| rows | Number of rows in the grid (≥2). |
| cols | Number of columns in the grid (≥2). |
| heights | Row-major flat array of (rows × cols) Z values. |
| BGI_API void BGI_CALL wxbgi_surface_parametric | ( | float | cx, |
| float | cy, | ||
| float | cz, | ||
| int | formula, | ||
| float | param1, | ||
| float | param2, | ||
| int | u_steps, | ||
| int | v_steps | ||
| ) |
Draw a parametric surface.
| cx,cy,cz | Centre offset applied to all surface points. |
| formula | WXBGI_PARAM_* constant selecting the surface formula. |
| param1 | Primary shape parameter (e.g. radius for sphere/cylinder). |
| param2 | Secondary shape parameter (e.g. minor radius, height). |
| u_steps | Tessellation steps along the U parameter axis (≥2). |
| v_steps | Tessellation steps along the V parameter axis (≥2). |