Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » A question for Steve Terry, Miran, Spellcaster and other GUI people!

This thread is locked; no one can reply to it. rss feed Print
A question for Steve Terry, Miran, Spellcaster and other GUI people!
Steve Terry
Member #1,989
March 2002
avatar

I can't compile the source though, or is it even ready to compile, I get an error that list cannot be found on #include <list>
I'm compiling with this:
D:\unzipped\algui[1]>g++ -c -I./include src/widget.cpp
and a bunch of syntax errors follow.

Anyway algui sounds appropriate for a name... but any other suggestions :) or maybe a codename ... that'd be cool.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

spellcaster
Member #1,493
September 2001
avatar

Um... ok, if we start to throw code around before we even have started to design this thing, then I'm out.

If you take a look around here, and count the number of unfinished/abandoned gui libs you'll see why starting another one without a good design first is not going to work.

Esp. the base classes need more thought. Reason for this is simple: Once you have the base classes coded, and add some classes on top, it's hard to change the design again ("since we already have working classes").

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Thomas Fjellstrom
Member #476
June 2000
avatar

spellcaster, have you also realized that the previous "projects" for new guis or other larg projects never got off the ground because noone actually started? I tihnk this is a good thing, show some code, and debate, at least then theres "something".. instead of a bunch of hot air.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

axilmar
Member #1,204
April 2001

Quote:

I can't compile the source though

Its the STL's 'list'. It compiles ok under MSVC++...

Quote:

Um... ok, if we start to throw code around before we even have started to design this thing, then I'm out

I will not claim to be "the" authority when it comes to guis, but I have given a lot of thought into the subject. I think that my Widget class is a very good start, and with a very good design.

Of course, I posted the code out as a basis for discussion, rather than as the definitive start. Since time is money though, I am gonna continue building on it. I am open to suggestions, and I would be very happy if I have some.

spellcaster
Member #1,493
September 2001
avatar

That's my point. So it won't be a team project, but we'll all start doing our own thing. Again.

Regarding your design, my major problem is that BITMAPs are not hidden. Another point is the way common gfx operation are perfromed directly.

But, as you said, time is money, and you have spend a lot of time thinking on this matter already.

I'll be glad to use your GUI lib as soon as it's finished.

Don't get me wrong folks, but exactly this is why group projects die very youg here all the time. A single developer might be able to jump start a project. He might even be able to finish it, even if he doesn't have a design (besides the idea in his head), but for a team project, this just doesn't work.

Like I said before, we all have spent quite a few time thinking about this topic. We all have worked with guis and developed our own enhancements, add-on or own systems.

But if we just say "here's my code. take a look, discuss it, but I'll do my stuff anyway" we'll end up with one gui lib per person.

If this is what you want, ok :)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Richard Phipps
Member #1,632
November 2001
avatar

Spell: Why don't you post some detailed ideas here so other people can see how you would approach this library?

I think people are rushing ahead too, but in fairness to axilmar, he has been most productive so far. :)

Why doesn't everyone discuss how they would design the GUI? Then we can have a discussion and (hopefully) reach an agreed design...

axilmar
Member #1,204
April 2001

Quote:

my major problem is that BITMAPs are not hidden.Another point is the way common gfx operation are perfromed directly.

Sorry, but I don't understand what you mean. If you mean that drawing should be abstracted, like Windows drawing on a device context, my opinion is that it should not, for the following reasons:

1) All allegro drawing must be encapsulated within a class. Too much work.

2) Too many indirection layers. Drawing a simple line will call the virtual method of the class, which in turn will add the widget's screen position to the line's coordinates, then use Allegro to draw, which will redirect the call to the BITMAP's vtable, which in turn will use DirectX or GDI or xlib to draw...

I don't think Allegro should be hidden, because there is a lot of functionality that needs to be wrapped up and this is quite tricky since it is not easy to tell what one might need upfront. I am not for a generic GUI toolkit, since it is quite difficult to achieve.

As I stated earlier, I am open to suggestions. (But I don't see any). Therefore, I am gonna proceed on my own, and whoever wants to jump in, is welcomed.

I've opened a sourceforge project. When I finish the event handling, I'll notify you of the link.

spellcaster
Member #1,493
September 2001
avatar

As soon as you start blitting directly to a bitmap, you'll end in the same dead-end as allegro's direct screen blitting.

Assume you have a GraphicContext class. Assume this class has a blit method. With a minor chang in that blit method, you can add a dirty rectangle system to all applications using the gui.

What about text output? If you textout your strings directly to a bitmap, you're stuck with the text rendering system you're using. If you decide to use Allegro Fonts, this means no true type support without changing all widgets.

Quote:

1) All allegro drawing must be encapsulated within a class. Too much work.

