2D GUI, how to proceed

Hi there,
I’d like to build my own GUI with SDL, it will be a 2D GUI with possibly some
graphics that will give the impression of 3D, but the drawing is in 2D.

Most of the computers that this GUI will be used on do not have OpenGL
installed and have like 8Mb Video cards. I was wondering what was the best way
to draw the screen and changes.

I was thinking first of only updating what has changed in the GUI, but then,
when updating, should I use per-pixel operations like write one pixel at a time,
or is there any way to speed the process and make it less demanding for the slow
computers out there?

Possibly that I could have my borders in a long surface and do a blit of only
a portion of it, that’s for the borders. Now for the background, if it’s plain
colors, I could make a surface in advance and blit it where I need. A tiled bg
could be similar, with a bigger pre-tiled bg.

But before I do those specific optimisation, I was wondering about using a
minimal system that could do per-pixel operations and I was hoping this is not
too demanding.

What do you think, is there any documentation on this subject? I know there are
plenty of libraries that I can dig in, but I’d prefer to read some litterature
instead, like articles…

Thanks!

Simon

What do you think, is there any documentation on this subject? I know there are
plenty of libraries that I can dig in, but I’d prefer to read some litterature
instead, like articles…

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

ChrisOn Tue, 16 Nov 2004 17:21:55 -0500, Simon wrote:


Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to take the
time to read a scientific article in infography. The kind that are published at
SIGGRAPH… that explains the theory, the good points, the bad points, the
possibilities, the flaws, etc…

Digging into a code will take me a lot of time to understand someone’s coding
pricinples, then to look if he made a mistake, if I can do better, if there are
possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any litterature
on the subject? I’m sure there are, I’m sure you guys can reference me a few
very good documents!

Thanks,
Simon

Given what you’ve said, personally I’d recommend doing your own. All
you need is a way to display text, knowledge of graphics display, and
mouse and event handling. If you want hotkeys you also need to know the
key stuff. I wrote my own and it’s fine, but it’s only buttons, no
scrolling and no hotkeys. But that’s all I need for my game (so far).

-TomT64

Simon wrote:>> There are a number of GUIs in the libraries section of the SDL web

site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to
take the time to read a scientific article in infography. The kind
that are published at SIGGRAPH… that explains the theory, the good
points, the bad points, the possibilities, the flaws, etc…

Digging into a code will take me a lot of time to understand someone’s
coding pricinples, then to look if he made a mistake, if I can do
better, if there are possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any
litterature on the subject? I’m sure there are, I’m sure you guys can
reference me a few very good documents!

Thanks,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

That’s what I intend to do, I just finished building a networking architecture
that allow the main program to start multiple instances of itself as
sub-windows. The architecture is very nice and can be ported effortlessly to
open windows on different computers (and control them) as long as there is some
sort of client or server running on those computers.

Anyway. I know a lot about event handling, I’ve devellopped a few games that
were never released nor finished, but I do understand a lot. I’m not currently
doing this for game dev, rather doing this for industry production
infrastructure. I will need some fast graphics like quick scrolling lists of
items that scrolls from the scroll bar on the right or at the bottom, then
redisplay of the whole window may be frequent too…

For those reasons, I think per-pixel operations may cost too much. And I don’t
think I’m too dumb in thinking pre-made borders and backrounds that can be blit
fast will help.

Text will definately be my first goal - to make a console. But I have to think
before starting of what I will encounter later. This way I’d like to read
articles (rather than code) that discusses about the theory behind all this…

Thanks,
Simon

TomT64 wrote:> Given what you’ve said, personally I’d recommend doing your own. All

you need is a way to display text, knowledge of graphics display, and
mouse and event handling. If you want hotkeys you also need to know the
key stuff. I wrote my own and it’s fine, but it’s only buttons, no
scrolling and no hotkeys. But that’s all I need for my game (so far).

-TomT64

