mirror of
https://github.com/yawut/SDL.git
synced 2026-10-02 21:26:41 -05:00
a77544ac3d39122d6aa979b38d913c58f609626e
cjj_009@yahoo.com 2009-12-14 20:32:35 PST I've been working on an SDL/OpenGL program, that among other things, must deal with resizing events in order to adjust the aspect ratio. It doesn't always seem to get the SDL_VIDEORESIZE event when it should, causing the aspect ratio to not be adjusted as needed. I've run it in debug mode and made these observations: *When it initially starts up, if I maximize the window, it receives the SDL_VIDEORESIZE event as needed. *If, after starting up the the application and maximizing the window, I then restore the window by double clicking the title bar, it does NOT receive the SDL_VIDEORESIZE event. *I can repeat the last two steps, and it will get continue to get the SDL_VIDEORESIZE on the maximize but not get one on the restore. *If I then do a slight adjustment to the width or height of the window, it will get the SDL_VIDEORESIZE event. *From then on, if I do restore operations to the window, the SDL_VIDEORESIZE event will be caught properly. See http://forums.libsdl.org/viewtopic.php?t=5291 for additional information. vgvgf 2010-03-28 15:15:16 PDT Proposed patch for SDL_resize.c The width and height values stored in SDL_VideoSurface are the sizes of the video surface when it was created. So, when the window is rezised back to its creation size, the following condition will make the SDL_PrivateResize function stop, and the video resize msg won't be queued. if ( ! SDL_VideoSurface || ((w == SDL_VideoSurface->w) && (h == SDL_VideoSurface->h)) ) { return(0); } Sam Lantinga 2011-12-30 02:59:51 PST I'm okay with applying this patch, but be aware that the expected response to a resize message is that you call SDL_SetVideoMode() again with the new mode. This signals SDL that you're expecting the new size, and there may be other problems if you don't do this. --HG-- branch : SDL-1.2
Simple DirectMedia Layer
(SDL)
Version 1.2
---
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 Linux, Windows CE/95/98/ME/XP/Vista, BeOS,
MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX,
and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64,
RISC OS, SymbianOS, Nintendo DS, and OS/2, but these 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,
Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
Pike, Pliant, Python, Ruby, and Smalltalk.
This library is distributed under GNU LGPL version 2, which can be
found in the file "COPYING". This license allows you to use SDL
freely in commercial programs as long as you link with the dynamic
library.
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 is available in HTML format in "docs/index.html", and
a documentation wiki is available online at:
http://www.libsdl.org/cgi/docwiki.cgi
The test programs in the "test" subdirectory are in the public domain.
Frequently asked questions are answered online:
http://www.libsdl.org/faq.php
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)
Description
SDL2 for the Nintendo Wii U (build with "cmake [SDL source path] -DCMAKE_TOOLCHAIN_FILE=$WUT_ROOT/share/wut.toolchain.cmake -DCMAKE_INSTALL_PREFIX=$DEVKITPRO/portlibs/wiiu")
Languages
C
86.7%
Objective-C
3.9%
C++
2.8%
Shell
2.6%
Java
1.4%
Other
2.3%