mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-22 03:41:47 +00:00
Mingw support
clear out warnings for _WIN32 codepath
This commit is contained in:
parent
6b09c72dca
commit
ae8ccaf2f0
5 changed files with 18 additions and 9 deletions
|
@ -95,7 +95,7 @@ default:
|
|||
- - |
|
||||
# apt_common
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_common[collapsed=true]\r\e[0KInstalling common packages"
|
||||
- apt-get install make git ccache
|
||||
- apt-get install make git ccache libsimde-dev
|
||||
- |
|
||||
# apt_common
|
||||
echo -e "\e[0Ksection_end:`date +%s`:apt_common\r\e[0K"
|
||||
|
@ -219,6 +219,7 @@ i386:
|
|||
variables:
|
||||
CC: ccache i686-linux-gnu-gcc
|
||||
CXX: ccache i686-linux-gnu-g++
|
||||
CPPFLAGS: -msse2 -U NO_SSE
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
|
@ -343,6 +344,8 @@ win32:
|
|||
variables:
|
||||
CC: ccache i686-w64-mingw32-gcc-posix
|
||||
CXX: ccache i686-w64-mingw32-g++-posix
|
||||
CFLAGS: -Wall -Wextra -Werror
|
||||
CXXFLAGS: -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
|
@ -376,6 +379,8 @@ win64:
|
|||
variables:
|
||||
CC: ccache x86_64-w64-mingw32-gcc-posix
|
||||
CXX: ccache x86_64-w64-mingw32-g++-posix
|
||||
CFLAGS: -Wall -Wextra -Werror
|
||||
CXXFLAGS: -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
|
|
4
Makefile
4
Makefile
|
@ -23,6 +23,10 @@ CPPFLAGS_ := $(INC_FLAGS) -MMD -MP
|
|||
|
||||
CFLAGS_ = -O2 -g3 -fPIC
|
||||
|
||||
ifdef MINGW
|
||||
CFLAGS_ += -msse2
|
||||
endif
|
||||
|
||||
CXXFLAGS_ = -std=c++14 $(CFLAGS_)
|
||||
|
||||
ifdef MINGW
|
||||
|
|
|
@ -178,14 +178,14 @@ void OpenGLContext::SwapBuffers()
|
|||
|
||||
int OpenGLContext::GetWidth() const
|
||||
{
|
||||
RECT box = { 0 };
|
||||
RECT box = { 0, 0, 0, 0 };
|
||||
GetClientRect(window, &box);
|
||||
return box.right - box.left;
|
||||
}
|
||||
|
||||
int OpenGLContext::GetHeight() const
|
||||
{
|
||||
RECT box = { 0 };
|
||||
RECT box = { 0, 0, 0, 0 };
|
||||
GetClientRect(window, &box);
|
||||
return box.bottom - box.top;
|
||||
}
|
||||
|
@ -217,10 +217,10 @@ OpenGLContext::CreateFunctions OpenGLContext::GetCreateFunctions(HWND window)
|
|||
{
|
||||
wglMakeCurrent(queryDC, queryContext);
|
||||
|
||||
functions.wglCreateContextAttribsARB = (ptr_wglCreateContextAttribsARB)wglGetProcAddress("wglCreateContextAttribsARB");
|
||||
functions.wglGetPixelFormatAttribivEXT = (ptr_wglGetPixelFormatAttribivEXT)wglGetProcAddress("wglGetPixelFormatAttribivEXT");
|
||||
functions.wglGetPixelFormatAttribfvEXT = (ptr_wglGetPixelFormatAttribfvEXT)wglGetProcAddress("wglGetPixelFormatAttribfvEXT");
|
||||
functions.wglChoosePixelFormatEXT = (ptr_wglChoosePixelFormatEXT)wglGetProcAddress("wglChoosePixelFormatEXT");
|
||||
functions.wglCreateContextAttribsARB = (ptr_wglCreateContextAttribsARB)(void*)wglGetProcAddress("wglCreateContextAttribsARB");
|
||||
functions.wglGetPixelFormatAttribivEXT = (ptr_wglGetPixelFormatAttribivEXT)(void*)wglGetProcAddress("wglGetPixelFormatAttribivEXT");
|
||||
functions.wglGetPixelFormatAttribfvEXT = (ptr_wglGetPixelFormatAttribfvEXT)(void*)wglGetProcAddress("wglGetPixelFormatAttribfvEXT");
|
||||
functions.wglChoosePixelFormatEXT = (ptr_wglChoosePixelFormatEXT)(void*)wglGetProcAddress("wglChoosePixelFormatEXT");
|
||||
|
||||
HMODULE opengl32 = LoadLibrary("opengl32.dll");
|
||||
if (opengl32)
|
||||
|
|
|
@ -69,7 +69,7 @@ static int TestPointer(const PROC pTest)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static PROC WinGetProcAddress(const char *name)
|
||||
static void *WinGetProcAddress(const char *name)
|
||||
{
|
||||
HMODULE glMod = NULL;
|
||||
PROC pFunc = wglGetProcAddress((LPCSTR)name);
|
||||
|
|
|
@ -105,7 +105,7 @@ LRESULT RawMouse::OnMessage(INT message, WPARAM wparam, LPARAM lparam)
|
|||
{
|
||||
std::vector<uint32_t> buf((size + 3) / 4);
|
||||
result = GetRawInputData(rawinputHandle, RID_INPUT, buf.data(), &size, sizeof(RAWINPUTHEADER));
|
||||
if (result >= 0)
|
||||
if (result != (UINT)-1)
|
||||
{
|
||||
RAWINPUT* rawinput = (RAWINPUT*)buf.data();
|
||||
if (rawinput->header.dwType == RIM_TYPEMOUSE)
|
||||
|
|
Loading…
Reference in a new issue