Doubt that. You need blit, textout, rect, rectfill and line.
If somebody needs more, he can just add them to the GC and all apps can use them.

Quote:

2) Too many indirection layers.

Exactly one more than before.

Quote:

I don't think Allegro should be hidden,

There's no need to hide allegro completly. But the whole idea is to give you a flexible way to access GUIs.

The system you're proposing is as limited as the current allegro gui. It just adds some fluffy classes arond basically the same functionality and adds containers.

Quote:

As I stated earlier, I am open to suggestions.

Um , no you're not. YOu have started implementing already, this means that you have already a fixed plan in your mind. That's not a bad thing, but it makes planning pretty pointless, since you don't want to design a GUI, you want to implement one.

Quote:

(But I don't see any)

In that case, you should actually try to read what's written here ;)

Quote:

Therefore, I am gonna proceed on my own, and whoever wants to jump in, is welcomed.

Hehee.. that's exactly what I said a couple of days ago. Who needs team projects anyway, heh.

I wish you good luck with your GUI.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Thomas Fjellstrom
Member #476
June 2000
avatar

Spellcaster, was it you who emailed me about my gui? Sory, I've just been having a rough time..

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

axilmar
Member #1,204
April 2001

Spellcaster, I will be straight with you: I don't like this nitpicking of my words. We are here to do a job, not to play "who's the smartest". Anyway, for defending myself, I will also nitpick your talking:

Quote:

Assume you have a GraphicContext class. Assume this class has a blit method. With a minor chang in that blit method, you can add a dirty rectangle system to all applications using the gui.

There is no point in adding a dirty rectangle system in a GUI library. For the following reasons:

1) applications only need double-buffering, they don't need a dirty-rectangle system or any other system whatsoever. My Widget class uses double-buffering to blit to the screen only the portion that is updated. For example, if a small button is redrawn, the part of the screen that will be affected is only the part that is updated by the button. Overlapped and foreground widgets will be drawn to the buffer too, but clipped accordingly.

2) The dirty rectangle system is needed only for games that their screen does not change so often. This is valid only for a small amount of games, since most games will update the whole screen every frame. And the dirty rectangle system only fits with buffering and not with page flipping. Therefore, a dirty rectangle system is deemed unnecessary.

3) I don't like animated GUIs for applications. When using an app, I would like my menus to instantly pop up and not every time to go through some silly animation.

In the light of the above arguments, we can safely deduct that a GUI lib does not need a dirty rectangle system or any other drawing system. Remember, the library should be as thin as possible.

In case that you are so desperate and you need a dirty rectangle system whatsoever, you can always add the required functionality at the end of the 'redraw(x1, y1, x2, y2)' method, at the line that the buffered content is blitted to the screen. This can be applied to any other system of drawing.

Quote:

What about text output? If you textout your strings directly to a bitmap, you're stuck with the text rendering system you're using. If you decide to use Allegro Fonts, this means no true type support without changing all widgets

This is already solved. True type rendering will be done by using the excellent AllegroFont library. My library will have a Font base class with text measuring and drawing methods, an AFont class for using Allegro fonts and a TFont class for using AllegroFont fonts. Example:

1//font base
2class Font {
3public:
4 virtual void textOut(BITMAP *bmp, const char *text, int x, int y, int color);
5};
6 
7//Allegro font
8class AFont {
9public:
10 virtual void textOut(BITMAP *bmp, const char *text, int x, int y, int color) {
11 textout(bmp, _font, text, int x, int y, color);
12 }
13private:
14 FONT *_font;
15};
16 
17 
18//AllegroFont font
19class TFont {
20public:
21 virtual void textOut(BITMAP *bmp, const char *text, int x, int y, int color) {
22 alfont_textout(bmp, _font, text, int x, int y, color);
23 }
24private:
25 ALFONT_FONT *_font;
26};

Quote:

Doubt that. You need blit, textout, rect, rectfill and line.

Nope. You need gui textout, raised 3d rect, sunken 3d rect, 3d circle, 3d line, line drawing with patterns for drawing the focus lines in buttons/ check boxes/radio buttons/list items/tree items and other items, ghouraud shading for drawing beatiful window captions, stretch blit for filling the application's background with a bitmap (as if it was the desktop/root window of a window system), skin blit for drawing those skins with a border, frame drawing (sunken, raised, window, bevel, whatever)...

Not only you need more stuff, but these extra drawing functionality is done by combining the various Allegro calls.

Quote:

If somebody needs more, he can just add them to the GC and all apps can use them.

And if you really thing about the applications, they may need even more drawing routines: drawing a tilemap, drawing a line with width more than one pixel, etc. These complex drawing routines will be very slow if they go through a 'graphics context'.

