Clipped software rasterization pipeline for lines and filled triangles. More...
#include <mxvk/include/mxvk/mxvk_math.h>
Public Types | |
| enum | LINE_CODE { CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 , CODE_E = 0x0002 , CODE_W = 0x0001 , CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 , CODE_E = 0x0002 , CODE_W = 0x0001 } |
| Cohen-Sutherland region codes for line clipping. More... | |
| enum | LINE_CODE { CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 , CODE_E = 0x0002 , CODE_W = 0x0001 , CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 , CODE_E = 0x0002 , CODE_W = 0x0001 } |
| Cohen-Sutherland region codes for line clipping. More... | |
Public Member Functions | |
| void | Begin (int width, int height, std::function< void(int, int, MXCOLOR)> plotter) |
| Begin rendering with a custom pixel plotter. | |
| void | Begin (int width, int height, std::function< void(int, int, MXCOLOR)> plotter) |
| Begin rendering with a custom pixel plotter. | |
| void | Begin (SDL_Renderer *renderer, int width, int height) |
| Begin rendering to an SDL renderer. | |
| void | Begin (SDL_Renderer *renderer, int width, int height) |
| Begin rendering to an SDL renderer. | |
| void | Begin (VK_Sprite &sprite, int width, int height, int pixel_size=1) |
| Begin rendering to a VK_Sprite with optional square pixel size. | |
| void | Begin (VK_Sprite &sprite, int width, int height, int pixel_size=1) |
| Begin rendering to a VK_Sprite with optional square pixel size. | |
| bool | ClipLine (int &x0, int &y0, int &x1, int &y1) const |
| Clip a line segment to the active clip rectangle. | |
| bool | ClipLine (int &x0, int &y0, int &x1, int &y1) const |
| Clip a line segment to the active clip rectangle. | |
| int | ComputeCode (int x, int y) const |
| Compute the Cohen-Sutherland region code for a point. | |
| int | ComputeCode (int x, int y) const |
| Compute the Cohen-Sutherland region code for a point. | |
| void | DrawClipedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const |
| Draw a clipped line. Kept with the original misspelled name for compatibility. | |
| void | DrawClipedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const |
| Draw a clipped line. Kept with the original misspelled name for compatibility. | |
| void | DrawClippedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const |
| Draw a clipped line. | |
| void | DrawClippedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const |
| Draw a clipped line. | |
| void | DrawDepthTestedLine (const vec4D &first, const vec4D &second, MXCOLOR color, std::span< float > depth_buffer) const |
| Draw a clipped screen-space line with perspective-correct depth testing. | |
| void | DrawDepthTestedLine (const vec4D &first, const vec4D &second, MXCOLOR color, std::span< float > depth_buffer) const |
| Draw a clipped screen-space line with perspective-correct depth testing. | |
| void | DrawFilledTriangle (const vec2D &p0, const vec2D &p1, const vec2D &p2, MXCOLOR color) const |
| Draw a clipped filled triangle from 2D screen-space vertices. | |
| void | DrawFilledTriangle (const vec2D &p0, const vec2D &p1, const vec2D &p2, MXCOLOR color) const |
| Draw a clipped filled triangle from 2D screen-space vertices. | |
| void | DrawFilledTriangle (const vec4D &p0, const vec4D &p1, const vec4D &p2, MXCOLOR color) const |
| Draw a clipped filled triangle from homogeneous screen-space vertices. | |
| void | DrawFilledTriangle (const vec4D &p0, const vec4D &p1, const vec4D &p2, MXCOLOR color) const |
| Draw a clipped filled triangle from homogeneous screen-space vertices. | |
| void | DrawObject (const mxObject &object) const |
| Draw an object's active transformed triangles as clipped wireframes. | |
| void | DrawObject (const mxObject &object) const |
| Draw an object's active transformed triangles as clipped wireframes. | |
| void | DrawObject (const mxObject &object, std::span< float > depth_buffer) const |
| Draw an object's active transformed triangles as depth-tested clipped wireframes. | |
| void | DrawObject (const mxObject &object, std::span< float > depth_buffer) const |
| Draw an object's active transformed triangles as depth-tested clipped wireframes. | |
| void | DrawPolys (const RenderList &list) const |
| Draw active render-list triangles as clipped wireframes. | |
| void | DrawPolys (const RenderList &list) const |
| Draw active render-list triangles as clipped wireframes. | |
| void | DrawPolys (const RenderList &list, std::span< float > depth_buffer) const |
| Draw active render-list triangles as depth-tested clipped wireframes. | |
| void | DrawPolys (const RenderList &list, std::span< float > depth_buffer) const |
| Draw active render-list triangles as depth-tested clipped wireframes. | |
| void | DrawSolidPolys (const RenderList &list) const |
| Draw active render-list triangles as filled polygons. | |
| void | DrawSolidPolys (const RenderList &list) const |
| Draw active render-list triangles as filled polygons. | |
| void | DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color) const |
| Draw a clipped wireframe triangle without depth testing. | |
| void | DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color) const |
| Draw a clipped wireframe triangle without depth testing. | |
| void | DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color, std::span< float > depth_buffer) const |
| Draw a clipped wireframe triangle with perspective-correct depth testing. | |
| void | DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color, std::span< float > depth_buffer) const |
| Draw a clipped wireframe triangle with perspective-correct depth testing. | |
| void | End () |
| End rendering and release the current plotting callbacks. | |
| void | End () |
| End rendering and release the current plotting callbacks. | |
Public Attributes | |
| int | clip_max_x = 0 |
| Active maximum clip X coordinate. | |
| int | clip_max_y = 0 |
| Active maximum clip Y coordinate. | |
| int | clip_min_x = 0 |
| Active minimum clip X coordinate. | |
| int | clip_min_y = 0 |
| Active minimum clip Y coordinate. | |
| int | max_clip_x = 0 |
| Maximum clip X coordinate. | |
| int | max_clip_y = 0 |
| Maximum clip Y coordinate. | |
| int | min_clip_x = 0 |
| Minimum clip X coordinate. | |
| int | min_clip_y = 0 |
| Minimum clip Y coordinate. | |
Clipped software rasterization pipeline for lines and filled triangles.
Definition at line 2104 of file mxvk_math.h.
Cohen-Sutherland region codes for line clipping.
Definition at line 2107 of file mxvk_math.h.
Cohen-Sutherland region codes for line clipping.
Definition at line 2076 of file mxvk_math_eigen.hpp.
|
inline |
Begin rendering with a custom pixel plotter.
Definition at line 2149 of file mxvk_math.h.
|
inline |
Begin rendering with a custom pixel plotter.
Definition at line 2118 of file mxvk_math_eigen.hpp.
|
inline |
Begin rendering to an SDL renderer.
Definition at line 2167 of file mxvk_math.h.
|
inline |
Begin rendering to an SDL renderer.
Definition at line 2136 of file mxvk_math_eigen.hpp.
|
inline |
Begin rendering to a VK_Sprite with optional square pixel size.
Definition at line 2179 of file mxvk_math.h.
|
inline |
Begin rendering to a VK_Sprite with optional square pixel size.
Definition at line 2148 of file mxvk_math_eigen.hpp.
|
inline |
Clip a line segment to the active clip rectangle.
| x0 | Start X coordinate, updated to clipped value. |
| y0 | Start Y coordinate, updated to clipped value. |
| x1 | End X coordinate, updated to clipped value. |
| y1 | End Y coordinate, updated to clipped value. |
Definition at line 2211 of file mxvk_math.h.
|
inline |
Clip a line segment to the active clip rectangle.
| x0 | Start X coordinate, updated to clipped value. |
| y0 | Start Y coordinate, updated to clipped value. |
| x1 | End X coordinate, updated to clipped value. |
| y1 | End Y coordinate, updated to clipped value. |
Definition at line 2180 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
Draw a clipped line. Kept with the original misspelled name for compatibility.
Definition at line 2266 of file mxvk_math.h.
|
inline |
Draw a clipped line. Kept with the original misspelled name for compatibility.
Definition at line 2239 of file mxvk_math_eigen.hpp.
|
inline |
Draw a clipped line.
Definition at line 2273 of file mxvk_math.h.
|
inline |
Draw a clipped line.
Definition at line 2246 of file mxvk_math_eigen.hpp.
|
inline |
Draw a clipped screen-space line with perspective-correct depth testing.
| first | First endpoint; x/y are screen coordinates and z is positive view depth. |
| second | Second endpoint; x/y are screen coordinates and z is positive view depth. |
| color | Packed line color. |
| depth_buffer | Full framebuffer depth buffer initialized to a far value. |
Definition at line 2282 of file mxvk_math.h.
|
inline |
Draw a clipped screen-space line with perspective-correct depth testing.
| first | First endpoint; x/y are screen coordinates and z is positive view depth. |
| second | Second endpoint; x/y are screen coordinates and z is positive view depth. |
| color | Packed line color. |
| depth_buffer | Full framebuffer depth buffer initialized to a far value. |
Definition at line 2255 of file mxvk_math_eigen.hpp.
|
inline |
Draw a clipped filled triangle from 2D screen-space vertices.
Definition at line 2366 of file mxvk_math.h.
|
inline |
Draw a clipped filled triangle from 2D screen-space vertices.
Definition at line 2339 of file mxvk_math_eigen.hpp.
|
inline |
Draw a clipped filled triangle from homogeneous screen-space vertices.
Definition at line 2392 of file mxvk_math.h.
|
inline |
Draw a clipped filled triangle from homogeneous screen-space vertices.
Definition at line 2365 of file mxvk_math_eigen.hpp.
|
inline |
Draw an object's active transformed triangles as clipped wireframes.
Definition at line 2425 of file mxvk_math.h.
|
inline |
Draw an object's active transformed triangles as clipped wireframes.
Definition at line 2398 of file mxvk_math_eigen.hpp.
|
inline |
Draw an object's active transformed triangles as depth-tested clipped wireframes.
Definition at line 2444 of file mxvk_math.h.
|
inline |
Draw an object's active transformed triangles as depth-tested clipped wireframes.
Definition at line 2417 of file mxvk_math_eigen.hpp.
|
inline |
Draw active render-list triangles as clipped wireframes.
Definition at line 2405 of file mxvk_math.h.
|
inline |
Draw active render-list triangles as clipped wireframes.
Definition at line 2378 of file mxvk_math_eigen.hpp.
|
inline |
Draw active render-list triangles as depth-tested clipped wireframes.
Definition at line 2415 of file mxvk_math.h.
|
inline |
Draw active render-list triangles as depth-tested clipped wireframes.
Definition at line 2388 of file mxvk_math_eigen.hpp.
|
inline |
Draw active render-list triangles as filled polygons.
Definition at line 2395 of file mxvk_math.h.
|
inline |
Draw active render-list triangles as filled polygons.
Definition at line 2368 of file mxvk_math_eigen.hpp.
|
inline |
Draw a clipped wireframe triangle without depth testing.
Definition at line 2352 of file mxvk_math.h.
|
inline |
Draw a clipped wireframe triangle without depth testing.
Definition at line 2325 of file mxvk_math_eigen.hpp.
|
inline |
Draw a clipped wireframe triangle with perspective-correct depth testing.
Definition at line 2359 of file mxvk_math.h.
|
inline |
Draw a clipped wireframe triangle with perspective-correct depth testing.
Definition at line 2332 of file mxvk_math_eigen.hpp.
|
inline |
End rendering and release the current plotting callbacks.
Definition at line 2463 of file mxvk_math.h.
|
inline |
End rendering and release the current plotting callbacks.
Definition at line 2436 of file mxvk_math_eigen.hpp.
| int mxvk::PipeLine::clip_max_x = 0 |
Active maximum clip X coordinate.
Definition at line 2140 of file mxvk_math.h.
| int mxvk::PipeLine::clip_max_y = 0 |
Active maximum clip Y coordinate.
Definition at line 2146 of file mxvk_math.h.
| int mxvk::PipeLine::clip_min_x = 0 |
Active minimum clip X coordinate.
Definition at line 2137 of file mxvk_math.h.
| int mxvk::PipeLine::clip_min_y = 0 |
Active minimum clip Y coordinate.
Definition at line 2143 of file mxvk_math.h.
| int mxvk::PipeLine::max_clip_x = 0 |
Maximum clip X coordinate.
Definition at line 2125 of file mxvk_math.h.
| int mxvk::PipeLine::max_clip_y = 0 |
Maximum clip Y coordinate.
Definition at line 2128 of file mxvk_math.h.
| int mxvk::PipeLine::min_clip_x = 0 |
Minimum clip X coordinate.
Definition at line 2131 of file mxvk_math.h.
| int mxvk::PipeLine::min_clip_y = 0 |
Minimum clip Y coordinate.
Definition at line 2134 of file mxvk_math.h.