Making an SDL 1.3-based GUI framework

Well, I made a post about this before but discontinued it due to lack of time. I’m now starting again, as I personally am working on a project that will use SDL 1.3 and have several planned which would all benefit from using SDL 1.3 as well.

And they’ll all require at least a simplistic GUI, so I need to make one. Since I’m still limited on time for development, I decided it might be wise to see if anyone else would like to contribute to development.

I have hosted the project at sourceforge: https://sourceforge.net/projects/sdlgui/

As you can see, I haven’t actually implemented much yet, but the very basic stuff is there. I also haven’t documented anything yet, as I’m working in a fairly constrained timeframe. However, I do hope that what comments I’ve made and the general structure should make it very simple to understand what I’m doing.

The framework should be designed to be light and non-intrusive (IE, don’t attempt to hijack control from the programmer using the library or make any assumptions about how the user would like to implement things like skinning or rendering of text). You’ll also notice I’m implementing many things in the header files, a’la boost. This is intentional and not an act of laziness, as the framework should be light enough to be contained just fine with just header files.

Contrary to SDL, I’m using SVN to host the code. I just find it simpler to use, even though that may be inconvenient for using with SDL. However, like SDL, the framework is zlib licensed.

If you’re interested in assisting, shoot me an email or respond to this thread with your sourceforge account name and I’ll be happy to add you. Otherwise, if you have design ideas or something, I welcome them as well. It has been a couple of years since I actively worked on a GUI framework.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

Message-ID: <1303504973.m2f.28601 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Well, I made a post about this before but discontinued it
due to lack of time. I’m now starting again, as I
personally am working on a project that will use SDL 1.3
and have several planned which would all benefit from
using SDL 1.3 as well.

And they’ll all require at least a simplistic GUI, so I
need to make one. Since I’m still limited on time for
development, I decided it might be wise to see if anyone
else would like to contribute to development.

I have hosted the project at sourceforge:
https://sourceforge.net/projects/sdlgui/

As you can see, I haven’t actually implemented much yet,
but the very basic stuff is there. I also haven’t
documented anything yet, as I’m working in a fairly
constrained timeframe. However, I do hope that what
comments I’ve made and the general structure should make
it very simple to understand what I’m doing.

It looks nice so far, but one note: sometimes you may want
to draw copies of a single widget in multiple places, or
even move a widget from one parent widget to another (I
forget where, but I’ve run into both). I’d suggest that
you prepare for this by removing the ‘parent’ member from
the IGUI_Widget class, and adding an ‘offset’ argument to
the Draw (and possibly HandleEvent) method(s) to replace
the location info that parent was providing. It isn’t
complex, and provides the same functionality that parent
does, but is more flexible.

Do you have any thoughts on what the skinner would be
useful for, though?

The framework should be designed to be light and
non-intrusive (IE, don’t attempt to hijack control from
the programmer using the library or make any assumptions
about how the user would like to implement things like
skinning or rendering of text). You’ll also notice I’m
implementing many things in the header files, a’la
boost. This is intentional and not an act of laziness,
as the framework should be light enough to be contained
just fine with just header files.

My more recent explorations of GUIs on SDL have tended to
go in a COM-reimplementation direction (for flexibility),
but I haven’t finished any of those, so simple is good :wink: .

If you’re interested in assisting, shoot me an email or
respond to this thread with your sourceforge account name
and I’ll be happy to add you.

I’ll try to spend the time to get a text editor widget
working (I’m brainstorming how to interface SDL with DGD,
so I might take a while).

Otherwise, if you have
design ideas or something, I welcome them as well. It has
been a couple of years since I actively worked on a GUI
framework.

Have you considered generic communications with widgets?
My own signature for event handlers tends to go something
like this:

event_list handler( event );

With event_list being exactly what it sounds like, with
the exception that each event comes with a 'target widget’
field for dispatching. With this, you can enable generic
messages to and from arbitrary widgets, with only a few
(probably 2, really) types of user event (a request event
and corresponding respond event).

