Skip to content

Commit

Permalink
explicit casts
Browse files Browse the repository at this point in the history
  • Loading branch information
Caitlin Wilks committed Feb 8, 2015
1 parent e64310f commit c48fdad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/balls/include/systems/RenderingSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RenderingSystem

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, (double)mWindowWidth, 0.0, (double)mWindowHeight, 0.0f, 1.0f);
glOrtho(0.0, static_cast<double>(mWindowWidth), 0.0, static_cast<double>(mWindowHeight), 0.0f, 1.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
Expand Down Expand Up @@ -118,10 +118,10 @@ inline std::vector<Vertex> createCircleVertexArray(int circleVertexCount)
for (int i = 0; i < circleVertexCount - 2; ++i)
{
// How far we are around the circle in radians
float angle = 2.0f * (float)M_PI * (float)i / (float)(circleVertexCount - 2);
double angle = 2.0 * M_PI * (i / circleVertexCount - 2);

// Set the circle's vertices
circleVertexArray[i] = { sin(angle), cos(angle) };
circleVertexArray[i] = { static_cast<float>(sin(angle)), static_cast<float>(cos(angle)) };
}

// The final vertex should loop back around
Expand Down

0 comments on commit c48fdad

Please sign in to comment.