Merge SDL-ryan-batching-renderer branch to default.

This commit is contained in:
Ryan C. Gordon
2018-10-31 15:03:41 -04:00
215 changed files with 5146 additions and 2712 deletions

View File

@@ -414,6 +414,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
case WM_NCACTIVATE:
{
/* Don't immediately clip the cursor in case we're clicking minimize/maximize buttons */
data->skip_update_clipcursor = SDL_TRUE;
}
break;
case WM_ACTIVATE:
{
POINT cursorPos;

View File

@@ -305,8 +305,6 @@ WIN_InitMouse(_THIS)
mouse->GetGlobalMouseState = WIN_GetGlobalMouseState;
SDL_SetDefaultCursor(WIN_CreateDefaultCursor());
SDL_SetDoubleClickTime(GetDoubleClickTime());
}
void

View File

@@ -33,31 +33,31 @@ struct SDL_GLDriverData
SDL_bool HAS_WGL_ARB_create_context_robustness;
SDL_bool HAS_WGL_ARB_create_context_no_error;
/* Max version of OpenGL ES context that can be created if the
implementation supports WGL_EXT_create_context_es2_profile.
major = minor = 0 when unsupported.
*/
struct {
int major;
int minor;
} es_profile_max_supported_version;
/* Max version of OpenGL ES context that can be created if the
implementation supports WGL_EXT_create_context_es2_profile.
major = minor = 0 when unsupported.
*/
struct {
int major;
int minor;
} es_profile_max_supported_version;
void *(WINAPI * wglGetProcAddress) (const char *proc);
HGLRC(WINAPI * wglCreateContext) (HDC hdc);
BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
const int *piAttribIList,
const FLOAT * pfAttribFList,
UINT nMaxFormats,
int *piFormats,
UINT * nNumFormats);
BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
int iLayerPlane,
UINT nAttributes,
const int *piAttributes,
int *piValues);
void *(WINAPI * wglGetProcAddress) (const char *proc);
HGLRC(WINAPI * wglCreateContext) (HDC hdc);
BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
const int *piAttribIList,
const FLOAT * pfAttribFList,
UINT nMaxFormats,
int *piFormats,
UINT * nNumFormats);
BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
int iLayerPlane,
UINT nAttributes,
const int *piAttributes,
int *piValues);
BOOL (WINAPI * wglSwapIntervalEXT) (int interval);
int (WINAPI * wglGetSwapIntervalEXT) (void);
};

View File

@@ -63,6 +63,15 @@ UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const
}
}
static void WIN_SuspendScreenSaver(_THIS)
{
if (_this->suspend_screensaver) {
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
} else {
SetThreadExecutionState(ES_CONTINUOUS);
}
}
/* Windows driver bootstrap functions */
@@ -136,6 +145,7 @@ WIN_CreateDevice(int devindex)
device->GetDisplayModes = WIN_GetDisplayModes;
device->SetDisplayMode = WIN_SetDisplayMode;
device->PumpEvents = WIN_PumpEvents;
device->SuspendScreenSaver = WIN_SuspendScreenSaver;
device->CreateSDLWindow = WIN_CreateWindow;
device->CreateSDLWindowFrom = WIN_CreateWindowFrom;

View File

@@ -40,7 +40,7 @@ int WIN_Vulkan_LoadLibrary(_THIS, const char *path)
{
VkExtensionProperties *extensions = NULL;
Uint32 extensionCount = 0;
Uint32 i;
Uint32 i;
SDL_bool hasSurfaceExtension = SDL_FALSE;
SDL_bool hasWin32SurfaceExtension = SDL_FALSE;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL;

View File

@@ -906,7 +906,11 @@ WIN_UpdateClipCursor(SDL_Window *window)
SDL_Mouse *mouse = SDL_GetMouse();
RECT rect;
if (data->focus_click_pending) {
if (data->in_title_click || data->focus_click_pending) {
return;
}
if (data->skip_update_clipcursor) {
data->skip_update_clipcursor = SDL_FALSE;
return;
}

View File

@@ -44,6 +44,7 @@ typedef struct
SDL_bool in_border_change;
SDL_bool in_title_click;
Uint8 focus_click_pending;
SDL_bool skip_update_clipcursor;
SDL_bool windowed_mode_was_maximized;
SDL_bool in_window_deactivation;
RECT cursor_clipped_rect;