No description
Find a file
Sam Lantinga f26e1bc175 Fixed bug 1897 - CPU spike on Windows with WM_EVENT and OpenGL
buckyballreaction

On some Windows systems, when switching from fullscreen to windowed mode in my game, the CPU will spike and the application never shows the window again.

See the part of the e-mail thread here:

http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-June/088626.html

I change the window by calling:

SDL_SetWindowFullscreen(gScreenInfo.sdlWindow, SDL_FALSE);
SDL_SetWindowSize(gScreenInfo.sdlWindow, sdlWindowWidth, sdlWindowHeight);

which you can see in our source:

https://code.google.com/p/bitfighter/source/browse/zap/VideoSystem.cpp#377

Then all of a sudden the application gets stuck in WIN_PumpEvents() in SDL_windowsevents.c.  I turned on WMMSG_DEBUG and found that there was an endless stream of WM_EVENT messages.  I also found that where WM_PAINT is being handled in the callback WIN_WindowProc(), ValidateRect is somehow not clearing, or it is persisting, the WM_EVENT message like it's supposed to (according to the docs).

This may be a hardware issue.  The issue has appeared on three different systems, one of them sporadically:
 - Windows XP SP3 running in VMware 9.0 (without VMWare 3D acceleration, but with the tools and drivers installed), Host: openSUSE 12.3 x86_64, NVidia NVS 3100M
 - Windows XP SP3 64bit running in VirtualBox, Host: Debian Wheezy (stable), Mobility Radeon HD 4100 (this was the sporadic one)
 - Windows 7 64 bit, Radeon 6770
2013-06-06 23:18:36 -07:00
acinclude We have to fix the DLL name convention on Windows every time... 2012-10-19 21:43:41 -07:00
android-project Added deactivated loading of SDL2_net to Java file. 2013-05-30 12:23:36 +02:00
build-scripts The standard fat gcc scripts work well with SDL 2.0 2013-06-01 12:53:06 -07:00
cmake Fix compilation with libX11 >= 1.5.99.902. 2013-06-02 20:20:18 +06:00
debian Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
include This patch isn't needed because you have the window and can do [nswindow contentView] yourself. 2013-06-05 21:31:22 -07:00
src Fixed bug 1897 - CPU spike on Windows with WM_EVENT and OpenGL 2013-06-06 23:18:36 -07:00
test Fixed building tests on iOS 2013-06-05 22:56:42 -07:00
VisualC Removed obsolete NoStdio configurations. 2013-06-05 22:35:13 -07:00
Xcode Add an OS X Shared library target 2013-05-30 10:02:26 -04:00
Xcode-iOS Fixed compiling iOS demos 2013-06-05 23:11:20 -07:00
.hgignore Need to generate aclocal.m4 when rebuilding configure, but we don't need to check it in. 2013-05-26 16:01:40 -07:00
.hgtags Tagging version before everything gets ripped out. 2010-05-09 17:00:56 -07:00
Android.mk Fixed bug 1606 - SDL does not implement SDL_GetPowerInfo() for Android. 2012-09-23 01:37:44 -07:00
autogen.sh Need to generate aclocal.m4 when rebuilding configure, but we don't need to check it in. 2013-05-26 16:01:40 -07:00
BUGS.txt Credits were truncated in a previous commit. 2013-05-27 21:44:16 -07:00
CMakeLists.txt Replaced Gnome screensaver hack with D-Bus messages to org.gnome.ScreenSaver. 2012-12-28 03:46:55 -05:00
configure Updated configure with Ryan's cygwin workaround 2013-06-04 22:13:06 -07:00
configure.in Fixed build on newer Cygwin installs. 2013-06-05 00:42:39 -04:00
COPYING.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
CREDITS.txt Credits were truncated in a previous commit. 2013-05-27 21:44:16 -07:00
INSTALL.txt Updated the installation instructions to cover all supported platforms 2013-05-26 12:42:46 -07:00
Makefile.in Renamed WhatsNew so it can be easily read on Windows 2013-05-26 12:43:03 -07:00
Makefile.minimal Made it possible to build SDL from a fresh checkout without any additional steps. 2011-02-16 02:37:09 -08:00
Makefile.pandora Removed /dev/dsp DMA audio target. 2011-07-24 03:37:13 -07:00
Makefile.psp Add PSP support 2013-03-17 20:07:02 +08:00
Makefile.wiz Removed /dev/dsp DMA audio target. 2011-07-24 03:37:13 -07:00
README-android.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-cmake.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-directfb.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-gesture.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-hg.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-ios.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-macosx.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-pandora.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-platforms.txt Updated supported platforms 2013-05-27 20:53:19 -07:00
README-porting.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-psp.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-SDL.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-touch.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-wince.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
sdl2-config.in Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2 2012-01-22 17:21:00 -05:00
sdl2.m4 Default the minimum required version to 2.0.0 2013-06-01 08:57:17 -07:00
sdl2.pc.in Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2 2012-01-22 17:21:00 -05:00
SDL2.spec.in Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
TODO.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
VisualC.html Updated VisualC.html for SDL 2.0 2013-05-26 13:06:54 -07:00
WhatsNew.txt Renamed WhatsNew so it can be easily read on Windows 2013-05-26 12:43:03 -07:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.

The current version supports Windows, Mac OS X, Linux, FreeBSD,
NetBSD, OpenBSD, BSD/OS, Solaris, iOS, and Android. The code contains
support for other operating systems but those are not officially supported.

SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
Go, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
Pike, Pliant, Python, Ruby, and Smalltalk.

This library is distributed under the zlib license, which can be found
in the file "COPYING".

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at:
	http://wiki.libsdl.org/

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)