mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Fixed various VC++ warnings.
This commit is contained in:
parent
5bbbf8640e
commit
633839502c
@ -1,3 +1,4 @@
|
||||
|
||||
include_directories(${GLFW_SOURCE_DIR}/src
|
||||
${GLFW_BINARY_DIR}/src
|
||||
${glfw_INCLUDE_DIRS})
|
||||
@ -38,6 +39,10 @@ elseif (_GLFW_X11_GLX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
|
||||
set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}")
|
||||
|
||||
|
@ -67,8 +67,12 @@ GLFWAPI void glfwSetGamma(float gamma)
|
||||
value = (float) i / (float) (size - 1);
|
||||
// Apply gamma curve
|
||||
value = (float) pow(value, 1.f / gamma) * 65535.f + 0.5f;
|
||||
|
||||
// Clamp to value range
|
||||
value = (float) fmax(fmin(value, 65535.f), 0.f);
|
||||
if (value < 0.f)
|
||||
value = 0.f;
|
||||
else if (value > 65535.f)
|
||||
value = 65535.f;
|
||||
|
||||
ramp.red[i] = (unsigned short) value;
|
||||
ramp.green[i] = (unsigned short) value;
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <stdlib.h>
|
||||
#if defined(_MSC_VER)
|
||||
#include <malloc.h>
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -271,7 +271,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
monitors[found]->Win32.name = wcsdup(adapter.DeviceName);
|
||||
monitors[found]->Win32.name = _wcsdup(adapter.DeviceName);
|
||||
found++;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,8 @@
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "tinycthread.h"
|
||||
|
||||
#include <GL/glfw3.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@ -35,8 +37,6 @@
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "tinycthread.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GLFWwindow window;
|
||||
|
Loading…
Reference in New Issue
Block a user