My COM-like scribblings have even included the ability to
use the ‘request’ event to request a call to it’s own Draw
function (think: timer, clock, or anything else that needs
to be animated).> Date: Fri, 22 Apr 2011 13:42:53 -0700

From: “Nathaniel J Fries”
To: sdl at lists.libsdl.org
Subject: [SDL] Making an SDL 1.3-based GUI framework

Hi,

a good starting point could be? SDL_widget? 0.4

–Armin___________________________________________________________
WEB.DE DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt mit
gratis Handy-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2

Jared Maddox wrote:

It looks nice so far, but one note: sometimes you may want
to draw copies of a single widget in multiple places, or
even move a widget from one parent widget to another (I
forget where, but I’ve run into both). I’d suggest that
you prepare for this by removing the ‘parent’ member from
the IGUI_Widget class, and adding an ‘offset’ argument to
the Draw (and possibly HandleEvent) method(s) to replace
the location info that parent was providing. It isn’t
complex, and provides the same functionality that parent
does, but is more flexible.

This only seems to be more flexible, because it allows you to reuse the same widget in multiple places. In doing things like this, you completely lose the parent-child hierarchy (it can’t be expected or enforced anymore). This means the user must manually iterate draw requests through widgets. This does not sound simple to me. I have no intention of ever writing a GUI framework like this.
As for why it isn’t actually flexible… besides for saving a little memory and being able to treat widgets like an SDL_Texture, what do you actually get from doing this? Nothing.

Jarred Maddox wrote:

Do you have any thoughts on what the skinner would be
useful for, though?

The skinner is an interface that needs to be implemented by the user to be effective.
What is it good for? You could create a CSSSkinner class that takes a string of CSS code in the constructor, and provides the Skin(…) interface if you were making a web browser. If your goal is to be portable but also look extremely integrated with the system, you could do that just by using a different texture on each system. You’d have a SystemLikeSkinner() constructor taking an “OS ID” or something and loading the appropriate constructor, then the “Skin” function would do the magic.
The Skin function uses outside variables to work. This is similar to a C function using globals, except many C++ compilers like to break around globals… :stuck_out_tongue:

Jared Maddox wrote:

My more recent explorations of GUIs on SDL have tended to
go in a COM-reimplementation direction (for flexibility),
but I haven’t finished any of those, so simple is good :wink: .

COM is not really desirable from an implementation standpoint.

I’ll try to spend the time to get a text editor widget
working (I’m brainstorming how to interface SDL with DGD,
so I might take a while).

Good. This is one of those widgets that takes forever to implement.
But remember – assume as little as possible about how the user wants to implement or use things. The user might want syntax highlighting on this widget. The user might not want to use SDL_TTF for fonts, he might have a totally B/A bitmap font or something. He might even want to use system fonts. These are things that the user should be able to do without much effort.

Jarred Maddox wrote:

Have you considered generic communications with widgets?
My own signature for event handlers tends to go something
like this:

event_list handler( event );

With event_list being exactly what it sounds like, with
the exception that each event comes with a 'target widget’
field for dispatching. With this, you can enable generic
messages to and from arbitrary widgets, with only a few
(probably 2, really) types of user event (a request event
and corresponding respond event).

Implementation sounds PITA.
The user could do something like this rather easily without having to actually need an API for it.

Jarred Maddox wrote:

My COM-like scribblings have even included the ability to
use the ‘request’ event to request a call to it’s own Draw
function (think: timer, clock, or anything else that needs
to be animated).

If the user wants this, the user may maintain a pointer to the widget and manually call draw his/her self.
I think that you’re thinking in terms of COM for all of this.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

Message-ID: <1303567572.m2f.28607 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Jared Maddox wrote:

It looks nice so far, but one note: sometimes you may want
to draw copies of a single widget in multiple places, or
even move a widget from one parent widget to another (I
forget where, but I’ve run into both). I’d suggest that
you prepare for this by removing the ‘parent’ member from
the IGUI_Widget class, and adding an ‘offset’ argument to
the Draw (and possibly HandleEvent) method(s) to replace
the location info that parent was providing. It isn’t
complex, and provides the same functionality that parent
does, but is more flexible.

This only seems to be more flexible, because it allows
you to reuse the same widget in multiple places. In doing
things like this, you completely lose the parent-child
hierarchy (it can’t be expected or enforced anymore).
This means the user must manually iterate draw requests
through widgets. This does not sound simple to me. I have
no intention of ever writing a GUI framework like this.

No, this doesn’t really change things. The containers still
do message dispatching to their children, they just send
the location info as arguments to the function instead
of waiting for the children to ask for it.

And yes, there are still containers, because the only idea
that you drop is the idea that widgets can only have a
single parent. Parent/child relationships still exist, they
just aren’t tracked by the children.

As for why it isn’t actually flexible… besides for
saving a little memory and being able to treat widgets
like an SDL_Texture, what do you actually get from doing
this? Nothing.
Actually, I was thinking about using the same widget in
two different windows, so that you don’t have to do as
much message dispatching.
Example use: you have a painting-widget, and viewport
widgets to go along with it; each viewport represents a
different view of the image, and when a a change is made to
the image through one viewport it appears in the others as
well.

Jarred Maddox wrote:

Do you have any thoughts on what the skinner would be
useful for, though?

The skinner is an interface that needs to be implemented
by the user to be effective.

Per-widget (note: I don’t actually see much use for this
one, since you’d have to have a new one for every style),
per-style, what? With the minimalist interface you’ve
currently written I can’t see the skinner as being of much
use. Is it supposed to provide the visual element while the
widgets provide the behavior? Is it supposed to draw
’external aspects’ such as a window bar?

What is it good for? You could create a CSSSkinner class
that takes a string of CSS code in the constructor, and
provides the Skin(…) interface if you were making a
web browser. If your goal is to be portable but also
look extremely integrated with the system, you could do
that just by using a different texture on each system.
You’d have a SystemLikeSkinner() constructor taking an
"OS ID" or something and loading the appropriate
constructor, then the “Skin” function would do the magic.

‘Magic’ is nice and all, but you need to actually be able
to implement it. If skinners are actually supposed to
affect the way that things look, then you should start by
having them provide ‘components’ for widgets to use. For
example: edge bevels that can be used to indicate raised
or lowered areas. This would allow skinners to provide
styles, by way of one style using different bevels than
another style, including differently sized bevels.

Jared Maddox wrote:

My more recent explorations of GUIs on SDL have tended to
go in a COM-reimplementation direction (for flexibility),
but I haven’t finished any of those, so simple is good :wink: .

COM is not really desirable from an implementation standpoint.

How so? Too heavy? You’re already using reference counting,
the only reason I ever went further towards COM was that I
intended to allow external ‘widget servers’. Without
external widgets, this is about as COM-like as you have
reason for.

I’ll try to spend the time to get a text editor widget
working (I’m brainstorming how to interface SDL with DGD,
so I might take a while).

Good. This is one of those widgets that takes forever to
implement.

But remember – assume as little as possible about how
the user wants to implement or use things. The user
might want syntax highlighting on this widget.

Like for coloring a keyword a different color than a
comment? Certainly (well, probably) not in the first
version, but maybe afterwards.

The user might not want to use SDL_TTF for fonts, he
might have a totally B/A bitmap font or something. He
might even want to use system fonts. These are things
that the user should be able to do without much effort.

I’m not going to say that it’s without much effort, but
the last time I did this the class didn’t natively support
any character sets, you had to provide it with functions
for things like figuring out the byte length of a
character, and whether you could break at a certain point
(only relevant if you turn on word-wrap, but you need A
function regardless).