Simon wrote:

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to
take the time to read a scientific article in infography. The kind
that are published at SIGGRAPH… that explains the theory, the good
points, the bad points, the possibilities, the flaws, etc…

Digging into a code will take me a lot of time to understand someone’s
coding pricinples, then to look if he made a mistake, if I can do
better, if there are possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any
litterature on the subject? I’m sure there are, I’m sure you guys can
reference me a few very good documents!

Thanks,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

If you need speed, opengl (as well in 2D) is the best way …
For sure people needs a 3d accelerator (but now many computers have a 3d
accelerator)

This way you could build a fast gui implementation just working with base
memory structures for your objects, and then after all done, redraw the
whole scene in each frame.
For 2D operations you shouldn’t have any speed trouble with this solution.

Don’t forget for standard display, SDL doesn’t provide acceleration under
XWindows and may be sometimes very slow.> ----- Original Message -----

From: simon@xhz.ca (Simon)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Thursday, November 18, 2004 10:29 AM
Subject: Re: [SDL] 2D GUI, how to proceed

That’s what I intend to do, I just finished building a networking
architecture
that allow the main program to start multiple instances of itself as
sub-windows. The architecture is very nice and can be ported effortlessly
to
open windows on different computers (and control them) as long as there is
some
sort of client or server running on those computers.

Anyway. I know a lot about event handling, I’ve devellopped a few games
that
were never released nor finished, but I do understand a lot. I’m not
currently
doing this for game dev, rather doing this for industry production
infrastructure. I will need some fast graphics like quick scrolling lists
of
items that scrolls from the scroll bar on the right or at the bottom, then
redisplay of the whole window may be frequent too…

For those reasons, I think per-pixel operations may cost too much. And I
don’t
think I’m too dumb in thinking pre-made borders and backrounds that can be
blit
fast will help.

Text will definately be my first goal - to make a console. But I have to
think
before starting of what I will encounter later. This way I’d like to read
articles (rather than code) that discusses about the theory behind all
this…

Thanks,
Simon

TomT64 wrote:

Given what you’ve said, personally I’d recommend doing your own. All
you need is a way to display text, knowledge of graphics display, and
mouse and event handling. If you want hotkeys you also need to know the
key stuff. I wrote my own and it’s fine, but it’s only buttons, no
scrolling and no hotkeys. But that’s all I need for my game (so far).

-TomT64

Simon wrote:

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to
take the time to read a scientific article in infography. The kind
that are published at SIGGRAPH… that explains the theory, the good
points, the bad points, the possibilities, the flaws, etc…

Digging into a code will take me a lot of time to understand someone’s
coding pricinples, then to look if he made a mistake, if I can do
better, if there are possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any
litterature on the subject? I’m sure there are, I’m sure you guys can
reference me a few very good documents!

Thanks,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

That’s what I intend to do, I just finished building a networking architecture
that allow the main program to start multiple instances of itself as
sub-windows. The architecture is very nice and can be ported effortlessly to
open windows on different computers (and control them) as long as there is some
sort of client or server running on those computers.

Anyway. I know a lot about event handling, I’ve devellopped a few games that
were never released nor finished, but I do understand a lot. I’m not currently
doing this for game dev, rather doing this for industry production
infrastructure. I will need some fast graphics like quick scrolling lists of
items that scrolls from the scroll bar on the right or at the bottom, then
redisplay of the whole window may be frequent too…

For those reasons, I think per-pixel operations may cost too much. And I don’t
think I’m too dumb in thinking pre-made borders and backrounds that can be blit
fast will help.

You are right in thinking the “per pixel” operations are slow. They are
slow for many reasons two of them being a) it implies software
implementations of the graphics operations, and b) doing it that way
actually works against the hardware.

OTOH, many high level operations, such as blits, may be implemented in
software… All depends on what you are doing and where the data is.

