Jump to content
  • Advertisement
Sign in to follow this  
Koshmaar

SDL multi window API

This topic is 4813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Today Bob Pendelton has sent to SDL mailinglist mail with the documentation of current state of multi window API, that will be available in SDL 2.0. "Here is my latest API document: > > SDL Multiple Window API > Data Type > struct SDL_PrivateWindow; > typedef struct SDL_PrivateWindow *SDL_Window; > > > SDL_Window SDL_OpenWindow(int width, int height, int bitsperpixel, > Uint32 flags) > > Create a new top level window. The flags may be any flags that are legal > for a call to SDL_SetVideoMode() and are subject to the same > restrictions. Unlike SDL_SetVideoMode() this function fails if the > requested window is not supported by the hardware. The available video > modes for a new window may be restricted by the video mode set for the > first window. Returns NULL on failure. If a hardware or software surface > is requested it must be retrieved by a call to SDL_GetWindowSurface(). > > > SDL_Surface *SDL_GetWindowSurface() > > Get the video surface for the current hardware or software window. > > > SDL_Window SDL_OpenChildWindow(SDL_Window parent, int x, int y, int > width, int height) > > Create a child window of an existing window. The x and y location is > relative to the upper left hand corner of the parent window. The child > window will have the same depth and other properties as the parent > window. > > > void *SDL_GetWindowData(SDL_Window w) > void *SDL_SetWindowData(SDL_Window w, void *data) > > Store and retrieve the data stored with a window. This allows the > programmer to associate data with a window. > > > SDL_Window SDL_GetParentWindow(SDL_Window child) > > Returns the window ID of the parent window. If the window is a top level > window then it returns NULL; > > > SDL_Window SDL_GetFirstChildWindow(SDL_Window parent, Uint32 *index) > SDL_Window SDL_GetNextChildWindow(SDL_Window parent, Uint32 *index) > > This functions are used to access the children of a specific window. > They return the window ID of each child window. The order in which the > are returned is not necessarily the order in which the were created and > can change. Deleting or creating windows betweens calls to these > functions can change the order and cause some children to be skipped. > Both functions return NULL if all children have been examined. The index > parameter contains state information used by these functions and allows > them to be used in recursive functions that traverse a complete window > tree. Under no circumstances should the index value be relied upon to > have a specific value and it should never be changed by the programmer. > > If NULL is passed as the parent parameter then these functions access > the top level windows, i.e. the windows which have no parent. > > Example: > > SDL_Window w = NULL; > Uint32 index; > > for ( w = SDL_GetFirstChildWindow(parent, &index); > w != NULL; > w = SDL_GetNextChildWindow(parent, &index) ) { > /* do something with w */ > } > > void SDL_CloseWindow(SDL_Window w) > > Removes a window from the screen and deletes everything associated with > the window. Works on top level windows and on child windows. All but one > top level window may be freed using this functions. Closing the last top > level window is the same as calling SDL_VideoQuit(); > > > int SDL_SelectWindow(SDL_Window w) > > Many SDL functions, especially the SDL_WM functions, SDL_Flip(), > SDL_GL_SwapBuffers(), and all OpenGLfunctions, work only on the video > window returned by SDL_SetVideoMode(). To avoid the need to create > dozens of new functions SDL_SelectWindow() is used to select the current > default window. > > > int SDL_WM_RaiseWindow() > > If possible, raise the window so that it is above all other windows. > > > int SDL_WM_LowerWindow() > > If possible, lower the window so that it is lower all other windows. > > > int SDL_WM_HideWindow() > int SDL_WM_ShowWindow() > > These two functions are used to hide or display a window. This > capability is particularly important for subwindows that are used for > menus and pop ups. They make the current window disappear or appear on > the screen. When a window is shown an expose event will be generated for > that window. You may not hide the main window. The main window may be > iconified but not hidden. > > > int SDL_WM_DeiconifyWindow() > Restore a window that has been iconified. > > > int SDL_WM_MoveWindow(int x, int y) > > Move the window to a new position. If it is a sub window the location is > relative to the upper left hand corner of the parent window. If it is a > top level window then it is moved relative to the upper left hand corner > of the screen. This function may have no effect on top level windows > because the window manager may override the request. > > > int SDL_WM_ResizeWindow(int width, int height); > > Change the windows size without changing anything else about the window. > After calling this function the new video surface must be retrieved with > a call to SDL_GetWindowSurface()." Probably someone will have suggestions, and I think that it's better to inform Bob sooner than later about possible improvements / problems with this API - and that's the reason why I have posted it here :-) feel free to comment.

Share this post


Link to post
Share on other sites
Advertisement
There's no strict SDL roadmap, but there's TODO file (probably deprecated, but...) on the CVS:

Wish list for the 1.3 development branch:

* Use /etc/fb.modes, if available, like GGI does
* Add mousewheel events (new unified event architecture?)
* DirectInput joystick support needs to be implemented
* Be able to enumerate and select available audio and video drivers
* Fullscreen video mode support for MacOS X
* Explicit vertical retrace wait (maybe separate from SDL_Flip?)
* Shaped windows, windows without borders
* Multiple windows, multiple display support
* SDL_INIT_EVENTTHREAD on Windows and MacOS?
* Add a timestamp to events
* Use RDTSC for timer resolution on x86 hardware
* Add audio input API
* Add hardware accelerated scaled blit
* Add hardware accelerated alpha blits
* Redesign blitting architecture to allow blit plugins


Now Bob Pendelton confirmed that for multiple windows we will have to wait for SDL 2.0. Also, IIRC Stephane Marchesin is currently writing SDL audio input API, and there's already sth working (on CVS).

Share this post


Link to post
Share on other sites
Quote:

* Add hardware accelerated scaled blit
* Add hardware accelerated alpha blits
* Redesign blitting architecture to allow blit plugins

Hallelujah! Is there any date set?

And, BTW, mouse wheel events are already seem to be supported (see this thread).

Share this post


Link to post
Share on other sites
Yes, there's a date set - "when it's done" [lol]

Btw, for 1.3 there's also planned integration of glSDL (OpenGL accelerated backend) to regular SDL and maybe also little improvements to SDL_RWops.

As for the scaling - once I suggested to create sth like SDL_BlitSurfaceEx, but someone explained that's impossible, since scaling would be easily available only on glSDL, and on other platforms someone would have to write all those super duper optimized functions for scaled blitting for every possible combination of depth (or sth like that), which would open a Pandora's box :-/. And IIRC, yes - mouse wheels already are controlled by events, so it looks like that list is slightly outdated [embarrass]

Share this post


Link to post
Share on other sites
Yes, mailing list archieves ;-) They're on the official SDL site, search in last month, there were pretty much glSDL mails out there.

Share this post


Link to post
Share on other sites
I read the same entries in the mailing list today. I like the enthusiasm but it sounds like it is still a long ways off. I still can't seem to find any real work being done on the 1.3 branch of SDL so it is hard for me to get too excited over something that might be a year or more away. I am not saying that when it does happen I won't be just as enthusiastic as everyone else, I just don't think my current projects will wait that long.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!