| 20 | static MaterialDefinition debugDrawMaterial(DrawMode::COLORONLY, eBlendMode::MULTIPLY); |
| 21 | static GeometryData debug_geom; |
| 22 | void drawLine3D_2Color(const Vector3 *p1, unsigned int argb_pt1, const Vector3 *p2, unsigned int argb_pt2) |
| 23 | { |
| 24 | GLDebugGuard guard(__FUNCTION__); |
| 25 | debug_geom.createVAO(); |
| 26 | Vector3 toCam = cam_info.cammat.TranslationPart - *p1; |
| 27 | toCam.normalize(); |
| 28 | const Vector3 a = toCam * 0.05f + *p1; |
| 29 | toCam = cam_info.cammat.TranslationPart - *p2; |
| 30 | toCam.normalize(); |
| 31 | const Vector3 b = toCam * 0.05f + *p2; |
| 32 | debugDrawMaterial.draw_data.modelViewMatrix = cam_info.viewmat.toGLM(); |
| 33 | segs_wcw_statemgmt_bindTexture(GL_TEXTURE_2D, 0, 0); |
| 34 | debugDrawMaterial.draw_data.fog_params.enabled = false; |
| 35 | |
| 36 | Vector3 pos[] = { |
| 37 | a,b |
| 38 | }; |
| 39 | uint8_t colors[] = { |
| 40 | uint8_t(argb_pt1 >> 16) , uint8_t(argb_pt1>> 8) , uint8_t(argb_pt1), uint8_t(argb_pt1 >> 24), |
| 41 | uint8_t(argb_pt2 >> 16) , uint8_t(argb_pt2>> 8) , uint8_t(argb_pt2), uint8_t(argb_pt2 >> 24) |
| 42 | }; |
| 43 | debugDrawMaterial.render_state.setBlendMode(RenderState::BLEND_ALPHA); |
| 44 | debugDrawMaterial.apply(); |
| 45 | debug_geom.uploadVerticesToBuffer((float *)pos,6); |
| 46 | debug_geom.uploadColorsToBuffer(colors,8); |
| 47 | debug_geom.drawArray(*debugDrawMaterial.program, GL_LINES, 2, 0); |
| 48 | } |
| 49 | void drawLine3D_z_2Color(const Vector3 *p1, unsigned int argb_pt1, const Vector3 *p2, unsigned int argb_pt2) |
| 50 | { |
| 51 | GLDebugGuard guard(__FUNCTION__); |
nothing calls this directly
no test coverage detected