Fix MSVC 'GLfloat' warnings in test apps (#109)

This commit is contained in:
Albrecht Schlosser 2021-08-31 17:18:18 +02:00
parent 2b29e921db
commit e5310144b7
3 changed files with 6 additions and 6 deletions

View File

@ -85,11 +85,11 @@ void shape_window::draw() {
glViewport(0,0,pixel_w(),pixel_h());
}
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(.5,.6,.7);
glColor3f(.5f, .6f, .7f);
glBegin(GL_POLYGON);
for (int j = 0; j < sides; j ++) {
double ang = j*2*M_PI/sides;
glVertex3f(cos(ang),sin(ang),0);
glVertex3f((GLfloat)cos(ang), (GLfloat)sin(ang), 0);
}
glEnd();
}

View File

@ -64,7 +64,7 @@ void shape_window::draw() {
for (int j=0; j<sides; j++) {
double ang = j*2*M_PI/sides;
glColor3f(float(j)/sides,float(j)/sides,float(j)/sides);
glVertex3f(cos(ang),sin(ang),0);
glVertex3f((GLfloat)cos(ang), (GLfloat)sin(ang), 0);
}
glEnd();
// }
@ -83,7 +83,7 @@ void shape_window::draw_overlay() {
glBegin(GL_LINE_LOOP);
for (int j=0; j<overlay_sides; j++) {
double ang = j*2*M_PI/overlay_sides;
glVertex3f(cos(ang),sin(ang),0);
glVertex3f((GLfloat)cos(ang), (GLfloat)sin(ang), 0);
}
glEnd();
}

View File

@ -47,11 +47,11 @@ void shape_window::draw() {
}
// draw an amazing graphic:
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(.5,.6,.7);
glColor3f(.5f, .6f, .7f);
glBegin(GL_POLYGON);
for (int j=0; j<sides; j++) {
double ang = j*2*M_PI/sides;
glVertex3f(cos(ang),sin(ang),0);
glVertex3f((GLfloat)cos(ang), (GLfloat)sin(ang), 0);
}
glEnd();
}