BTW, using pre-made borders and such is fine if they are images, but if
they are solid colors then you might as well just paint the color. Grab
an image of your desktop and look at it in an image editor, zoom in on
the parts you are interested in and you will be surprised by how simply
the 3D effects are created.

	Bob PendletonOn Thu, 2004-11-18 at 03:29, Simon wrote:

Text will definately be my first goal - to make a console. But I have to think
before starting of what I will encounter later. This way I’d like to read
articles (rather than code) that discusses about the theory behind all this…

Thanks,
Simon

TomT64 wrote:

Given what you’ve said, personally I’d recommend doing your own. All
you need is a way to display text, knowledge of graphics display, and
mouse and event handling. If you want hotkeys you also need to know the
key stuff. I wrote my own and it’s fine, but it’s only buttons, no
scrolling and no hotkeys. But that’s all I need for my game (so far).

-TomT64

Simon wrote:

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to
take the time to read a scientific article in infography. The kind
that are published at SIGGRAPH… that explains the theory, the good
points, the bad points, the possibilities, the flaws, etc…

Digging into a code will take me a lot of time to understand someone’s
coding pricinples, then to look if he made a mistake, if I can do
better, if there are possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any
litterature on the subject? I’m sure there are, I’m sure you guys can
reference me a few very good documents!

Thanks,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±-------------------------------------+

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to take the
time to read a scientific article in infography. The kind that are published at
SIGGRAPH… that explains the theory, the good points, the bad points, the
possibilities, the flaws, etc…

Then go do that. Really, Dude!, go to www.siggraph.org and search for
those kinds of papers and read them.

BTW, I had a book like that once, it was written in the early '80s and
is now completely out of date. I haven’t seen anything like it since.

	Bob PendletonOn Wed, 2004-11-17 at 22:11, Simon wrote:

Digging into a code will take me a lot of time to understand someone’s coding
pricinples, then to look if he made a mistake, if I can do better, if there are
possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any litterature
on the subject? I’m sure there are, I’m sure you guys can reference me a few
very good documents!

Thanks,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±-------------------------------------+

OpenGL is not possible, it would be too slow, as the majority of computers
running the software won’t even have more than a 8Mb Video card with no
acceleration.

But I may implement a way to detect if there is video acceleration and if there
is to use OpenGL at that moment.

Thanks!

Carlos Alvarez wrote:> If you need speed, opengl (as well in 2D) is the best way …

For sure people needs a 3d accelerator (but now many computers have a 3d
accelerator)

This way you could build a fast gui implementation just working with base
memory structures for your objects, and then after all done, redraw the
whole scene in each frame.
For 2D operations you shouldn’t have any speed trouble with this solution.

Don’t forget for standard display, SDL doesn’t provide acceleration under
XWindows and may be sometimes very slow.

----- Original Message -----
From: “Simon” <@Simon2>
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Thursday, November 18, 2004 10:29 AM
Subject: Re: [SDL] 2D GUI, how to proceed

That’s what I intend to do, I just finished building a networking

architecture

that allow the main program to start multiple instances of itself as
sub-windows. The architecture is very nice and can be ported effortlessly

to

open windows on different computers (and control them) as long as there is

some

sort of client or server running on those computers.

Anyway. I know a lot about event handling, I’ve devellopped a few games

that

were never released nor finished, but I do understand a lot. I’m not

currently

doing this for game dev, rather doing this for industry production
infrastructure. I will need some fast graphics like quick scrolling lists

of

items that scrolls from the scroll bar on the right or at the bottom, then
redisplay of the whole window may be frequent too…

For those reasons, I think per-pixel operations may cost too much. And I

don’t

think I’m too dumb in thinking pre-made borders and backrounds that can be

blit

fast will help.

Text will definately be my first goal - to make a console. But I have to

think

before starting of what I will encounter later. This way I’d like to read
articles (rather than code) that discusses about the theory behind all

this…

Thanks,
Simon

TomT64 wrote:

Given what you’ve said, personally I’d recommend doing your own. All
you need is a way to display text, knowledge of graphics display, and
mouse and event handling. If you want hotkeys you also need to know the
key stuff. I wrote my own and it’s fine, but it’s only buttons, no
scrolling and no hotkeys. But that’s all I need for my game (so far).

-TomT64

Simon wrote:

There are a number of GUIs in the libraries section of the SDL web
site. Why not check them out, find one that is close to what you are
looking for, and then read the code to see how it does it ?

Yes, if I eventually find some time for this I will, but I prefer to
take the time to read a scientific article in infography. The kind
that are published at SIGGRAPH… that explains the theory, the good
points, the bad points, the possibilities, the flaws, etc…

Digging into a code will take me a lot of time to understand someone’s
coding pricinples, then to look if he made a mistake, if I can do
better, if there are possible traps with this technique, and so on…

I will dig into the libraries, but in the meantime, aren’t there any
litterature on the subject? I’m sure there are, I’m sure you guys can
reference me a few very good documents!

Thanks,
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

You are right in thinking the “per pixel” operations are slow. They are
slow for many reasons two of them being a) it implies software
implementations of the graphics operations, and b) doing it that way
actually works against the hardware.

OTOH, many high level operations, such as blits, may be implemented in
software… All depends on what you are doing and where the data is.

Right, like creating a surface the size of the modification on the screen,
drawing the scene in that surface rect and then blit this single surface to the
screen buffer?

Seems pretty good, actually, I think I may try different techniques and make an
integrated benchmark to see what technique runs better on which kind of computer.

Thanks!

Then go do that. Really, Dude!, go to www.siggraph.org and search for
those kinds of papers and read them.

BTW, I had a book like that once, it was written in the early '80s and
is now completely out of date. I haven’t seen anything like it since.

Thanks Bob for the link! I’ll check the few publications they have to see if
any talk about a 2D environment. I checked and saw that most of the articles
aren’t available online, I may have to order them from somewhere…

But thanks a lot!

Simon wrote:

Then go do that. Really, Dude!, go to www.siggraph.org and search for
those kinds of papers and read them.

BTW, I had a book like that once, it was written in the early '80s and
is now completely out of date. I haven’t seen anything like it since.

Thanks Bob for the link! I’ll check the few publications they have to
see if any talk about a 2D environment. I checked and saw that most of
the articles aren’t available online, I may have to order them from
somewhere…

But thanks a lot!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

ParaGUI may actually fit your needs, and it’s built on top of SDL.

http://www.paragui.org/

  • Tom

ParaGUI may actually fit your needs, and it’s built on top of SDL.

http://www.paragui.org/

Thanks, I’ll check it out!

Btw, you know what? I think I’m going to write a paper on this work, I mean,
not just write another library but instead write the principles and theories,
the tests & their results about the different techniques that can be used, pros
and cons.

I think 2D programming is one of the most important application today for
commercial software. 3D is still only good for games and rare other
applications, but if you wish to implement your own compression utility, you’ll
certainly go with 2D.

I’m pretty good at writting papers, although English is my second language, I
will need help to make some syntax and vocabulary (+expressions) corrections.

So, I’ll probably ask around for help in some days, or actually, I’ll write the
thing and then discuss it here! =)

Thank you all!

Simon

I spent most of this weekend trying to get paragui to compile for a
project at work. Has anyone got a working binary of paragui’s dll or
lib file they could post or email to me? Even instructions on how to
compile it would be great… Here’s what I’m using (or trying to):

Win32 (XP or 2000)
MS Visual Studio.Net 2003
SDL 1.2.7
libsigc++ 1.2.5 (according to a post on the paragui forums, 2.x doesn’t work)
and the latest versions I could find of all the other dependencies.

Thanks much,

-JustinOn Fri, 19 Nov 2004 12:09:38 +0000, Tom Wilson <t.wilson at hazid.com> wrote:

Simon wrote:
ParaGUI may actually fit your needs, and it’s built on top of SDL.

http://www.paragui.org/