So you can't really say to the programmer "what ever new drawing stuff you need, you need to encapsulate it in a new GraphicsContext class". That's stupid, and the programmer will blame you all day for this stupid decision. Why not allow him/her to draw everything using straight Allegro calls, as if the widget was alone on the screen ? and then the GUI system will take care of the updating as needed.

Quote:

Exactly one more than before

But there are already 5 to 6 layers out there. If you add one more, then it will be super slow. There is no need anyway to add another layer, as I have previously demonstrated.

Quote:

The system you're proposing is as limited as the current allegro gui. It just adds some fluffy classes arond basically the same functionality and adds containers.

You are totally wrong. Can the Allegro gui do the following:

1) draw overlapped widgets when a widget is redrawn ?
2) automatically manage geometry of the GUI ?
3) have bufferred mode drawing ?
4) do an event loop ?
5) do modal dialogs without interrupting the main event loop ?
6) have hierarchical accelerators that are registered dynamically so as that dialogs can be incorporated into the main GUI itself and work the same ?
7) browse the whole GUI using tab/shift + cursor keys ?
8) allow ancestor widgets to repaint themselves differently if a descentant widget has the input focus ? (so as that the input focus part of the screen is always easy to track down)...

Not only that, but the Allegro's GUI does not have toolbars, workspace, tree view and other very crucial widgets.

What am I saying ? the Allegro gui can't even allow the programmer to dynamically add widgets to a dialog!!!

Quote:

Um , no you're not. YOu have started implementing already, this means that you have already a fixed plan in your mind. That's not a bad thing, but it makes planning pretty pointless, since you don't want to design a GUI, you want to implement one.

Hey, make a suggestion that's worthy enough and I will incorporate it in my implementation. Or you can incorporate it, but I really doubt it they way this discussion is going.

"some fluffy classes". This type of critism makes me very angry because it is unfair, and I don't see the reason why should I be insulted by you the way you do! You want to play smartass ? I don't, I just want a proper GUI for Allegro, that's all.

Quote:

Hehee.. that's exactly what I said a couple of days ago. Who needs team projects anyway, heh.

Well, if you decide to jump on the train, or anybody else, it would be a team project. Your attitude is not very encouraging though.

Quote:

I wish you good luck with your GUI.

Basically, you should say "I am sorry, I have not really understood your design"...By your comments, I can understand that you don't have absolutely no idea about the real GUI issues, since you only talk about drawing: geometry management (which is THE main problem), keyboard management and input focus, etc...the update method is a minor problem that can easily be solved in one place at the code (as I have said above).

P.S.: and a wide range of classes to cover all types of problems!!!

P.S.: I haven't made any design about the widget classes themselves. If any of you want to really help, you can do the design and coding of the classes from A to Z.

spellcaster
Member #1,493
September 2001
avatar

Quote:

Spellcaster, I will be straight with you: I don't like this nitpicking of my words.

Hm.. the only thing you could interpreted as nitpicking was the frame/window discussion... and if you take at my post (the one before your post) I had already explained the meaning of words... but, anyway... I always like a good argument :)

Quote:

1) applications only need double-buffering,

Um, why?
Don't you think there's a reason almost every gui there is has a dirty rect system?
And even if you think your applications don't need a DR system, why do you think it's bad?

Quote:

My Widget class uses double-buffering to blit to the screen only the portion that is updated

Either you're saying "I'm blitting only the part I'm blitting" or you're saying "I'm only blitting the part that has changed".
The first one makes no sense, the second one is either a DR system or pretty inefficient.

Quote:

2) The dirty rectangle system is needed only for games that their screen does not change so often.

Again, what you're doing here is to limit yourself for no particular reason.
If your game has a "play area" and "status/ control" area, only the game area needs to be repainted every frame. No need to blit the complete GUI if only one button has changed.

Also, the DR system would allow you also to invalidate parts of the GUI. Assume that your game draws something over the gui (say for a tutorial, or a very special effect).

Well you can blit everything, but why should you?

And even if you don't like DR systems, why do you force everybody not to use them?

Quote:

3) I don't like animated GUIs for applications. When using an app, I would like my menus to instantly pop up and not every time to go through some silly animation.

People have written what they'd like to see in there gui of choice. Obviously stuff like animation is wanted. Obviously you don't care.
That's fine. As I said, do your own thing. That's ok and no problem at all.

Quote:

In the light of the above arguments, we can safely deduct that a GUI lib does not need a dirty rectangle system or any other drawing system. Remember, the library should be as thin as possible.

You do realize that the whole idea of a group discussion is to get the idea of the group? :)
It's ok if you have a closed mind and a ficed feature set. But don't try to enforce it. First off all, it won't work, and secondly it's pretty pointless.