One more note: the containers should have another widget
that acts as a background. It’s ‘draw’ function should be
called after PreSkin, but before the for loop. This allows
arbitrary backgrounds, including of other container
widgets.> Date: Sat, 23 Apr 2011 07:06:12 -0700

From: “Nathaniel J Fries”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Making an SDL 1.3-based GUI framework

Jared Maddox wrote:

No, this doesn’t really change things. The containers still
do message dispatching to their children, they just send
the location info as arguments to the function instead
of waiting for the children to ask for it.

And yes, there are still containers, because the only idea
that you drop is the idea that widgets can only have a
single parent. Parent/child relationships still exist, they
just aren’t tracked by the children.

Oh, I see. That would be fine, I guess. I still don’t see what it provides.

Actually, I was thinking about using the same widget in
two different windows, so that you don’t have to do as
much message dispatching.
Example use: you have a painting-widget, and viewport
widgets to go along with it; each viewport represents a
different view of the image, and when a a change is made to
the image through one viewport it appears in the others as
well.

How would that work if widgets had no handle to their parent?
Also, why does a viewport need to be a widget? A viewport is a mere rectangle.
However, that does provide me with an idea for a potential canvas widget!

Per-widget (note: I don’t actually see much use for this
one, since you’d have to have a new one for every style),
per-style, what? With the minimalist interface you’ve
currently written I can’t see the skinner as being of much
use. Is it supposed to provide the visual element while the
widgets provide the behavior? Is it supposed to draw
’external aspects’ such as a window bar?

Per-widget (well, obviously, instances can be reused between multiple widgets of the same time).
It provides the visual element, while the widget provides behavior.
The widget will draw stuff unique to its functionality (a text editing region draws text and a cursor, a button draws it label, a frame draws its caption, etc) between PreSkin and PostSkin.
PreSkin is for things like drawing backgrounds and outer borders, PostSkin is for things like drawing inner borders (some of the fancier UI designs have these) and any other sort of post-rendering visual effect.

Jared Maddox wrote:

What is it good for? You could create a CSSSkinner class
that takes a string of CSS code in the constructor, and
provides the Skin(…) interface if you were making a
web browser. If your goal is to be portable but also
look extremely integrated with the system, you could do
that just by using a different texture on each system.
You’d have a SystemLikeSkinner() constructor taking an
"OS ID" or something and loading the appropriate
constructor, then the “Skin” function would do the magic.

‘Magic’ is nice and all, but you need to actually be able
to implement it. If skinners are actually supposed to
affect the way that things look, then you should start by
having them provide ‘components’ for widgets to use. For
example: edge bevels that can be used to indicate raised
or lowered areas. This would allow skinners to provide
styles, by way of one style using different bevels than
another style, including differently sized bevels.

Unless they actually changed the way that widgets function, this type of thing would be contained to the Skinner class implementation.
That said, there is no reason why we can’t provide some simple skinner implementations to the user. It merely isn’t a priority now.

Jared Maddox wrote:

My more recent explorations of GUIs on SDL have tended to
go in a COM-reimplementation direction (for flexibility),
but I haven’t finished any of those, so simple is good :wink: .

COM is not really desirable from an implementation standpoint.

How so? Too heavy? You’re already using reference counting,
the only reason I ever went further towards COM was that I
intended to allow external ‘widget servers’. Without
external widgets, this is about as COM-like as you have
reason for.[/quote]
I thought you meant… actual COM. Not a COM-like interface.
Yes, it is a bit heavy, but it also is already a bit COM-like.
Interfaces exist primarily for the user to extend functionality.
Reference counting exists to solve a dilemma I’ve run into using other, non-reference-counting GUI libraries that try to do advanced things for a “smoother” look. It’s my intention to allow the user to implement such a thing themselves, if they wish. The solution that one specific GUI library I was using had was to delete the widget when it was done being “smooth” with it. But I still wanted the widget for something, and recreating it was a PITA. Obviously the best solution was to hack the LGPL-licensed library I was using in my proprietary project. Eh, no thanks. I did wind up just creating it.

