HGE::Gfx_RenderLine

Renders a line.

void Gfx_RenderLine(
  float x1,
  float y1,
  float x2,
  float y2,
  DWORD color = 0xFFFFFFFF,
  float z = 0.5f
);

Parameters

x1
Starting point X-coordinate.
y1
Starting point Y-coordinate.
x2
Ending point X-coordinate.
y2
Ending point Y-coordinate.
color
Optional color value. Default is 0xFFFFFFFF.
z
Optional Z-order. Default is 0.5f.

Remarks

Gfx_RenderLine function must be called between the Gfx_BeginScene and Gfx_EndScene calls.

Gfx_RenderLine omits the last point of the line, so you can draw joint lines without any additional coordinates adjustments. The color parameter includes alpha value. See the Hardware color format section for details. If Z-buffer isn't used, the Z-order value is ignored.

For performance reasons Gfx_RenderLine accumulates consecutive lines and then renders them with a single call to DirectX. In most cases you will not see any difference and don't have to deal with this batching at all. But to be sure and safe it is recommended to group your graphics by primitive type and render as much lines as possible at once.

Requirements

Header: hge.h
Import library: hge.lib

See also

Gfx_BeginScene, Gfx_EndScene