Regarding your idea of a Font doing text output... well, your choice. You're mixing here two different things though, but it's your GUI, so you're free to do what you want.

I could give you a couple of reasons why this is bad, and in what limits this will impose on you, but I'm quite sure that you have considered this already and dismissed it as "not needed".

Quote:

Nope. You need gui textout, raised 3d rect, sunken 3d rect, 3d circle, 3d line, line drawing with patterns for drawing the focus lines in buttons/ check boxes/radio buttons/list items/tree items and other items, ghouraud shading for drawing beatiful window captions, stretch blit for filling the application's background with a bitmap (as if it was the desktop/root window of a window system), skin blit for drawing those skins with a border, frame drawing (sunken, raised, window, bevel, whatever)...

You do realize that this can be done with the methods I listed a Context capable of holding a state?

Besides the goroud shading :) But I'd say that a simple gradient floodfill should do the trick as well. No need to add 3d routines to a standard title bar.

The idea is to maintain a small interface, not to bloat it. If you list these drawing routines, and then start to group them by category, and then take a look at the similarities and differences, you're one step closer to a design.

Just a small example: Your sunken/raisen stuff. You do realise that if you have a shadedRect() or something a sunken and raised border is painted by the same routine, just with different parameters?

And that a "skin blit" is just a blit?
Don't make things more complicated than they are... try to make your interface simple :)

Quote:

But there are already 5 to 6 layers out there. If you add one more, then it will be super slow.

No comment on that one. But I added it to my list of possible sigs :)

Quote:

What am I saying ? the Allegro gui can't even allow the programmer to dynamically add widgets to a dialog!!!

I won't quote Prachett here, but it's very tempting.

Regarding adding widgets to dialogs: Of course you can do this. Requires you some minor tweaking of your DIALOG struct, but it works fine. Same for most other stuff on your list.

And the remaining feature are just layout / container related ;)

Quote:

Hey, make a suggestion that's worthy enough and I will incorporate it in my implementation.

:)
As I said, you can implement what ever you want. As you said it's your GUI. I don't want to convince you, it's your code, your lib, feel free to do what ever you want.
But you do realize that this thread was about collecting ideas for a new gui. Designed and implemented in a team effort? And "Team" and "my gui" don't mix well ;)

Quote:

Well, if you decide to jump on the train, or anybody else, it would be a team project. Your attitude is not very encouraging though.

I see no point in jumping on your "wagon". As you pointed out already, it's your GUI. You also seem to be very convinced of your design. Well, I'm not. I've also explained what's limiting your approach.

Quote:

By your comments, I can understand that you don't have absolutely no idea about the real GUI issues, since you only talk about drawing: geometry management (which is THE main problem), keyboard management and input focus, etc...the update method is a minor problem that can easily be solved in one place at the code (as I have said above).

You do realize that thes points have been addressed already? You did read the posts in this thread, right?
YOu do also realize, that the updating problem is the most limiting factor in the current gui?

You do also realize, that the proposed event model, with the outline event flow will keep track of input focus?

Quote:

haven't made any design about the widget classes

No need to point that out. It was pretty obvious already.

Quote:

If any of you want to really help

You really think that thi is about your GUI, don't you?

But I agree, that after this discussion, the chances are pretty bad to get team effort towards an allegro gui on the way.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Richard Phipps
Member #1,632
November 2001
avatar

I'd hate to think that one of my thread's started a flame war people..

:'(

axilmar
Member #1,204
April 2001

Quote:

Hm.. the only thing you could interpreted as nitpicking was the frame/window discussion...

Nope. You took every line that I wrote and replied to it. And the replies were not that good.

Quote:

Um, why?
Don't you think there's a reason almost every gui there is has a dirty rect system?

Well, no real GUI has a dirty rectangle system: MS Windows, X-Windows, the Photon MicroGUI, the OpenWindows, the NEWS system all use regions.

MASKinG has dirty rectangles, because it implements animation on the desktop.

Quote:

And even if you think your applications don't need a DR system, why do you think it's bad?

I did not say it is bad, I said it is unecessary. Let me repeat the reason:

Only the affected area is double-buffered.

Quote:

Again, what you're doing here is to limit yourself for no particular reason.
If your game has a "play area" and "status/ control" area, only the game area needs to be repainted every frame. No need to blit the complete GUI if only one button has changed.

I am not limiting anything. Perhaps you have not understood my update system. Let me go through it, one more time:

A. there are two buffers at each given time: the screen, and a back buffer.

B. widgets draw on the back buffer; widgets behind them are redrawn and widgets above them are also redrawn on the back buffer; the end result is blitted on the screen.

C. Only the area affected by the redrawn widget is blitted to the screen.

So, if a button is updated, it will draw itself either directly to the screen, or to the back buffer. Then, the library will blit to the screen the affected area.

