mentby.com
Blog | Jobs | Help | Signup | Login

Hi,

          Is it possible to get multiple SDL surface, for a single
process...??
I tried to get it, using pthreads, but it failed... Then i did using
fork(), so I think, I can get as many screen as I want, but for a
process, only one screen I am getting..?? Is there any alternative way
for getting many screens in a single process.?

Please guide me !!

--
Lohitha R


Lohitha R Thu, 13 May 2010 03:36:45 -0700

If you want multiple windows/screen surfaces, then you have to use SDL 1.3.
It has a different API to handle this.  If you just want multiple surfaces,
then use SDL_CreateRGBSurface or SDL_LoadBMP, etc.

Jonny D


Jonathan Dearborn Thu, 13 May 2010 05:55:35 -0700

Hello,

as somebody else tried to explain. With SDL 1.2 you're currently using  
this is not possible. What you can do here is to make a one bigger on-
screen surface that will fit 4 off-screen surface that you can blit to  
this one. However I guess all of those are just software surfaces and  
it's going to be slow.

With SDL 1.3 that you need to compile yourself from HG repository you  
could be able to open 4 windows for 4 video playbacks. Or you can use  
one bigger video surface in 1 window again and do the playback using  
OpenGL textures.

Pavel

---
Pavel Kanzelsberger http://www.kanzelsberger.com
E-Mail: pavel*******
Jabber: kanzelsberger*******, ICQ: 20990633


Pavel Kanzelsberger Thu, 13 May 2010 07:10:29 -0700

_______________________________________________
SDL mailing list
SDL*******


Lohitha R Thu, 13 May 2010 07:15:33 -0700

Hi, Lohitha,
There seems to be some confusion about your question, so I'm going to take a
crack at this.
What you are saying is that you are using one Gtk window, and one SDL
instance with multiple SDL_surface's, each one displays a video.
It looks like  http://sdl.beuc.net/sdl.wiki/FAQ_GUI  has some answers as to
how to blit a SDL_surface onto a GtkDrawable widget.  This is probably your
best bet, and it won't require you to use SDL_SetVideoMode() because SDL
isn't running the window, Gtk is.
You should be able to use a GtkDrawable as an array ( GtkDrawable
*videos[rows][cols]; ) and associate your buttons the same way.

I hope that helps,
-Alex


Alex Barry Thu, 13 May 2010 07:50:32 -0700

Oh, I just got the update that you may just use one big SDL screen divided
up - I did this search on libsdl's website: http://www.libsdl.org/libraries.php?order=name&category=[..]
Maybe something from there helps?


Alex Barry Thu, 13 May 2010 07:53:44 -0700

_______________________________________________
SDL mailing list
SDL*******


Lohitha R Thu, 13 May 2010 07:59:14 -0700

It would be as fast as SDL can blit to a GtkDrawable widget.  I don't see
why it wouldn't be real-time.  I haven't tried SDL -> GtkDrawable for video,
so I can't give a definite answer, but I suppose it is more hardware
dependent than it is SDL dependent.
If it isn't absolute real-time, you could probably fake the realtime by
dropping frames from the video playback (which is how most modern video
players work, anyway).

Take care,
-Alex


Alex Barry Thu, 13 May 2010 09:02:07 -0700

Try SDL_CreateRGBSurfaceFrom(): http://www.libsdl.org/cgi/docwiki.cgi/SDL_CreateRGBSurfaceFrom

For Windows GDI for example, you could use CreateDIBSection() and
SDL_CreateRGBSurfaceFrom(), passing the same pointer to both, then
handle drawing to the window in WM_PAINT using GDI (Use
InvalidateRect() instead of SDL_UpdateRect()). http://msdn.microsoft.com/en-us/library/dd183494 (v=VS.85).aspx http://msdn.microsoft.com/en-us/library/dd145002 (v=VS.85).aspx

It's probably a lot easier in GTK, but I haven't tried it.


Kenneth Bull Thu, 13 May 2010 10:46:00 -0700



Related Topics

Post a Comment