Skip to content

Commit

Permalink
Fix compilation warnings in testbed
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-dejoue committed Nov 11, 2020
1 parent 83680d9 commit cf5f95d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions testbed/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ double Fun(double x);
vector<Point*> CreateHeadHole();
vector<Point*> CreateChestHole();

float rotate_y = 0,
rotate_z = 0;
const float rotations_per_tick = .2;
double rotate_y = 0.0,
rotate_z = 0.0;
const double rotations_per_tick = 0.2;

/// Screen center x
double cx = 0.0;
Expand Down Expand Up @@ -94,7 +94,7 @@ template <class C> void FreeClear( C & cntr ) {
int main(int argc, char* argv[])
{

int num_points = 0;
size_t num_points = 0u;
double max, min;
double zoom;

Expand Down Expand Up @@ -267,7 +267,7 @@ void MainLoop(const double zoom)

// calculate time elapsed, and the amount by which stuff rotates
double current_time = glfwGetTime(),
delta_rotate = (current_time - old_time) * rotations_per_tick * 360;
delta_rotate = (current_time - old_time) * rotations_per_tick * 360.0;
old_time = current_time;

// escape to quit, arrow keys to rotate view
Expand Down Expand Up @@ -306,8 +306,8 @@ void ResetZoom(double zoom, double cx, double cy, double width, double height)
glLoadIdentity();

// Reset ortho view
glOrtho(left, right, bottom, top, 1, -1);
glTranslatef(-cx, -cy, 0);
glOrtho(left, right, bottom, top, 1.0, -1.0);
glTranslated(-cx, -cy, 0.0);
glMatrixMode(GL_MODELVIEW);
glDisable(GL_DEPTH_TEST);
glLoadIdentity();
Expand All @@ -333,9 +333,9 @@ void Draw(const double zoom)
glColor3f(1, 0, 0);

glBegin(GL_LINE_LOOP);
glVertex2f(a.x, a.y);
glVertex2f(b.x, b.y);
glVertex2f(c.x, c.y);
glVertex2d(a.x, a.y);
glVertex2d(b.x, b.y);
glVertex2d(c.x, c.y);
glEnd();
}

Expand All @@ -346,7 +346,7 @@ void Draw(const double zoom)
vector<Point*> poly = polylines[i];
glBegin(GL_LINE_LOOP);
for(int j = 0; j < poly.size(); j++) {
glVertex2f(poly[j]->x, poly[j]->y);
glVertex2d(poly[j]->x, poly[j]->y);
}
glEnd();
}
Expand All @@ -368,20 +368,20 @@ void DrawMap(const double zoom)

ConstrainedColor(t.constrained_edge[2]);
glBegin(GL_LINES);
glVertex2f(a.x, a.y);
glVertex2f(b.x, b.y);
glVertex2d(a.x, a.y);
glVertex2d(b.x, b.y);
glEnd( );

ConstrainedColor(t.constrained_edge[0]);
glBegin(GL_LINES);
glVertex2f(b.x, b.y);
glVertex2f(c.x, c.y);
glVertex2d(b.x, b.y);
glVertex2d(c.x, c.y);
glEnd( );

ConstrainedColor(t.constrained_edge[1]);
glBegin(GL_LINES);
glVertex2f(c.x, c.y);
glVertex2f(a.x, a.y);
glVertex2d(c.x, c.y);
glVertex2d(a.x, a.y);
glEnd( );
}
}
Expand Down

0 comments on commit cf5f95d

Please sign in to comment.