There are two cases here:

1. The button's state change is immediately drawn to the screen. This happens automatically when there is no back buffer.

2. The button's state change is immediately drawn to the buffer. This happens automatically when there is a back buffer.

Now, if there is a buffer that the game draws onto, you can:

1. Either draw the GUI directly to the screen, but have the special effect blitted from some other buffer.

2. Or draw the GUI on the widget back buffer, which will blit itself to the screen.

3. Or draw the GUI on the game buffer, using screen = game buffer, then blit the game buffer to the real screen.

I don't see any other case. So, I don't think there is a need for a dirty rectangle system.

Quote:

People have written what they'd like to see in there gui of choice. Obviously stuff like animation is wanted. Obviously you don't care.
That's fine. As I said, do your own thing. That's ok and no problem at all

People have also stated that they need tools to write their games, and almost everyone has tried his own version of a tilemap editor, with no particular success, due to the lack of a good gui.

A GUI toolkit for writing Allegro tools is a priority over a GUI toolkit for games. How many games need special effects and combo boxes, for example ?

I think there is small minority that needs special FX in the GUI. And if you need it so badly, you can always animate widgets by the traditional way, i.e. change their state and geometry.

And even if you do want so much special effects, I have told you that it is the easiest thing to add a DRS system to my design. There is a method called 'redraw' which draws either directly to the screen or to the back buffer. The last line calls 'blit' to blit the back buffer to the screen. You can replace this call with a call to the DRS system.

The next version of my class will have it, so as that I prove to you that it is the easiest thing to do.

Quote:

Besides the goroud shading But I'd say that a simple gradient floodfill should do the trick as well. No need to add 3d routines to a standard title bar

Yes, but how you can quicly draw a gradient floodfill ? Instead of making your own routine using Allegro, you can use 'quad3d' and achieve the same result.

Quote:

The idea is to maintain a small interface, not to bloat it. If you list these drawing routines, and then start to group them by category, and then take a look at the similarities and differences, you're one step closer to a design.

But I am the one who doesn't want a 'GraphicsContext' class for avoid the bloat!!!

Quote:

Just a small example: Your sunken/raisen stuff. You do realise that if you have a shadedRect() or something a sunken and raised border is painted by the same routine, just with different parameters?

Besides that, you don't have any other example.

Quote:

And that a "skin blit" is just a blit?
Don't make things more complicated than they are... try to make your interface simple

It seems that you have not try skinning. Skin blit is not just a blit: it is a routine that creates 9 sub-bitmaps of the skin bitmap, uses the outer subbitmaps for the borders, and the inner one for the filling. Check out MASKinG. It's easy to talk when you don't know shit.

Quote:

No comment on that one. But I added it to my list of possible sigs

Feel free to put it!!! and put my name next to it, but don't forget to put the rest of the text too...because it might look silly out of context, but I talked about COMBINATIONS of drawing calls and the ONE MORE LAYER that it will make it super slow.

Quote:

As I said, you can implement what ever you want. As you said it's your GUI. I don't want to convince you, it's your code, your lib, feel free to do what ever you want.
But you do realize that this thread was about collecting ideas for a new gui. Designed and implemented in a team effort? And "Team" and "my gui" don't mix well

It's my gui because I designed it and wrote it so far. If you participate, it will be 'our gui'. Simple, isn't it ?

Quote:

see no point in jumping on your "wagon". As you pointed out already, it's your GUI. You also seem to be very convinced of your design. Well, I'm not. I've also explained what's limiting your approach

Nope, you did not explain. You just said "other systems use DRS, so yours should also do the same" without justifying why.

As I said earlier, I am posting the code for demonstration reasons. I want people to look at it and say "ok, here is a bright idea, for so and so reasons", or "here is a silly idea, for so and so reasons". But I want arguments, no silly 'others do it this way, so we must do it that way'...

Quote:

You do realize that thes points have been addressed already?

Geometry management ? were ? I am the only person that talks about it. I must be the only one then that gets irritated for having to specify each widget's geometry by hand!!!

Quote:

You did read the posts in this thread, right?

I don't want to be ironic. Let's keep the discussion in a good level.

Quote:

You do also realize, that the proposed event model, with the outline event flow will keep track of input focus?

I did not see any post about "event flow" or "input focus". I am not sure about what you mean, but I have already implemented it and it is indepentent of the event flow: you can change it by hand, if that is necessary.

You haven't realize a hidden trap in the focus management: that of toplevel windows coming forward when a control is clicked. In my widget class, when a widget gets the focus, all ancestor widgets are notified that a descentant of them got the focus. By this way, they can bring themselves forward and/or change their appearance, without ever knowing if they are toplevel or not.

