[...]//Code for creating cubes
int main()
{
[...]//some extra codes
while (!glfwWindowShouldClose(window))
{
[...]//more extra codes
cubes.DrawCubes(view, projection);
chk:
if (rSpeed > 90)
{
rSpeed = 90;
}
if (rSpeed < 1)
{
rSpeed = 1;
}
if (90 % rSpeed != 0)
{
if (inc)
rSpeed++;
else if (dec)
rSpeed--;
goto chk;
}
if (cubes.Rot_speed != rSpeed)
{
cubes.SetCubeRotationSpeed(rSpeed);
}
if (RotateX)
{
if (rot_x < 90 / rSpeed)
{
cubes.Rotate(0);
rot_x++;
cubes.Rotating = true;
RotateY = false;
RotateZ = false;
}
else
{
rot_x = 0;
RotateX = false;
cubes.Rotating = false;
}
}
if (RotateY)
{
if (rot_y < 90 / rSpeed)
{
cubes.Rotate(1);
rot_y++;
cubes.Rotating = true;
RotateX = false;
RotateZ = false;
}
else
{
rot_y = 0;
RotateY = false;
cubes.Rotating = false;
}
}
if (RotateZ)
{
if (rot_z < 90 / rSpeed)
{
cubes.Rotate(2);
rot_z++;
cubes.Rotating = true;
RotateY = false;
RotateX = false;
}
else
{
rot_z = 0;
RotateZ = false;
cubes.Rotating = false;
}
}
[...]//more extra codes
}
}
where rSpeed and cubes.Rot_speed refers to angles for rotation speeds.
The places where I kept [...]
are codes unrelated to my question. So please don't mind those .