Window Protocols

OK, going back to the GTK+ thread, I started to think and rattle this through
my brains again, and one of the things that came up was how nice it would be to
have some way of doing this. The key problem, IMHO, is the window issues. Yeah,
writing a system to extend SDL to support “multiple windows” is … fairly easy
… (easier for application development environments where you have a window
manager than those where you do not…), but the problems are (A) making it
nice, and (B) integrating backwards compatibility. So, how about something like
this… see what you think of my proposal.

Windows are defined, created, and resized with a Window Manager function. Each
Window has a surface on it, automatically tuned to the width, height, and depth
of the window, which you can define manually. The SDL_video functions become
wrappers to these functions, creating a window as needed or kicking into
fullscreen mode as needed, and toggling flags indicating that if the user
wishes to spawn a secondary window, it will need to be done on the main buffer.
Somewhere behind this is another layer of code, which actually handles the
drawing aspects, and in between that you have the layer which will emulate a
windowing system, if one is requested and not found (if you’re runnning in
fullscreen svgalib/fbcon mode)

SDL drawing functions, by default, would draw to the currently selected window.
The key one here is SDL_Flip, as well, I suppose, as SDL_GL_SwapBuffers… and
all the SDL_WM functions. You change your window by hitting
SDL_SetTargetWindow(), and pass it a pointer to a window structure that you’ve
requested from somewhere… and you get the idea.

The internals seem moderately ugly to me as a programmer, and could only serve
to convolute things, but the outside is nice and simple to use, and it
maintains backwards compatibility, which, for me, is a big priority. This also
means a great big whacking SDL rewrite spree, which could take a while.

Thoughts?

Nicholas

NB: Yes, SDL will run on Cr

OK, going back to the GTK+ thread, I started to think and rattle this through
my brains again, and one of the things that came up was how nice it would be to
have some way of doing this.

So, how about something like this… see what you think of my proposal.

First, wow…

I’ve isolated things pretty well so you could concievably play these kinds
of games by pretending each instance of a video driver is a “window”.
That wouldn’t be the best way to do it, but would involve the least work,
at least at first.

This also means a great big whacking SDL rewrite spree, which could take a while.

Yep. :slight_smile:

NB: Yes, SDL will run on Cr

If you’re referring to the recently announced Crusoe processor…
How do you know? Do you have one? :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

First, wow…

Any particular reason why wow, or simply because I’m a loony? :wink:

I’ve isolated things pretty well so you could concievably play these kinds
of games by pretending each instance of a video driver is a “window”.
That wouldn’t be the best way to do it, but would involve the least work,
at least at first.

I think so, yes, but in the case of video drivers for non-windowmanager-ial
systems, you’d have to rewrite an entire new layer in, on the grounds you
can’t pretend each instance of a video driver is a “window” when it isn’t.
I’m not sure quite how isolated your code is, I’ll take a quick poke at it
this evening.

Yep. :slight_smile:

I’m sure it will be a lot of hard work but… damn, wouldn’t it be cool?
Talk about niftiness for SDL 1.2.

NB: Yes, SDL will run on Cr

Oh, damn. My e-mail’s cutting off again… nngh.

If you’re referring to the recently announced Crusoe processor…
How do you know? Do you have one? :slight_smile:

Nope, don’t I wish I did… can you guys get one for development purposes?
But I did see Quake running, as well as what I think is X Windows … and
where there’s Quake, SDL should work more or less glitch free. This is just
my considered opinion… but just think. Civ:CTP on a microwave oven!

Damn nice processor, isn’t it? I can’t wait to get my hands on one of those
laptops. That, and the whole code morphing thing (why nobody thought of
caching emulated system instructions and rebuilding a piece of software
before is totally beyond me…) has me thinking about re-evaluating Kosmos
Online’s network protocol, to see if I can do something like this to handle
the fact that while we have one network protocol, we have multiple clients
with their own internal representations… hmm.

Food for thought there.

-Sam Lantinga (slouken at devolution.com)

Nicholas

----- Original Message -----
From: slouken@devolution.com (Sam Lantinga)
To: sdl at lokigames.com
Date: Wednesday, January 19, 2000 3:27 PM
Subject: Re: [SDL] Window Protocols