Jared Maddox wrote:

Good. This is one of those widgets that takes forever to
implement.

But remember – assume as little as possible about how
the user wants to implement or use things. The user
might want syntax highlighting on this widget.

Like for coloring a keyword a different color than a
comment? Certainly (well, probably) not in the first
version, but maybe afterwards.

Yes. It’d be nice to do things like italics and bold and stuff, too.
I’m still thinking about the best way to do this.

Jarred Maddox wrote:

The user might not want to use SDL_TTF for fonts, he
might have a totally B/A bitmap font or something. He
might even want to use system fonts. These are things
that the user should be able to do without much effort.

I’m not going to say that it’s without much effort, but
the last time I did this the class didn’t natively support
any character sets, you had to provide it with functions
for things like figuring out the byte length of a
character, and whether you could break at a certain point
(only relevant if you turn on word-wrap, but you need A
function regardless).

I’d just provide support for UTF-8, since SDL already does this.

Jarred Maddox wrote:

One more note: the containers should have another widget
that acts as a background. It’s ‘draw’ function should be
called after PreSkin, but before the for loop. This allows
arbitrary backgrounds, including of other container
widgets.

That is the purpose of PreSkin.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

I don’t have a lot of time to assist with things, but I’ll toss in some
ideas about how I’d setup widgetting system:

struct widget_skin {
Uint32 background;
Uint32 border[4];
uint32 foreground;
// Any other general widget stuff
};

// General purpose callback for events and other stuff
typedef int (*widgetCallback)( int type, void *widget, int param, void
*udata );

struct widget {
void *wClass; // Reference to some widget class - this allows an easy
cast!
// Tree-style widget referencing
widget *parent; // Widget parent
widget *nextSibling; // Next widget in list
widget *firstChild; // First widget in child list

// Connected widgets are widgets that aren’t directly connected via the
tree, but you still want to have them notified after an event
int nConnected; // Number of connected widgets
widget **connected; // Reference to connected widgets

widget_skin style;
};

Then, of course, you’d have to create a pile of classes for different
widgets. So, if we had a fictional “window” widget, creating it would look
something like

widget *container = sdl_ui_baseWidget( ); // Creates a “null” widget to be
used as a base
widget *firstWindow = sdl_ui_createWindow( container, “Window Title”,
sdl_ui_p2d( x, y ), sdl_ui_size( w, h ) )
widget_window *windowData = (widget_window *)firstWindow;
printf( “%s\r\n”, windowData->title );

Stuff like that is helpful. I don’t know, though. There’s would be a lot
to be implemented, and again, I don’t have a lot of time between work and my
own projects.

Take care,
-AlexOn Sun, Apr 24, 2011 at 10:51 AM, Nathaniel J Fries wrote:

Jared Maddox wrote:

No, this doesn’t really change things. The containers still
do message dispatching to their children, they just send
the location info as arguments to the function instead
of waiting for the children to ask for it.

And yes, there are still containers, because the only idea
that you drop is the idea that widgets can only have a
single parent. Parent/child relationships still exist, they
just aren’t tracked by the children.

Oh, I see. That would be fine, I guess. I still don’t see what it provides.

Quote:

Actually, I was thinking about using the same widget in
two different windows, so that you don’t have to do as
much message dispatching.
Example use: you have a painting-widget, and viewport
widgets to go along with it; each viewport represents a
different view of the image, and when a a change is made to
the image through one viewport it appears in the others as
well.

How would that work if widgets had no handle to their parent?
Also, why does a viewport need to be a widget? A viewport is a mere
rectangle.
However, that does provide me with an idea for a potential canvas widget!

Quote:

Per-widget (note: I don’t actually see much use for this
one, since you’d have to have a new one for every style),
per-style, what? With the minimalist interface you’ve
currently written I can’t see the skinner as being of much
use. Is it supposed to provide the visual element while the
widgets provide the behavior? Is it supposed to draw
’external aspects’ such as a window bar?