This is quite a good design, don't you think ? I have never anywhere else someone talk about it, though.

<quote>
You really think that thi is about your GUI, don't you?

But I agree, that after this discussion, the chances are pretty bad to get team effort towards an allegro gui on the way.
<quote>

It's not about 'my gui', its about Allegro not having enough game tools or an easy way to write one.

Steve Terry
Member #1,989
March 2002
avatar

Aigh... somehow I knew this would happen. But I agree this has become Alixmar's lib and not a team lib. It's not a bad thing that we've gotten a framework going, but because it kinda came out of nowhere there's going to be disagreements. For all I knew MSWindows and X-Windows uses a dirty rectangle systerm, but what is regions? I mean as long as you aren't using pure double buffering and you only redraw to the screen what has changed, then there's not much to worry about, both do the same thing. The reason you don't use double buffering is because the speed of the GUI will be dependent on the system and the resolution being rendered at. With a DRS system it's only noticeable if you are resizing or dragging a large dialog around at high resolutions or a large size. I'm not going to consider myself a GUI master or anything by far, I'm still learning on what it takes to make a decent GUI, and yes mine doesn't have a lot of the features algui has. But if we can't decide on how to work together, then yes, it'll just become alixmars project. I think partially it's due to the fact that this discussion is taking place in a forum where realtime discussion can't take place. I don't know, but it's nearly impossible to make everyone happy. But seriously, without knowing your plans we can't be expected to know how your GUI works or how to add to it as a team, I fear that yet another GUI thread has come to a close :(
Oh and you keep wanting a "quick" GUI implimentation, I understand you don't want to be writing this lib forever, but there is nothing "quick" to writing a GUI, if you take shortcuts or don't weigh the different possibilities then it will fail.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

You took every line that I wrote and replied to it. And the replies were not that good.

That's not nitpicking ::)

Quote:

People have also stated that they need tools to write their games, and almost everyone has tried his own version of a tilemap editor, with no particular success, due to the lack of a good gui.

*cough*

Quote:

It's my gui because I designed it and wrote it so far. If you participate, it will be 'our gui'. Simple, isn't it?

Yes, but the idea isn't to help you with your GUI, it's to get a design most people can agree and collaberate on.

Anyway, it looks like everyone's just going to write there own (which is about what happened last time this came up) so I guess we'll just see who can put their money where their mouth is. I was thinking of writing a GUI lib too, but since everyone praises Swing, maybe I'll wait until I've gotten into Java before I begin with an inferior design (I was just going to (mostly) emulate Win32) ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Richard Phipps
Member #1,632
November 2001
avatar

Axilmar:

The problem I see is that you have presented a design within a few days of this thread being started and are now implementing it.

To me this suggests two possible reasons:

1) You are jumping into something without a proper design.
2) You have spent a lot of time previously on thinking about designs and are now implementing them.

I suspect you are going with reason number 2. Which in one way is really great as you can put your experience and knowledge to good use! However, this approach is in contrast to your earlier posts about debating the best design and having a democratic vote on these issues.

I think this is what is putting people off, you have not put up a proposal for debate. You put up a proposal and now are implementing it while the debate is still going on.

BTW: I didn't see Spellcaster's points as personal criticisms even if it seemed they bothered you. His debates with Korval were legendary on the board, but I never read the critiques he presented to Korval as personal (I'm thinking of the original critique in those threads, not the reactions!).

I think your experience and knowledge is very useful for making a good GUI. However IMHO you need to let people have a say in the design and features else it truly will be only your library.

axilmar
Member #1,204
April 2001

What is a region, you ask ? a region is a table of rectangles that represent the visible portion of a window. All drawing operations are clipped within each rectangle of a region. Each time a window appears, disappears or resizes, the windows below get a new region.

In case you truly want to learn how regions work, have a look at MxWindows (which I wrote 3 years ago).

Basically, everything revolves around understanding how to 'subtract' a rectangle from another rectangle.

Let's say we have two rectangles, A and B. The operation A - B can have the following results:

No rectangle if B totally overlaps A.
1 rectangle if B overlaps half of A.
2 rectangles if B overlaps one quarter of A.
3 rectangles if B overlaps some side of A partially.
4 rectangles if B overlaps part of A but it is completely inside of A.

So, after the subtraction, the result set of rectangles is kept in a table, called a REGION.

Professional window systems use regions to make Windowing possible. Regions were first used in Apple's Quickdraw, back in the 80s.

A clever Dirty Rectangle System will use the same algorithm for overlapping updatable portions. When using a DRS, there is only one region that is calculated as the programmer adds dirty rectangles to it.

I have done a dirty rectangle system in 1996, where I wrote a MsPacMan conversion for DOS in Turbo Pascal 6 (which got me the first prize in the PC Master magazine!!! after two months, the excellent Pc-Pac and Pc-MsPac came out, and then after few months MAME was a reality...).

Quote:

But I agree this has become Alixmar's lib and not a team lib. It's not a bad thing that we've gotten a framework going, but because it kinda came out of nowhere there's going to be disagreements.

Ok, forget my library (which is not a library at all, just a class). I am all ears.

Quote:

cough

Sorry mate. I understand that you did quite a big amount of work. But, for example, can I take your tilemap editor to Linux ? Nope...because its a win32 only app.

I hope you understand now that a decent GUI lib for Allegro is needed.

Quote:

Yes, but the idea isn't to help you with your GUI, it's to get a design most people can agree and collaberate on

But that's what I said. But...what is better than to communicate ideas other than the source code itself ?

Quote:

The problem I see is that you have presented a design within a few days of this thread being started and are now implementing it
1) You are jumping into something without a proper design.
2) You have spent a lot of time previously on thinking about designs and are now implementing them.

