Wed, 29 Jan 2014 18:38:13 -0800Add SDL_GL_ResetAttributes.
Jørgen P. Tjernø <jorgen@valvesoftware.com> [Wed, 29 Jan 2014 18:38:13 -0800] rev 8145
Add SDL_GL_ResetAttributes.

Thu, 30 Jan 2014 12:30:40 -0800Add a new hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that allows SDL_CreateWindowFrom() to set the pixel format of another SDL_Window (and also will set the SDL_WINDOW_OPENGL flag on the window created with SDL_CreateWindowFrom()).
Sam Lantinga <slouken@libsdl.org> [Thu, 30 Jan 2014 12:30:40 -0800] rev 8144
Add a new hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that allows SDL_CreateWindowFrom() to set the pixel format of another SDL_Window (and also will set the SDL_WINDOW_OPENGL flag on the window created with SDL_CreateWindowFrom()).

The reasoning behind this change is that source2 in -tools mode has a single OpenGL context that is used with multiple different windows. Some of those windows are created outside the engine (i.e. with Qt) and therefore we need to use SDL_CreateWindowFrom() to get an SDL_Window for those. The requirement for sharing an OpenGL context across multiple different windows is that each window has the same pixel format. To facilitate this, I now set SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT for the main window before calling SDL_CreateWindowFrom(). When I do this, SDL_CreateWindowFrom() will:

1. Set the pixel format of the returned window to the same pixel format as this SDL_Window passed in with the hint
2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for OpenGL rendering.

I only currently implemented this for Win32/WGL so implementing it for other platforms (i.e. X11) remains a TODO.

CR: SamL

Some pseudocode that shows how this is used in Source2:

HWND hExternalHwnd; // HWND that was established outside of SDL

// Create main window (happens inside platwindow.cpp)
SDL_Window *mainWindow = SDL_CreateWindow( , SDL_WINDOW_OPENGL .. );
// Create GL context, happens inside rendersystemgl
SDL_GLContext onlyContext = SDL_GL_CreateContext( mainWindow );

// Now I need to create another window from hEternalHwnd for my swap chain that will have the same pixel format as mainWindow, so set the hint
SDL_SetHint( SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT, CFmtStr( %p, mainWindow) );

// Create the secondary window. This returned window will have SDL_WINDOW_OPENGL set and share a pixel format with mainWindow from the hint
SDL_Window *secondaryWindow = SDL_CreateWindowFrom( hExternalHwnd );

// To render to the main window:
SDL_GL_MakeCurrent( mainWindow, onlyContext );
// Do some rendering to main window

// To render to the secondary window:
SDL_GLMakeCurrent( secondaryWindow, onlyContext );
// Do some rendering to secondary window

Thu, 30 Jan 2014 12:27:24 -0800Document Michael's changes adding TranslateMessage() back to the SDL message loop.
Sam Lantinga <slouken@libsdl.org> [Thu, 30 Jan 2014 12:27:24 -0800] rev 8143
Document Michael's changes adding TranslateMessage() back to the SDL message loop.

Thu, 30 Jan 2014 12:27:00 -0800* Added TranslateMessage call to SDL default message pump - was causing problems in S2 tools mode apps that used Qt. Qt relies on the WM_CHAR message generated by TranslateMessage and keyboard input was showing up in the UI as mixed-case. (Depending on which message pump got a given message - both SDL and Qt pump messages for the entire process.) Sam will review and possibly tweak this change before propagating to public SDL, but I'm checking this version in so I can integrate into S2 and fix the issue there.
Sam Lantinga <slouken@libsdl.org> [Thu, 30 Jan 2014 12:27:00 -0800] rev 8142
* Added TranslateMessage call to SDL default message pump - was causing problems in S2 tools mode apps that used Qt. Qt relies on the WM_CHAR message generated by TranslateMessage and keyboard input was showing up in the UI as mixed-case. (Depending on which message pump got a given message - both SDL and Qt pump messages for the entire process.) Sam will review and possibly tweak this change before propagating to public SDL, but I'm checking this version in so I can integrate into S2 and fix the issue there.

Wed, 29 Jan 2014 18:37:23 -0800Mac: [NSApp keyWindow] is not valid in windowDidBecomeKey:
Jørgen P. Tjernø <jorgen@valvesoftware.com> [Wed, 29 Jan 2014 18:37:23 -0800] rev 8141
Mac: [NSApp keyWindow] is not valid in windowDidBecomeKey:

This fixes weird behavior on Mac where our first responder reverts to the window
itself, rather than the SDLTranslatorResponder, after the window has lost focus
once. This causes Escape to call cancelOperation: on the NSWindow, which by
default removes our fullscreen-ness.

When someone has turned off SDL_TEXTINPUT we should probably set another initial
responder that handles the Escape behavior, so that SDL_TEXTINPUT doesn't change
fullscreen behavior (and possibly other behavior) like it does now.

Tue, 28 Jan 2014 15:28:20 -0800fixed hat code validation.
dbrady <dbrady@telltalegames.com> [Tue, 28 Jan 2014 15:28:20 -0800] rev 8140
fixed hat code validation.

Wed, 29 Jan 2014 00:29:14 +0100Fixed spaces in source file license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de> [Wed, 29 Jan 2014 00:29:14 +0100] rev 8139
Fixed spaces in source file license comment.

Wed, 29 Jan 2014 00:27:54 +0100Fixed comments in joystick implementation files claiming to be headers.
Philipp Wiesemann <philipp.wiesemann@arcor.de> [Wed, 29 Jan 2014 00:27:54 +0100] rev 8138
Fixed comments in joystick implementation files claiming to be headers.

It seems comments were originally copied from SDL_sysjoystick.h.

Tue, 28 Jan 2014 12:42:01 -0500Move to no-argument version of "endif()" in CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org> [Tue, 28 Jan 2014 12:42:01 -0500] rev 8137
Move to no-argument version of "endif()" in CMakeLists.txt.

Tue, 28 Jan 2014 12:37:04 -0500Some CMake fixes for static linking on Windows from the OpenFL project.
Ryan C. Gordon <icculus@icculus.org> [Tue, 28 Jan 2014 12:37:04 -0500] rev 8136
Some CMake fixes for static linking on Windows from the OpenFL project.