src/video/windows


Log

Author Commit Date CI Message
Sam Lantinga b677d1d8 2014-03-10T19:59:06 Fixed Mac OS X OpenGL context creation to match other backends, where we only care about the actual version we request if it's 3.0 or newer or a special profile context. Eventually we'll probably move the version checking to higher level code and report the actual version of context that got created, but to avoid breakage we'll leave it like this for now.
Ryan C. Gordon db568d69 2014-03-09T11:52:52 Patched to compile with MingW64 on case-sensitive systems (thanks, Martin!). Fixes Bugzilla #2440.
Sam Lantinga 54ba385b 2014-03-01T11:42:12 Fixed compiler warning
Sam Lantinga 86655b64 2014-03-01T11:40:41 Fixed compiler warning
Sam Lantinga c916f388 2014-03-01T09:59:06 Fixed bug 2368 - Security Software is blocking RegisterRawInputDevices() Yamagi A customer of mine had the strange problem, that SDL_SetRelativeMouseMode() was failing for him on Windows 7. Luckily he was willing to provide some debug informations. We could track this problem down to RegisterRawInputDevices() failing due to security software running on his system (Norton Internet Security to be precise, but there are reports of similar problems with other products. For example [1]). Working around this issue with SDL_WarpMouseInWindow() is easy, and while I don't think that SDL2 can provide an internal workaround it would be really nice and helpfull if this could be documentated somewhere. 1: http://forums.codeguru.com/showthread.php?498374-How-to-run-a-very-long-SQL-statement
Sam Lantinga b420ad0e 2014-02-24T23:09:35 Don't warp the mouse while we're doing a modal interaction
Sam Lantinga 2a6213ad 2014-02-24T22:49:30 Make sure we don't clip the cursor while clicking on the window title bar
Sam Lantinga 973d890b 2014-02-24T22:37:58 Fixed relative mouse mode with multiple windows. The window cursor clipping will be taken care of when SDL_UpdateWindowGrab() is called.
Sam Lantinga 54debf84 2014-02-24T22:36:24 Added a bunch of missing windows messages
Sam Lantinga b80f4f9e 2014-02-22T17:39:35 Don't fail initialization if the helper window class already exists.
Sam Lantinga 5c5770ad 2014-02-14T11:39:58 Make sure we don't stay in the windows event loop forever if there are lots of events coming in quickly.
Sam Lantinga c52c9105 2014-02-13T11:05:30 Added SDL_DXGIGetOutputInfo which returns the adapter and output indices that are used to create DX10 and DX11 devices and swap chains on a particular display. CR: SamL
Sam Lantinga e34da680 2014-02-13T11:05:28 Fixed lost mouse button when in relative mouse warp mode and you click on the title bar, entering a modal move/resize loop. Testing: * Set the SDL_HINT_MOUSE_RELATIVE_MODE_WARP hint true, run testsprite2, press Ctrl-R to enter relative mode, alt tab away from the window, then click on the title bar of the window. Didn't get the mouse button release before, and we do now. CR: Yahn + Alfred
Sam Lantinga a396841f 2014-02-10T10:02:18 Fixed bug where a window created fullscreen and hidden would get activated and "shown" but never actually be visible. This is the case with the Steam In-Home Streaming client.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Sam Lantinga d76c2cc1 2014-01-30T12:30:40 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
Sam Lantinga dbd4a917 2014-01-30T12:27:24 Document Michael's changes adding TranslateMessage() back to the SDL message loop.
Sam Lantinga 5c58bd68 2014-01-30T12:27:00 * 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 b44e7470 2013-12-30T12:49:15 Fixed display mode calculations for applications which are not DPI aware. If your application wants to have access to the full resolution even when the system has DPI scaling enabled, call SetProcessDPIAware() before calling SDL_Init() e.g. typedef BOOL (WINAPI *SetProcessDPIAware_t)(void); HMODULE hMod = LoadLibrary("user32.dll"); if ( hMod ) { SetProcessDPIAware_t pSetProcessDPIAware = GetProcAddress( hMod, "SetProcessDPIAware" ); if ( pSetProcessDPIAware ) { pSetProcessDPIAware(); } FreeLibrary( hMod ); }
Sam Lantinga 6f6c76a6 2013-12-27T10:18:18 Make sure our window has mouse focus before processing raw input events. This happens rarely, but not reproducibly, where we get raw input events for the window even though it doesn't have focus.
Philipp Wiesemann 87ad7a1c 2013-12-25T16:57:59 Fixed pointer from integer warning and bug if compiled without EGL.
Sam Lantinga 2521e497 2013-12-23T17:55:06 Setting the mouse in relative mode implies grabbing the mouse. This fixes getting mouse button events in raw input relative mode on X11.
Sam Lantinga 7aef2350 2013-12-23T17:37:22 Added a relative mouse mode that uses mouse warping instead of raw input. To enable this, set the environment variable SDL_MOUSE_RELATIVE_MODE_WARP to "1" When mouse relative mode is disabled, put the cursor back where the application expects it to be, instead of where it was when relative mode was enabled.
Sam Lantinga 74692835 2013-12-23T12:17:52 Added support for double-clicks, through a new "clicks" field in the mouse button event.
Sam Lantinga 7afb7682 2013-12-05T09:29:04 Added code missed in the resolve
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
Sam Lantinga 9fa4da13 2013-11-28T02:31:32 Fixed windows build with conflict resolve
Sam Lantinga d2511d9e 2013-11-27T10:29:38 Fixed bug 2260 - SDL_SetCursorGrab() is buggy on Windows BurnSpamAddress Steps to reproduce: 1. Grab the cursor with SDL_SetCursorGrab() 2. Alt-tab away from the window 3. Click on the titlebar of the window This will cause the window to disappear underneath the taskbar! This appears to be a general issue with ClipCursor() on windows, i.e. I am getting the same behavior if I call ClipCursor() directly. It is caused by a feedback loop between the ClipCursor function and the modal resize/move event loop that handles mouse-based sizing on Windows.
Sam Lantinga fa4e4a64 2013-11-27T10:29:32 Fixed large relative mouse motion when iconifying the SDL window. Windows will move the window to -32000,-32000 when it is iconified, so we don't want to send mouse motion for iconic windows.
Sam Lantinga 2bb344d6 2013-11-27T10:29:27 Don't crash when no WM is present. CR: Sam Lantinga.
Ryan C. Gordon 7e1289af 2013-11-24T23:56:17 Make internal SDL sources include SDL_internal.h instead of SDL_config.h The new header will include SDL_config.h, but allows for other global stuff.
Philipp Wiesemann 01acbd38 2013-11-23T18:34:27 Fixed spaces in license comment.
Gabriel Jacobo 4abeed93 2013-11-22T14:19:52 Fixes compilation on Mingw.
Gabriel Jacobo 61959aa6 2013-11-22T13:24:53 OpenGL ES support for Windows
Gabriel Jacobo 5b8b403e 2013-11-13T11:18:37 [Windows] Fixes bug #1555, handle ALT+F4 on Windows
Sam Lantinga e19f15dd 2013-11-10T14:10:00 Fixed bug 2067 - Window size limit calculation issue when exiting fullscreen on Windows Also fixed minimize and maximize state detection for Windows.
Sam Lantinga 976c8769 2013-11-08T14:05:23 Fixed bug 2172 - Window loses maximized state when activated I still haven't figured out why my application is being minimized when I try to raise, it but my previous workaround is causing issues. For now the correct way to raise and/or restore the window is as follows: if ( !(SDL_GetWindowFlags( window ) & SDL_WINDOW_MINIMIZED) ) { SDL_RaiseWindow( window ); } if ( SDL_GetWindowFlags( window ) & SDL_WINDOW_MINIMIZED ) { SDL_RestoreWindow( window ); } I will investigate the window state change rules more fully in the future. CR: Alfred Reynolds
Sam Lantinga 48e44f7f 2013-11-06T23:59:24 Fixed Windows compile error
Sam Lantinga 3b050fc9 2013-11-06T23:35:08 Horizontal wheel support in windows Lorenzo Pistone this patch adds support for the horizontal wheel in Windows. It is shamelessly copied off the vertical wheel code, but I guess that that is a value added in consistency.
Sam Lantinga b8b9bfbe 2013-10-21T01:16:16 Fixed some warnings building for 64-bit Windows
Sam Lantinga 360c3d85 2013-10-21T00:15:24 Better cleanup if OpenGL initialization fails
Ryan C. Gordon 0e699eb5 2013-10-20T21:18:05 Added SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (thanks, David!). Fixes Bugzilla #1985.
Sam Lantinga 888d807a 2013-10-17T23:05:40 Removed redundant #ifdef
Sam Lantinga 12ca3ce3 2013-10-17T23:02:29 Fixed building using MinGW Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
Sam Lantinga 6435a82d 2013-10-14T09:12:30 Backed out revision fb5ab0e91c56, the platform specific messagebox functions don't have the right prototype since they're designed to be used standalone.
Sam Lantinga 4b603abf 2013-10-14T08:56:55 For some reason, trying to raise the window programmatically while it's alt-tabbed away will minimize it. Added a workaround for this.
Sam Lantinga fea2699c 2013-10-14T08:56:50 Fixed the windows message debug output so it works without HAVE_LIBC
Sam Lantinga 8ec3ba38 2013-10-13T19:59:40 Fixed accumulating mouse wheel motion for the Microsoft Wireless Mouse 5000
Sam Lantinga 8fbd7dc7 2013-10-03T00:54:58 Fixed bug 2130 - Two members of Windows WindowData not initialized norfanin SetupWindowData in SDL_windowswindow.c doesn't initialize two members of SDL_WindowData with NULL. This is an issue because other parts of the SDL code seem to make the assumption that this is the case. WIN_DestroyWindowFramebuffer for example uses data->mdc and data->hbm if they're not NULL.
Sam Lantinga 9f390e79 2013-09-28T14:06:59 Moved SDL_Direct3D9GetAdapterIndex() to SDL_windowsvideo.c since it doesn't belong in the window code.
Sam Lantinga b6be1435 2013-09-28T14:06:20 Moved D3D_LoadDLL and SDL_Direct3D9GetAdapterIndex to SDL_windowswindow.c at Jorgen's insistence. That file is wrapped in a more appropriate define check so it will work if somebody builds a binary without D3D support. Added a reference to SDL_Direct3D9GetAdapterIndex to SDL_test_common.c so SDL will fail to compile if the new symbol isn't included properly. CR: Jorgen
Sam Lantinga e07d7e64 2013-08-29T08:30:21 Christoph Mallon: Replace strlen(x) == 0 (O(n)) by x[0] == '\0' (O(1)).
Sam Lantinga f79fc33a 2013-08-29T08:29:21 Christoph Mallon: Remove pointless if (x) before SDL_free(x)
Gabriel Jacobo 1e49b1ed 2013-08-21T09:47:10 OCD fixes: Adds a space after /* (glory to regular expressions!)
Gabriel Jacobo 695344d1 2013-08-21T09:43:09 OCD fixes: Adds a space before */
Gabriel Jacobo 552b04c5 2013-08-20T20:34:40 More non C89 compliant comments
Sam Lantinga 9ab14aa5 2013-08-16T17:50:44 Fixed windows build
Sam Lantinga ff77ca8d 2013-08-16T15:38:06 The keyboard text events should be sent after the key down events
Sam Lantinga b4b12d95 2013-08-16T15:35:10 Fixed bug 1876 - SDL_TEXTINPUT only returns '?' (0x3F) in event.text.text with Khmer language input Andreas The issue comes down to this line on MSDN: "TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver." "WM_KEYDOWN and WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message. WM_SYSKEYDOWN and WM_SYSKEYUP combinations produce a WM_SYSCHAR or WM_SYSDEADCHAR message." Except for WM_CHAR, none of these messages are used in SDL. Hence TranslateMessage should be dropped entirely and proper handling be included in the WM_KEYDOWN event. Currently TranslateMessage is called for every message even if it must not be called in certain cases (like "An application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value."). WM_CHAR message handling should remain for external processes posting these messages - additionally, WM_UNICHAR should be added. I made a patch for src/video/windows/SDL_windowsevents.c that seems to work fine. It doesn't solve the "missing" composition for Khmer, but at least input for languages that cannot be mapped to ASCII characters (and for which IME is not used) will now work on Windows.
Gabriel Jacobo dad42067 2013-08-12T11:13:50 Fixes #2022, do not resume on Android when surfaceChanged If the app is in landscape mode and the user presses the power button, a pause is followed immediately by a surfaceChanged event because the lock screen is shown in portrait mode. This triggers a "false" resume. So, we just pause and resume following the onWindowFocusChanged events. Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before blocking the event pump.
Sam Lantinga 1ad936eb 2013-08-11T19:56:43 Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() Rainer Deyke I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.
Sam Lantinga 1df1e696 2013-07-14T11:28:44 Added the platform specific messagebox function to the video function list