Replace ugly "cross-hair", with better cross-hair

master^2
Vyom Fadia 2018-07-08 20:33:38 +01:00
parent 02b2532750
commit 292f3887ac
3 changed files with 24 additions and 1 deletions

View File

@ -19,6 +19,8 @@ class Q3Renderer
void end2d();
void drawRect(float x, float y, float w, float h, glm::vec3 col);
void drawCrosshair();
private:
};

View File

@ -36,7 +36,8 @@ int main(int argc, char **argv)
renderer.clear();
renderer.start2d();
renderer.drawRect(-0.01f, -0.01f, 0.02, 0.03, glm::vec3(1.0f, 1.0f, 1.0f));
//renderer.drawRect(-0.01f, -0.01f, 0.02, 0.03, glm::vec3(1.0f, 1.0f, 1.0f));
renderer.drawCrosshair();
renderer.end2d();
renderer.start3d();

View File

@ -87,6 +87,26 @@ void Q3Renderer::drawRect(float x, float y, float w, float h, glm::vec3 col)
glEnd();
}
void Q3Renderer::drawCrosshair()
{
glColor3ub(240, 240, 240); //white
glLineWidth(2.0);
glBegin(GL_LINES);
glVertex3f(-0.05f, 0.f, 0.f);
glVertex3f(0.05f, 0.f, 0.f);
glEnd();
glBegin(GL_LINES);
glVertex3f(0.f, -0.05f, 0.f);
glVertex3f(0.f, 0.05f, 0.f);
glEnd();
}
void Q3Renderer::drawCube(float x, float y, float z, float sx, float sy, float sz)
{
glPushMatrix();