Merge remote-tracking branch 'bp/master'

This commit is contained in:
Erwin Coumans
2017-10-29 12:28:00 -07:00
9 changed files with 213 additions and 96 deletions

View File

@@ -439,15 +439,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
void Win32Window::setWindowTitle(const char* titleChar)
{
wchar_t windowTitle[1024];
swprintf(windowTitle, 1024, L"%hs", titleChar);
#ifdef _WIN64
SetWindowTextW(m_data->m_hWnd, windowTitle);
SetWindowText(m_data->m_hWnd, titleChar);
#else
DWORD dwResult;
SendMessageTimeoutW(m_data->m_hWnd, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(windowTitle),
SendMessageTimeout(m_data->m_hWnd, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(titleChar),
SMTO_ABORTIFHUNG, 2000, &dwResult);
#endif
}

View File

@@ -15,7 +15,7 @@ IF(NOT WIN32 AND NOT APPLE)
ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1")
ENDIF()
ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB )
ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 )
FILE(GLOB gwen_SRCS "*.cpp" "Controls/*.cpp" "Controls/Dialog/*.cpp" "Controls/Dialogs/*.cpp" "Controls/Layout/*.cpp" "Controls/Property/*.cpp" "Input/*.cpp" "Platforms/*.cpp" "Renderers/*.cpp" "Skins/*.cpp")
FILE(GLOB gwen_HDRS "*.h" "Controls/*.h" "Controls/Dialog/*.h" "Controls/Dialogs/*.h" "Controls/Layout/*.h" "Controls/Property/*.h" "Input/*.h" "Platforms/*.h" "Renderers/*.h" "Skins/*.h")

View File

@@ -4,6 +4,7 @@
#define GWEN_MACROS_H
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h> // vsnprintf
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <malloc.h>
#else
@@ -17,7 +18,7 @@
#define GwenUtil_Max( a, b ) ( ( (a) > (b) ) ? (a) : (b) )
#define GwenUtil_VSWPrintFSafeSized( _DstBuf_ARRAY_, _Format, _ArgList ) GwenUtil_VSWPrintFSafe( _DstBuf_ARRAY_, sizeof( _DstBuf_ARRAY_ ) / sizeof( wchar_t ), _Format, _ArgList )
#ifdef _WIN32
#ifdef _MSC_VER
#ifndef NOMINMAX
#define NOMINMAX
@@ -40,10 +41,15 @@
#define GwenUtil_OutputDebugWideString( lpOutputString ) //wprintf( lpOutputString )
#define GwenUtil_WideStringToFloat( _Str ) wcstof(_Str, NULL)
#elif defined(__linux__) || defined(__OpenBSD__)
#elif defined(__linux__) || defined( __GNUC__ )
#define GwenUtil_VSNPrintFSafe( _DstBuf, _DstSize, _MaxCount, _Format, _ArgList ) vsnprintf( _DstBuf, _DstSize, _Format, _ArgList )
#define GwenUtil_VSWPrintFSafe( _DstBuf, _SizeInWords, _Format, _ArgList ) vswprintf( _DstBuf, _SizeInWords, _Format, _ArgList )
#ifdef _WIN32
#define GwenUtil_VSWPrintFSafe( _DstBuf, _SizeInWords, _Format, _ArgList ) vsnwprintf( _DstBuf, _SizeInWords, _Format, _ArgList )
#else
#define GwenUtil_VSWPrintFSafe( _DstBuf, _SizeInWords, _Format, _ArgList ) vswprintf( _DstBuf, _SizeInWords, _Format, _ArgList )
#endif
#define GwenUtil_OutputDebugCharString( lpOutputString ) //printf( lpOutputString )
#define GwenUtil_OutputDebugWideString( lpOutputString ) //wprintf( lpOutputString )
#define GwenUtil_WideStringToFloat( _Str ) wcstof(_Str, NULL)