Idea: SDL_uncommon

The idea of this library is to implement features not available on every platform as an SDL extension, purely made for assisting SDL on those particular systems to do some neat stuff (while maintaining the actual SDL API cross-platform).

Such an example would be one on the wishlist:

Support desktop windows

          setAttribute(Qt::WA_X11NetWmWindowTypeDesktop);
          setWindowFlags(Qt::SplashScreen);

          Qt::WindowFlags flags = 0;
              flags |= Qt::FramelessWindowHint;
              flags |= Qt::Tool;
              flags |= Qt::WindowStaysOnBottomHint;

I don’t think there’s a way to implement this similarly between Windows, OS X, and Linux/X11; which I believe we can agree is the main focus of compatibility for SDL.

However, we can easily make a non-standard function to create a desktop window:
SDL_Window* SDL_uncommon_CreateX11Desktop(Uint32 flags);
or better, simply define a new flag for it:
#define SDL_WINDOW_X11DESKTOP 0x00001000

Other examples might include improved integration with iPhone’s UIKit, rendering to the borders of the windows on Windows (and other systems supporting it), custom window button icons on Windows (and again, other systems supporting it), Windows shell integration; stuff like that.

Of course, one might ask why we wouldn’t simply use the system APIs? Well, this takes the need of converting from SDL’s structures to the system’s structures, searching through complicated low-level routine documentations and provides simpler functions providing the same functionality.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

I like the idea of SDL being able to integrate with the underlying window
system. But you’re right about features not being available on every
platform. You know, people have been talking about this for some time, with
different function names. There has got to be a way to do this without
making SDL as big as QT. No success, so far.
Fullscreen is the way to go with SDL. Fullscreen apps don’t need to be aware
of the desktop.
Thats the feeling I get.

On the other hand if I’m not developing a fullscreen app…the only thing I
really want that seems lacking from SDL, is the ability to create a window
anywhere. I just want an SDL peekhole with whatever is available/convenient.

Since this is an external library that only non-fullscreen apps will use, in
the interest of making these functions available quickly(or sometime this
year even), a gtk dependency might be sane. Its already cross-platform. Its
C. Its stable. This may sound like a backwards way of developing, adding
extra dependencies from start. At this point I just want to see what
multi-window, desktop-aware SDL even looks like.On Mon, Apr 19, 2010 at 7:20 PM, Nathaniel J Fries wrote:

The idea of this library is to implement features not available on every
platform as an SDL extension, purely made for assisting SDL on those
particular systems to do some neat stuff (while maintaining the actual SDL
API cross-platform).

Such an example would be one on the wishlist:

Quote:

Support desktop windows

setAttribute(Qt::WA_X11NetWmWindowTypeDesktop);
setWindowFlags(Qt::SplashScreen);

Qt::WindowFlags flags = 0;
flags |= Qt::FramelessWindowHint;
flags |= Qt::Tool;
flags |= Qt::WindowStaysOnBottomHint;

I don’t think there’s a way to implement this similarly between Windows, OS
X, and Linux/X11; which I believe we can agree is the main focus of
compatibility for SDL.

However, we can easily make a non-standard function to create a desktop
window:
SDL_Window* SDL_uncommon_CreateX11Desktop(Uint32 flags);
or better, simply define a new flag for it:
#define SDL_WINDOW_X11DESKTOP 0x00001000

Other examples might include improved integration with iPhone’s UIKit,
rendering to the borders of the windows on Windows (and other systems
supporting it), custom window button icons on Windows (and again, other
systems supporting it), Windows shell integration; stuff like that.

Of course, one might ask why we wouldn’t simply use the system APIs? Well,
this takes the need of converting from SDL’s structures to the system’s
structures, searching through complicated low-level routine documentations
and provides simpler functions providing the same functionality.


EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Jeremiah wrote:

I like the idea of SDL being able to integrate with the underlying window system. But you’re right about features not being available on every platform. You know, people have been talking about this for some time, with different function names. There has got to be a way to do this without making SDL as big as QT. No success, so far.?
Fullscreen is the way to go with SDL. Fullscreen apps don’t need to be aware of the desktop.?
Thats the feeling I get.

On the other hand if I’m not developing a fullscreen app…the only thing I really want that seems lacking from SDL, is the ability to create a window anywhere. I just want an SDL peekhole with whatever is available/convenient.

Since this is an external library that only non-fullscreen apps will use, in the interest of making these functions available quickly(or sometime this year even), a gtk dependency might be sane. Its already cross-platform. Its C. Its stable. This may sound like a backwards way of developing, adding extra dependencies from start.? At this point I just want to see what multi-window, desktop-aware SDL even looks like.