Per-widget (well, obviously, instances can be reused between multiple
widgets of the same time).
It provides the visual element, while the widget provides behavior.
The widget will draw stuff unique to its functionality (a text editing
region draws text and a cursor, a button draws it label, a frame draws its
caption, etc) between PreSkin and PostSkin.
PreSkin is for things like drawing backgrounds and outer borders, PostSkin
is for things like drawing inner borders (some of the fancier UI designs
have these) and any other sort of post-rendering visual effect.

Jared Maddox wrote:

Quote:

What is it good for? You could create a CSSSkinner class
that takes a string of CSS code in the constructor, and
provides the Skin(…) interface if you were making a
web browser. If your goal is to be portable but also
look extremely integrated with the system, you could do
that just by using a different texture on each system.
You’d have a SystemLikeSkinner() constructor taking an
"OS ID" or something and loading the appropriate
constructor, then the “Skin” function would do the magic.

‘Magic’ is nice and all, but you need to actually be able
to implement it. If skinners are actually supposed to
affect the way that things look, then you should start by
having them provide ‘components’ for widgets to use. For
example: edge bevels that can be used to indicate raised
or lowered areas. This would allow skinners to provide
styles, by way of one style using different bevels than
another style, including differently sized bevels.

Unless they actually changed the way that widgets function, this type of
thing would be contained to the Skinner class implementation.
That said, there is no reason why we can’t provide some simple skinner
implementations to the user. It merely isn’t a priority now.

Jared Maddox wrote:

Quote:

My more recent explorations of GUIs on SDL have tended to
go in a COM-reimplementation direction (for flexibility),
but I haven’t finished any of those, so simple is good [image: Wink] .

COM is not really desirable from an implementation standpoint.

How so? Too heavy? You’re already using reference counting,
the only reason I ever went further towards COM was that I
intended to allow external ‘widget servers’. Without
external widgets, this is about as COM-like as you have
reason for.[/quote]
I thought you meant… actual COM. Not a COM-like interface.
Yes, it is a bit heavy, but it also is already a bit COM-like.
Interfaces exist primarily for the user to extend functionality.
Reference counting exists to solve a dilemma I’ve run into using other,
non-reference-counting GUI libraries that try to do advanced things for a
"smoother" look. It’s my intention to allow the user to implement such a
thing themselves, if they wish. The solution that one specific GUI library I
was using had was to delete the widget when it was done being “smooth” with
it. But I still wanted the widget for something, and recreating it was a
PITA. Obviously the best solution was to hack the LGPL-licensed library I
was using in my proprietary project. Eh, no thanks. I did wind up just
creating it.

Jared Maddox wrote:

Quote:

Good. This is one of those widgets that takes forever to
implement.

But remember – assume as little as possible about how
the user wants to implement or use things. The user
might want syntax highlighting on this widget.

Like for coloring a keyword a different color than a
comment? Certainly (well, probably) not in the first
version, but maybe afterwards.

Yes. It’d be nice to do things like italics and bold and stuff, too.
I’m still thinking about the best way to do this.

Jarred Maddox wrote:

Quote:

The user might not want to use SDL_TTF for fonts, he
might have a totally B/A bitmap font or something. He
might even want to use system fonts. These are things
that the user should be able to do without much effort.

I’m not going to say that it’s without much effort, but
the last time I did this the class didn’t natively support
any character sets, you had to provide it with functions
for things like figuring out the byte length of a
character, and whether you could break at a certain point
(only relevant if you turn on word-wrap, but you need A
function regardless).

I’d just provide support for UTF-8, since SDL already does this.

Jarred Maddox wrote:

One more note: the containers should have another widget
that acts as a background. It’s ‘draw’ function should be
called after PreSkin, but before the for loop. This allows
arbitrary backgrounds, including of other container
widgets.

That is the purpose of PreSkin.


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

MrOzBarry wrote:

I don’t have a lot of time to assist with things, but I’ll toss in some ideas about how I’d setup widgetting system:

struct widget_skin {
??Uint32 background;
??Uint32 border[4];
??uint32 foreground;
??// Any other general widget stuff
};

// General purpose callback for events and other stuff
typedef int (*widgetCallback)( int type, void *widget, int param, void *udata );

struct widget {
??void *wClass; // Reference to some widget class - this allows an easy cast!
??// Tree-style widget referencing
??widget *parent; // Widget parent
??widget *nextSibling; // Next widget in list
??widget *firstChild; // First widget in child list

??// Connected widgets are widgets that aren’t directly connected via the tree, but you still want to have them notified after an event
??int nConnected; // Number of connected widgets
??widget **connected; // Reference to connected widgets

??widget_skin style;
};

ah, you just reminded me of something I didn’t think about – iterating through widgets (ie via pressing TAB).------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

Made a ton of minor changes today, including a nifty SDL_RenderCopy wrapper supporting clipping.
Should now compile fine for MSVC, but not so sure about GCC. Haven’t tested any of the code yet, but I’m feeling confident.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

Hi,

a much cleaner implementation is the wGUI ( http://wgui.sourceforge.net )
It’s real C++ code :slight_smile:

–Armin

A. Steinhoff wrote:

Hi,

a much cleaner implementation is the wGUI ( http://wgui.sourceforge.net )
It’s real C++ code :slight_smile:

–Armin


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

Let me analyze that:

wGui is a simple, platform independent dialog manager library using SDL and FreeType2. Written in C++ (with extensive use of the Standard Library and STL) the intention is to leave all of the antiquated C paradigms out of it (like #defines).

Written with none of the awesome low-level techniques that C allows, and with the known-to-be-horribly-inefficient-compared-to-C-alternatives-STL.
Using FreeType2 means that it’s inflexible.

Latest Release (05/16/07) : 0.5.0

Not actively maintained and not supporting SDL 1.3------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

Hi Nathaniel,

you wrote:

Written with none of the awesome low-level techniques that C allows, and with the known-to-be-horribly-inefficient-compared-to-C-alternatives-STL.

Yes … this looks like a strange approach … but who cares.? The concept seems interesting for me … not the coding!

Using FreeType2 means that it’s inflexible.

… and what about the support of character sets from ASIA ??? To have this is a good sign for frexibility

Not actively maintained and not supporting SDL 1.3 .

Well, that’s wooden wheel from SDL 1.2.x?? … but you haven’e to re-invent the “wheels” for SDL 1.3,? IMHO

Regards

–Armin___________________________________________________________
Schon geh?rt? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Armin Steinhoff wrote:

Hi Nathaniel,

you wrote:

Written with none of the awesome low-level techniques that C allows, and with the known-to-be-horribly-inefficient-compared-to-C-alternatives-STL.

Yes … this looks like a strange approach … but who cares.?? The concept seems interesting for me … not the coding!

Using FreeType2 means that it’s inflexible.

… and what about the support of character sets from ASIA ??? To have this is a good sign for frexibility

Not actively maintained and not supporting SDL 1.3 .

Well, that’s wooden wheel from SDL 1.2.x??? … but you haven’e to re-invent the “wheels” for SDL 1.3,?? IMHO

Regards

–Armin

About ignoring C techniques in favor of less-performant C++ techniques: No, this is not a strange approach. This is very (almost painfully) common, generally made for no good reason and without regards to the impact on performance. That said, on any machine supported officially by SDL, it shouldn’t cause any noticeable problems.

About using FreeType: There is no limitation on almost any method for less common character sets, mine included. It’s inflexible because you’re stuck with the font types that freetype supports. What if I have a bitmap font I want to use?

About being able to just modify it for SDL 1.3: This will take more work and testing than writing my own library would. The library is also LGPL licensed, which means I can’t statically link to it and won’t use it personally, even if I modify the code myself to fully support SDL 1.3------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/