Ooops. I didn't expect that people will think that I did not do a good design. As I have told before, I have made more than 50 tries to write a good gui. I have big experience with guis, and I know Win32, MFC, Qt, Swing, Photon, XLib and Motif/Lesstif.

Ok guys, as I said before, forget my library. I will personally use it as a testbed for new ideas. But...

Lets make a GUI, shall we ?

Sooner or later you will face the same problems as I did. And I can tell you, the drawing mechanism is the least of the problems. I can guarantee you that.

Ok, here are the requirements for now:

1) DRS (I hope Spell is happy now)
2) A graphics abstraction layer

Anything else ?

Thomas Fjellstrom
Member #476
June 2000
avatar

I agree with axilmar that DRS is NOT the way to go. I started thinking about DRS when working on my gui, and I realized even that wouldn't be enough. You want regions. plain double buffering is just wrong, so don't think about it :o (waaaaayyyyyy to slow)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Steve Terry
Member #1,989
March 2002
avatar

Ok pardon my ignorance with DRS and regions, but we should all be open to ideas, and I have to give Axilimar credit if he did design or use all of those GUI's. Unfortunatly for me anyway a lot of this terminology goes over my head at times because I've never heard of it or implimented it myself. I guess I'd be more helpful for implimenting the stuff on top of the widget subsystem but I hope my discussion on how to impliment multiple theme types such as BeOS/Windows/Mac helped some. Another thing was the font class you had implimented with alfont, a simple textout won't really do it since that has no way of doing the && special character shortcut, text shadows (think beveled disabled text in windows), bold/italic/underline text, fixed width output, centered/right justified text, and maybe a way to justify it by clipping or adding the "..." at the end to make it fit. A font GUI class should be able to support at least that. I've managed in my lib to bring it down to a single function that handles everything via a bitwise flags variable. Another way would be a tagged text method where the format of the text is encoded within the text string that is sent in. I've had discussions on this implimentation myself and both methods have strong and weak ponts, the latter is better for a wordpad type application for example but would just call the first function within as new tags are read and set. Also a way to support multiple fonts should be implimented though the best way to do so is soemthing I have yet to figure out as well.

Ok with that said and Axilmar's apology lets keep this going please ;D My first complaint though is that allegro shouldn't be the place for really decent discussion, remember it's post, wait, reply, wait which is a bottleneck. Is there some other way for realtime discussion and a way to post ideas/code snippets. Maybe a channel should be opened on IRC such as #algui or something where we can all get some realtime discussion going.

Also Axilmar remember that I'm rusty on C++, I have nothing against using it, but don't make it pure C++ or we will limit those who do not wish to switch to C++ just to use a lib. Also STL is broken on MingW so your <list> will need to be addressed, or is it just my install that's bad?

Anyway I'm glad to see this kind of flexibility, I thought you were just going to move on with your own implimentation but I'm glad things turned around for the best. For now though I'm going to read up on regions and how they fit in. Also if you want some quick region code look to me or Miran, we've both written code to split regions into non-overlapping regions/rectangles for our DRS implimentation. I do mine slightly differently though keeping the rectangles as wide as possible for scan line optimization.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

axilmar
Member #1,204
April 2001

It's true that you can't do anything serious with this type of discussion. We need to chat online about it.

DRS is only good if you have 1 level of widgets, like the Allegro gui does. If you have widget trees, you need to search the widget tree to see what widget to redraw, clip widgets, etc.

DRS/Regions are slow if you have lots of small widgets (tool buttons, for example). And if you have non-opaque widgets, then it gets very complicated. In Windows, for example, windows need to use other APIs to implement translucent windows than the normal ones (under Windows, a translucent window forces windows under it to draw themselves on a back buffer, and then the system updates the screen by blitting from the back buffer).