While you might have understood the more general use of the library, you clearly misunderstood the examples.

The first example, from the wishlist, is NOT for desktop-awareness. It is to create your own desktop window, such as for implementing an X11 desktop environment with SDL.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

Start down that path and you end with QT. SDL isn’t about creating OS-level windows with GUI widgets. There are other libraries for that. SDL is about creating multimedia apps, and particularly games, which don’t use OS widgets for their user interface.

While you might have understood the more general use of the library, you clearly misunderstood the examples.

The first example, from the wishlist, is NOT for desktop-awareness. It is to create your own desktop window, such as for implementing an X11 desktop environment with SDL.From: nfries88@yahoo.com (Nathaniel J Fries)
Subject: Re: [SDL] Idea: SDL_uncommon

Mason Wheeler wrote:

Start down that path and you end with QT. SDL isn’t about creating OS-level windows with GUI widgets. There are other libraries for that. SDL is about creating multimedia apps, and particularly games, which don’t use OS widgets for their user interface.

I agree that SDL is not for OS-level windows and widgets, and definitely don’t want it to become like Qt.
However, SDL would actually make a great platform for such a thing on an OS oriented at gaming. Think about it, plenty of games already use SDL - why not use it for your native toolkit, as kde does Qt.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

I guess I did misunderstand. I saw “QT” in the example and then afterwords
you mentioned integration into the iphone uikit. I thought you were just
throwing that example in your post to show what could be part of the full
blown “SDL-uncommon” library. I had no idea you only wanted one function.On Tue, Apr 20, 2010 at 7:55 PM, Nathaniel J Fries wrote:

Jeremiah wrote:

While you might have understood the more general use of the library, you
clearly misunderstood the examples.

The first example, from the wishlist, is NOT for desktop-awareness. It is
to create your own desktop window, such as for implementing an X11 desktop
environment with SDL.


EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Jeremiah wrote:

I guess I did misunderstand. I saw “QT” in the example and then afterwords you mentioned? integration into the iphone uikit. I thought you were just throwing that example in your post to show what could be part of the full blown “SDL-uncommon” library. I had no idea you only wanted one function.

No, the idea is not for just one function.

It’s for anything useful to some SDL apps that is not available without having to touch SDL’s internal structures and minimal use of system specific code, but that is not available on all major platforms. Such as an application that doesn’t use SDL for cross-platform development, but rather for simpler development on a single platform.

michelleC’s iPhone issues and the proposed desktop window attribute were just two examples that came to mind. The ability to render to the edges of windows on the Windows system was also another thing that came to mind.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

While I agree that these are uncommon uses on the whole, they are extremely useful for some people, and SDL is not aimed at only the majority of users, even if there are only one or two people who
need a feature, it may be essential to them, and SDL could be unusable for them without it.

Furthermore there is no association between these special features so shoveling them into one pile of uncommon features in an external library would be like putting a dozen random things in a pile,
they have no relation, yet each has a use to someone.

One could consider conditional compilation and inherently incompatible APIs across platforms for these uncommon features - for example, anything iPhone specific would not even be present in headers
when compiling SDL on another platform - there is no reason for them to even have a proper “standardized” ABI across platforms when they are platform-specific by nature, stubbing them out on all other
platforms would be a waste of time and not yield a correct behavior anyway.

To assist in use of such features, it would be worthwhile to add some #define’s that occur on these platforms which the application can check for availability of features (much like OpenGL extensions
available in the headers can be detected by #ifdef in the application), this would allow these features to be available on multiple platforms when possible, without the application having to check
which platform it is on in most cases.

For example touch screen features are useful on several platforms, but if the application checks whether touch screen features are appropriate on this platform (via #ifdef) it can redesign its UI
accordingly by platform without being especially aware of which platform it is on.On 04/21/2010 05:55 PM, Nathaniel J Fries wrote:

Jeremiah wrote:

I guess I did misunderstand. I saw “QT” in the example and then
afterwords you mentioned integration into the iphone uikit. I thought
you were just throwing that example in your post to show what could be
part of the full blown “SDL-uncommon” library. I had no idea you only
wanted one function.

No, the idea is not for just one function.

It’s for anything useful to some SDL apps that is not available without
having to touch SDL’s internal structures and minimal use of system
specific code, but that is not available on all major platforms. Such as
an application that doesn’t use SDL for cross-platform development, but
rather for simpler development on a single platform.

michelleC’s iPhone issues and the proposed desktop window attribute were
just two examples that came to mind. The ability to render to the edges
of windows on the Windows system was also another thing that came to mind.


EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier