Merge branch '5_1-new' into win64
This commit is contained in:
@@ -20,6 +20,12 @@
|
||||
#include <WbemIdl.h>
|
||||
#include <OleAuto.h>
|
||||
|
||||
// this may not be defined if we are using an older Windows SDK. (for instance, toolsetversion v140_xp does not define it)
|
||||
// the number was taken from the documentation
|
||||
#ifndef XUSER_MAX_COUNT
|
||||
#define XUSER_MAX_COUNT 4
|
||||
#endif
|
||||
|
||||
REGISTER_INPUT_HANDLER_CLASS2( DirectInput, DInput );
|
||||
|
||||
static vector<DIDevice> Devices;
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma comment(lib, "dinput8.lib")
|
||||
#if defined(_WINDOWS)
|
||||
#pragma comment(lib, "dxguid.lib")
|
||||
#endif
|
||||
#endif
|
||||
LPDIRECTINPUT8 g_dinput = nullptr;
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ extern "C" const char *Init( int *argc, char ***argv )
|
||||
return "Couldn't initialize gtk (cannot open display)";
|
||||
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER );
|
||||
gtk_widget_set_size_request(window,468,-1);
|
||||
gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS );
|
||||
gtk_widget_set_size_request(window,-1,-1);
|
||||
gtk_window_set_deletable( GTK_WINDOW(window), FALSE );
|
||||
gtk_window_set_resizable(GTK_WINDOW(window),FALSE);
|
||||
gtk_window_set_role( GTK_WINDOW(window), "sm-startup" );
|
||||
|
||||
@@ -214,10 +214,11 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew
|
||||
/* Set the pixel format. */
|
||||
if( !SetPixelFormat(GraphicsWindow::GetHDC(), iPixelFormat, &pixfmt) )
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
/* Destroy the window. */
|
||||
DestroyGraphicsWindowAndOpenGLContext();
|
||||
|
||||
return werr_ssprintf( GetLastError(), "Pixel format failed" );
|
||||
return werr_ssprintf( err, "Pixel format failed" );
|
||||
}
|
||||
|
||||
DescribePixelFormat( GraphicsWindow::GetHDC(), iPixelFormat, sizeof(g_CurrentPixelFormat), &g_CurrentPixelFormat );
|
||||
@@ -232,15 +233,17 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew
|
||||
g_HGLRC = wglCreateContext( GraphicsWindow::GetHDC() );
|
||||
if ( g_HGLRC == nullptr )
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
DestroyGraphicsWindowAndOpenGLContext();
|
||||
return hr_ssprintf( GetLastError(), "wglCreateContext" );
|
||||
return hr_ssprintf( err, "wglCreateContext" );
|
||||
}
|
||||
|
||||
g_HGLRC_Background = wglCreateContext( GraphicsWindow::GetHDC() );
|
||||
if( g_HGLRC_Background == nullptr )
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
DestroyGraphicsWindowAndOpenGLContext();
|
||||
return hr_ssprintf( GetLastError(), "wglCreateContext" );
|
||||
return hr_ssprintf( err, "wglCreateContext" );
|
||||
}
|
||||
|
||||
if( !wglShareLists(g_HGLRC, g_HGLRC_Background) )
|
||||
@@ -252,8 +255,9 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew
|
||||
|
||||
if( !wglMakeCurrent( GraphicsWindow::GetHDC(), g_HGLRC ) )
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
DestroyGraphicsWindowAndOpenGLContext();
|
||||
return hr_ssprintf( GetLastError(), "wglCreateContext" );
|
||||
return hr_ssprintf( err, "wglCreateContext" );
|
||||
}
|
||||
}
|
||||
return RString(); // we set the video mode successfully
|
||||
@@ -268,8 +272,9 @@ void LowLevelWindow_Win32::BeginConcurrentRendering()
|
||||
{
|
||||
if( !wglMakeCurrent( GraphicsWindow::GetHDC(), g_HGLRC_Background ) )
|
||||
{
|
||||
LOG->Warn( hr_ssprintf(GetLastError(), "wglMakeCurrent") );
|
||||
FAIL_M( hr_ssprintf(GetLastError(), "wglMakeCurrent") );
|
||||
DWORD err = GetLastError();
|
||||
LOG->Warn( hr_ssprintf(err, "wglMakeCurrent") );
|
||||
FAIL_M( hr_ssprintf(err, "wglMakeCurrent") );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user