Double-buffering is good if you update and blit only the affected area. If you draw all widgets each time a tiny button changes, then you are out of luck. If you think about it, A gui usually has small changes and only the foreground widgets change often. So double buffering is enough and covers all cases of widget types (non-opaque, translucent, non-rectangular, small widgets, etc).

PS: I did not apologize. I don't need to apologise to anyone, because I haven't said anything to apologise for. Another person (*cough* Spell cough) must apologise to me for calling my code "some fluffy classes" without even understanding what is going on.

My event system is ready. It has the following capabilities:
-sloppy and click focus type
-drag-n-drop
-the main event loop is never delayed, even for "modal" dialogs and menus
-left handed mouse optional
-multiple click counter (depends on the widget to accept less than 3 clicks; it is provided for all those cases that a triple/multiple click is needed).

If anyone cares to see it, I will post it here.

I am working on my DRS system. Right now it works, and it takes 10 lines of code. I did it just to confirm that it is possible. I have to optimize it further though.

PS2: the DRS system is ready.

X-G
Member #856
December 2000
avatar

I would be VERY interested in seeing your system, axilmar. Just so you know. :P

Oh, and I remembered some more examples where action and a GUI system is required at the same time - MMORPGs. Look at Asheron's Call, or Tibia, or any other recent MMORPG, and you'll see what I mean.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Richard Phipps
Member #1,632
November 2001
avatar

Yes, I would also be interested in seeing this system.

axilmar
Member #1,204
April 2001

Ok, here it is in the form of zipped source code(attached file which contains html help in the 'docs' directory: file 'index.html').

The DRS is enabled: every half second the screen is updated. See method 'setUpdateCallback'.

Press and hold the left button down over a widget and move it around with the mouse.

You can also change the video mode by using Alt+1, Alt+2, Alt+3 keys. You can exit the app by pressing Alt+X. All these are set using 'setAccelerator' at the root widget.

There are many other thing to see:

1) drag-n-drop (search for the 'beginDragAndDrop' call). Data query and exchange are done through the 'queryData' and 'getData' widget methods applied on the widget retrieved by the 'Widget::dragAndDropSourceWidget()' method.

2) event handling: uncomment 'textout' and 'textprintf' in the event handling methods to see event output as it happens.

3) geometry management: some widgets are maximized and always follow the size of the parents, some widgets enforce a specific layout on their children.

4) event grabbing: when you press a button over a widget, it grabs events, then it moves itself around on 'processGrabbedEvent' method. This allows for a widget to control the event flow without leaving the main event loop. My menus will be implemented like this.

5) focus management: press tab, tab+shift or the cursor keys to move the focus around. Widgets with the focus draw themselves with a thick black border. If you search the code, you will see that the focus goes to instances of the Test class that don't have children (method 'focusable()'.

6) sloppy focus: uncomment the line 'Event::setFocusFollowsMouse'.

7) timers: widget 'form1' has a timer that is called every 1 second. This will allow blinking cursors, button repeaters, autoscrolling when the mouse arrives at widget edges etc.

8) left handed mouse: uncomment the line with the call to 'setLeftHandedMouse'.

9) multiple clicks. The left button up handler prints the number of clicks. You can use 'Event::resetClicks()' to restrict the amount of clicks to 2 in each widget.

If I ever finish this library (highly impropable, since no one is willing to lend a hand), it will not use DRS by default, it will use double buffering, since the purpose of this library is to build Allegro tools.

(Right now I am off to designing my widget classes. If a development team is made to make the ultimate allegro gui, I will be very happy to participate and give a hand. When this happens, I will abandon my gui.)

PS: This work is the culmination of 7 years experience with guis.

Richard Phipps
Member #1,632
November 2001
avatar

That's a lot of code! When did you start writing all this? It all looks very impressive, even if I can't understand what's going on! ;)

However, you did confuse me with this:

Quote:

If I ever finish this library (highly impropable, since no one is willing to lend a hand), it will not use DRS by default, it will use double buffering, since the purpose of this library is to build Allegro tools.

(Right now I am off to designing my widget classes. If a development team is made to make the ultimate allegro gui, I will be very happy to participate and give a hand. When this happens, I will abandon my gui.)

So you probably won't finish this library and if people offer to help you to make a new GUI you will abandon it anyway? Or did I misunderstand..

axilmar
Member #1,204
April 2001

I wrote it last week, Richard. As I have told earlier, I have done more than 50 tries to reach this state, so I was pretty sure of where to go. It's an amalgamation of various solutions I discovered on the go.

If people help me with this code, it will be finished. If people don't help me with this code, but they decide they will start from scratch, I will abandon mine and offer my workforce to the common cause.



Go to: