hge引擎-渲染线条
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
渲染线条
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.
起点的X坐标。
y1
Starting point Y-coordinate.
起点的Y坐标。
x2
Ending point X-coordinate.
终点的X坐标。
y2
Ending point Y-coordinate.
终点的Y坐标。
color
Optional color value.Default is 0xFFFFFFFF.
可随意选择颜色。
默认是0xFFFFFFFF。
z
Optional Z-order.Default is 0.5f.
可随意选择Z轴次序。
默认值是0.5f。
Remarks
注释
Gfx_RenderLine function must be called between the Gfx_BeginScene and Gfx_BeginScene calls.
Gfx_RenderLine函数必须在Gfx_BeginScene和
Gfx_BeginScene之间调用。
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.
Gfx_RenderLine忽略线的最后一个点,因此你可以在没有任何附加的协调调整器的情况下画线的接合点。
颜色参数包含alpha 值。
注意硬件资料中规定的颜色格式。
如果z-buffer不能使用,Z
轴次序值将被忽略。
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.
Gfx_RenderLine的运行原理是积存连冠的线并调用DirectX
对这些线进行单个渲染。
在大多数情况下你将不能看到任何差别和尽量不要完全使用这个计算处理。
但是它确实可以安全可靠并且立刻完成你交托的简单图形的键入和渲染,例如很多的线。