FLTK logo

[master] e531014 - Fix MSVC 'GLfloat' warnings in test apps (#109)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] e531014 - Fix MSVC 'GLfloat' warnings in test apps (#109) "Albrecht Schlosser" Aug 31, 2021  
 
commit e5310144b7b3bda62e3711420c53af73907ab2d4
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Tue Aug 31 17:18:18 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Tue Aug 31 17:18:18 2021 +0200

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

 test/fullscreen.cxx | 4 ++--
 test/gl_overlay.cxx | 4 ++--
 test/shape.cxx      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git test/fullscreen.cxx test/fullscreen.cxx
index fab06c3..8bde3cf 100644
--- test/fullscreen.cxx
+++ test/fullscreen.cxx
@@ -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();
 }
diff --git test/gl_overlay.cxx test/gl_overlay.cxx
index a635fd5..fc02186 100644
--- test/gl_overlay.cxx
+++ test/gl_overlay.cxx
@@ -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();
 }
diff --git test/shape.cxx test/shape.cxx
index f87d59c..ec042e4 100644
--- test/shape.cxx
+++ test/shape.cxx
@@ -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();
 }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.