MCPcopy Create free account
hub / github.com/Segs/Segs / drawLine2D_2Color

Function drawLine2D_2Color

Projects/CoX/Clients/Client_I0/entity/entityDebug.cpp:72–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 debug_geom.drawArray(*debugDrawMaterial.program, GL_LINES, 2, 0);
71}
72void drawLine2D_2Color(int x1, int y1, int x2, int y2, uint32_t argb_pt1, uint32_t argb_pt2)
73{
74 debug_geom.createVAO();
75 Vector3 a {float(x1),float(y1),-1};
76 Vector3 b {float(x2),float(y2),-1};
77 Vector3 pos[] = {
78 a,b
79 };
80 uint8_t colors[] = {
81 uint8_t(argb_pt1 >> 16) , uint8_t(argb_pt1>> 8) , uint8_t(argb_pt1), uint8_t(argb_pt1 >> 24),
82 uint8_t(argb_pt2 >> 16) , uint8_t(argb_pt2>> 8) , uint8_t(argb_pt2), uint8_t(argb_pt2 >> 24)
83 };
84 debug_geom.uploadVerticesToBuffer((float *)pos,3*2);
85 debug_geom.uploadColorsToBuffer(colors,8);
86 debugDrawMaterial.apply();
87
88 segs_wcw_statemgmt_bindTexture(GL_TEXTURE_2D, 0, 0);
89 debug_geom.drawArray(*debugDrawMaterial.program, GL_LINES, 2, 0);
90}
91void segs_entDebug_DrawUnculledTriangle(Vector3 *vertex1, uint32_t color1, Vector3 *vertex2, uint32_t color2, Vector3 *vertex3, uint32_t color3)
92{
93 debug_geom.createVAO();

Callers

nothing calls this directly

Calls 6

createVAOMethod · 0.80
uploadColorsToBufferMethod · 0.80
drawArrayMethod · 0.80
applyMethod · 0.45

Tested by

no test coverage detected