mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Fixed VC++ warnings.
This commit is contained in:
parent
30b6e0c868
commit
3df0b4478b
@ -385,18 +385,18 @@ static void cursorPosFun(GLFWwindow* window, double x, double y)
|
||||
switch (active_view)
|
||||
{
|
||||
case 1:
|
||||
rot_x += (int) y - ypos;
|
||||
rot_z += (int) x - xpos;
|
||||
rot_x += (int) (y - ypos);
|
||||
rot_z += (int) (x - xpos);
|
||||
do_redraw = 1;
|
||||
break;
|
||||
case 3:
|
||||
rot_x += (int) y - ypos;
|
||||
rot_y += (int) x - xpos;
|
||||
rot_x += (int) (y - ypos);
|
||||
rot_y += (int) (x - xpos);
|
||||
do_redraw = 1;
|
||||
break;
|
||||
case 4:
|
||||
rot_y += (int) x - xpos;
|
||||
rot_z += (int) y - ypos;
|
||||
rot_y += (int) (x - xpos);
|
||||
rot_z += (int) (y - ypos);
|
||||
do_redraw = 1;
|
||||
break;
|
||||
default:
|
||||
|
@ -339,12 +339,12 @@ void cursor_position_callback(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
alpha += (x - cursorX) / 10.f;
|
||||
beta += (y - cursorY) / 10.f;
|
||||
alpha += (GLfloat) (x - cursorX) / 10.f;
|
||||
beta += (GLfloat) (y - cursorY) / 10.f;
|
||||
}
|
||||
|
||||
cursorX = x;
|
||||
cursorY = y;
|
||||
cursorX = (int) x;
|
||||
cursorY = (int) y;
|
||||
}
|
||||
|
||||
|
||||
|
@ -131,7 +131,7 @@ const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
|
||||
if (_glfw_joyGetPosEx(joy, &ji) != JOYERR_NOERROR)
|
||||
return NULL;
|
||||
|
||||
while (*count < jc.wNumButtons)
|
||||
while (*count < (int) jc.wNumButtons)
|
||||
{
|
||||
buttons[*count] = (unsigned char)
|
||||
(ji.dwButtons & (1UL << *count) ? GLFW_PRESS : GLFW_RELEASE);
|
||||
|
@ -113,8 +113,8 @@ int main(void)
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(0.f, (GLfloat) window_height - cursor_y);
|
||||
glVertex2f((GLfloat) window_width, (GLfloat) window_height - cursor_y);
|
||||
glVertex2f(0.f, (GLfloat) (window_height - cursor_y));
|
||||
glVertex2f((GLfloat) window_width, (GLfloat) (window_height - cursor_y));
|
||||
glVertex2f((GLfloat) cursor_x, 0.f);
|
||||
glVertex2f((GLfloat) cursor_x, (GLfloat) window_height);
|
||||
glEnd();
|
||||
|
@ -113,7 +113,7 @@ int main(int argc, char** argv)
|
||||
int count = 0;
|
||||
GLFWwindow* window;
|
||||
|
||||
srand(time(NULL));
|
||||
srand((unsigned int) time(NULL));
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user