mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Fixed Win32 test: invalid function for CreateThread parameter
This commit is contained in:
parent
1cbfe6be70
commit
bebe6eb12a
5
.gitignore
vendored
5
.gitignore
vendored
@ -99,7 +99,4 @@ tests/timeout
|
||||
tests/title
|
||||
tests/triangle-vulkan
|
||||
tests/window
|
||||
tests/windows
|
||||
/.idea
|
||||
/cmake-build-debug
|
||||
/.gitignore
|
||||
tests/windows
|
@ -32,7 +32,6 @@
|
||||
#include <Windows.h>
|
||||
#endif // USE_WIN32_THREAD_EMPTY_EVENT_TEST
|
||||
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
@ -60,7 +59,7 @@
|
||||
|
||||
#ifdef USE_WIN32_THREAD_EMPTY_EVENT_TEST
|
||||
|
||||
DWORD WINAPI win32ThreadEmptyEventTest(void)
|
||||
DWORD WINAPI win32ThreadEmptyEventTest(LPVOID lpThreadParameter)
|
||||
{
|
||||
// Sleep for 3 seconds, and then post an empty event. The onEmptyEventPosted
|
||||
// method should then be fired shortly after, on the GLFW main thread.
|
||||
@ -81,7 +80,7 @@ void onEmptyEventPosted(void)
|
||||
// This is the only effective way to run code on the main thread during the
|
||||
// window resize phase while the user isn't moving their mouse, apart from the
|
||||
// actual resize events obviously
|
||||
MessageBoxExW(NULL, L"Callback event received!", L"Empty Event Callback", NULL, NULL);
|
||||
MessageBoxW((HWND)NULL, L"Callback event received!", L"Empty Event Callback", (UINT)0);
|
||||
// printf("Empty event received! Put a break point here, and this will be fired on the main thread");
|
||||
}
|
||||
|
||||
@ -158,7 +157,7 @@ int main(int argc, char** argv)
|
||||
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
|
||||
struct nk_rect area = nk_rect(0.f, 0.f, (float) width, (float) height);
|
||||
struct nk_rect area = nk_rect(0.f, 0.f, (float)width, (float)height);
|
||||
nk_window_set_bounds(nk, "main", area);
|
||||
|
||||
nk_glfw3_new_frame();
|
||||
@ -171,8 +170,8 @@ int main(int argc, char** argv)
|
||||
if (glfwGetWindowMonitor(window))
|
||||
{
|
||||
glfwSetWindowMonitor(window, NULL,
|
||||
windowed_x, windowed_y,
|
||||
windowed_width, windowed_height, 0);
|
||||
windowed_x, windowed_y,
|
||||
windowed_width, windowed_height, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -181,8 +180,8 @@ int main(int argc, char** argv)
|
||||
glfwGetWindowPos(window, &windowed_x, &windowed_y);
|
||||
glfwGetWindowSize(window, &windowed_width, &windowed_height);
|
||||
glfwSetWindowMonitor(window, monitor,
|
||||
0, 0, mode->width, mode->height,
|
||||
mode->refreshRate);
|
||||
0, 0, mode->width, mode->height,
|
||||
mode->refreshRate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,8 +222,8 @@ int main(int argc, char** argv)
|
||||
|
||||
nk_flags events;
|
||||
const nk_flags flags = NK_EDIT_FIELD |
|
||||
NK_EDIT_SIG_ENTER |
|
||||
NK_EDIT_GOTO_END_ON_ACTIVATE;
|
||||
NK_EDIT_SIG_ENTER |
|
||||
NK_EDIT_GOTO_END_ON_ACTIVATE;
|
||||
|
||||
if (position_supported)
|
||||
{
|
||||
@ -235,8 +234,8 @@ int main(int argc, char** argv)
|
||||
nk_label(nk, "Position", NK_TEXT_LEFT);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, xpos_buffer,
|
||||
sizeof(xpos_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(xpos_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
xpos = atoi(xpos_buffer);
|
||||
@ -246,8 +245,8 @@ int main(int argc, char** argv)
|
||||
sprintf(xpos_buffer, "%i", xpos);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, ypos_buffer,
|
||||
sizeof(ypos_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(ypos_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
ypos = atoi(ypos_buffer);
|
||||
@ -266,8 +265,8 @@ int main(int argc, char** argv)
|
||||
nk_label(nk, "Size", NK_TEXT_LEFT);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, width_buffer,
|
||||
sizeof(width_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(width_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
width = atoi(width_buffer);
|
||||
@ -277,8 +276,8 @@ int main(int argc, char** argv)
|
||||
sprintf(width_buffer, "%i", width);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, height_buffer,
|
||||
sizeof(height_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(height_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
height = atoi(height_buffer);
|
||||
@ -295,8 +294,8 @@ int main(int argc, char** argv)
|
||||
update_ratio_limit = true;
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, numer_buffer,
|
||||
sizeof(numer_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(numer_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
aspect_numer = abs(atoi(numer_buffer));
|
||||
@ -306,8 +305,8 @@ int main(int argc, char** argv)
|
||||
sprintf(numer_buffer, "%i", aspect_numer);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, denom_buffer,
|
||||
sizeof(denom_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(denom_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
aspect_denom = abs(atoi(denom_buffer));
|
||||
@ -330,8 +329,8 @@ int main(int argc, char** argv)
|
||||
update_size_limit = true;
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, min_width_buffer,
|
||||
sizeof(min_width_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(min_width_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
min_width = abs(atoi(min_width_buffer));
|
||||
@ -341,8 +340,8 @@ int main(int argc, char** argv)
|
||||
sprintf(min_width_buffer, "%i", min_width);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, min_height_buffer,
|
||||
sizeof(min_height_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(min_height_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
min_height = abs(atoi(min_height_buffer));
|
||||
@ -355,8 +354,8 @@ int main(int argc, char** argv)
|
||||
update_size_limit = true;
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, max_width_buffer,
|
||||
sizeof(max_width_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(max_width_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
max_width = abs(atoi(max_width_buffer));
|
||||
@ -366,8 +365,8 @@ int main(int argc, char** argv)
|
||||
sprintf(max_width_buffer, "%i", max_width);
|
||||
|
||||
events = nk_edit_string_zero_terminated(nk, flags, max_height_buffer,
|
||||
sizeof(max_height_buffer),
|
||||
nk_filter_decimal);
|
||||
sizeof(max_height_buffer),
|
||||
nk_filter_decimal);
|
||||
if (events & NK_EDIT_COMMITED)
|
||||
{
|
||||
max_height = abs(atoi(max_height_buffer));
|
||||
@ -379,10 +378,10 @@ int main(int argc, char** argv)
|
||||
if (update_size_limit)
|
||||
{
|
||||
glfwSetWindowSizeLimits(window,
|
||||
limit_min_size ? min_width : GLFW_DONT_CARE,
|
||||
limit_min_size ? min_height : GLFW_DONT_CARE,
|
||||
limit_max_size ? max_width : GLFW_DONT_CARE,
|
||||
limit_max_size ? max_height : GLFW_DONT_CARE);
|
||||
limit_min_size ? min_width : GLFW_DONT_CARE,
|
||||
limit_min_size ? min_height : GLFW_DONT_CARE,
|
||||
limit_max_size ? max_width : GLFW_DONT_CARE,
|
||||
limit_max_size ? max_height : GLFW_DONT_CARE);
|
||||
}
|
||||
|
||||
int fb_width, fb_height;
|
||||
|
Loading…
Reference in New Issue
Block a user