View previous topic :: View next topic |
Author |
Message |
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Wed May 04, 2005 6:10 pm Post subject: TechDemo #5 - GUI |
|
|
For anyone willing to try it out, I've compiled a nice .rar archive with a simple GUI demo. Grab it from:
http://158.75.59.9/~h3/code/heresy/test5.rar (approx 1MB)
The current GUI features include:
- GTK's HBox and VBox for widget packing
- Window (resizable, though the cursor doesn't change)
- Frame (just a convenient way to set padding to a group of widgets)
- EditBox
- Button
- Checkbox
- StaticText
- List
- EmptyWidget (useful as a separator / space eater)
The current todo list:
- scrollable windows
- combo box
- multiple layers (will need that for multiple windows and combo's)
- focus switching / handling
- size groups
- menus
* The List widget supports all the usual ctrl and shift manipulations + mouse actions.
* Window can be resized by dragging its corners. Dragging the window's edges will move the window.
* As a reference for the multiple boxes / buttons: http://www.gtk.org/tutorial/sec-detailsofboxes.html
* In future it will be possible to define themes as dynamic libs.
Sidenote: there's currently Polish language support in the input subsystem, but I don't know how to add generic Unicode. I'm using SDL's unicode translation but the characters SDLttf gives me for that codes aren't what they should be. For this reason I'm temporairly using a simple mapping from what SDL gives me to dchar's. The Polish language support is one case of such a map (encapsulated in a class) Adding new languages wouldn't be a problem, yet having this done automatically would ease some pain Any ideas/info ?
Last edited by h3r3tic on Tue Dec 13, 2005 7:02 pm; edited 1 time in total |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Thu May 05, 2005 9:43 am Post subject: |
|
|
In case anyone wants to try my brand new cursor support:
http://158.75.59.9/~h3/code/heresy/test5_cursorsPatch.rar
(extract to the same directory as test5.rar and replace the .exe)
The cursors are .png and .conf files compatible with GNOME ( actually, taken from www.gnome-look.org )
/+ You can now try the fullscreen mode by editing the config.cfg file, just don't change the resolution since 800x600 is hardcoded in a few places and changing will cause the GUI to be stretched / shrunk +/
// off to add some scrollbars
Last edited by h3r3tic on Tue Dec 13, 2005 7:02 pm; edited 1 time in total |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu May 05, 2005 4:25 pm Post subject: |
|
|
cool, i don't have time to test this out (yet) or a windows machine (yet), so are you using the GTK gui? or did you make a GTK like GUI work under opengl? Just curious. Keep up the good work : ) |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu May 05, 2005 6:04 pm Post subject: |
|
|
that's pretty neat : ) how long did it take you to code up? |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Thu May 05, 2005 6:10 pm Post subject: |
|
|
Thanks It took me the last 2 weeks or so... I'm hoping to finish it soon. I've coded scrollbars, viewports and a part of the ScrollableWindow widget today. Just a few more widgets, some tweaks and the GUI will be more than sufficient |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu May 05, 2005 7:35 pm Post subject: |
|
|
Awesome. So did you already know GTK, or did you quickly teach yourself GTK and then make a similar GL equivilent?
GUI's are almost like projects on their own. |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Thu May 05, 2005 7:43 pm Post subject: |
|
|
It's nowhere near GTK in its total functionality... GTK is a huge project and my GUI is only meant as a simple in-game/engine windowing toolkit.
As for your question, I've done some PyGTK programming in the past so I knew some of its structure. I liked it a lot so I'm taking some ideas/solutions from it. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Thu May 05, 2005 10:37 pm Post subject: |
|
|
Tom,
I tried it out. It works great! I really like simple GUI's like that. In fact I vastly prefer the "flat" widget type idea over most modern 3D rounded widgets you see these days. It looks clean and fast. It adds finesse to the project. I wish more UI designers these day would move away from graphics overload mentality. Leave that for the games. UI's were not meant to be complicated.
-JJR |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Fri May 06, 2005 11:44 am Post subject: |
|
|
Thanks for the feedback I'm glad you're enjoying my project. If I find enough time I might release the GUI as a separate library, as its biggest dependency upon my engine is the input subsystem. Apart from that the GUI is a separate being (and of course heavily uses Derelict -> thanks goto Aldacron)
/* For me it looks clean and it IS fast I'm getting over 1000 fps when in fullscreen mode. On a Riva TNT card this gets down to about 60, but the rendering is still a bit brute-force and needs some work. Then it's gonna be faster */ |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sun May 15, 2005 2:50 pm Post subject: Re: TechDemo #5 - GUI |
|
|
h3r3tic wrote: | Sidenote: there's currently Polish language support in the input subsystem, but I don't know how to add generic Unicode. I'm using SDL's unicode translation but the characters SDLttf gives me for that codes aren't what they should be. |
I figured it out. SDL is giving me ISO-8859-2 (standard Polish encoding), not UTF. Probably a simple mapping that I've used is a good solution (unless I decide that I need a monster like iconv or icu) |
|
Back to top |
|
|
deed_y
Joined: 29 May 2005 Posts: 2
|
Posted: Sun May 29, 2005 6:56 pm Post subject: |
|
|
Hello.
I gave a look at your site and I've got to say I was impressed. I'm particularly interested by your GUI coded with OpenGL, it looks nice, but I wanted to say that your demo (test5) uses rather high CPU resources
It uses 85? of my cpu power on my athlon xp with 1,6Ghz ! (exactly like your test4 demo by the way )
Do you have plans to improve performaces ?
By the way will you release the code source for your samples (test4, test5 ...) ?
Another question, did you have a look at the yaneurao library and samples (here : http://www.sun-inet.or.jp/~yaneurao/dlang/english.html). It is also very impressive (see the glexceed demo porting to d, and the samples), badfully all doc and comments are in japanese ! (that's very typical of japanse programmers, they do wonderful stuff but nobody can use it outside japan because they do not talk english, although every programmer in the rest of the world talks english )
Hope you will keep up the good work, cause D certainly needs good libraires (especially a good gui !) in order to be more used and known. |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Mon May 30, 2005 1:41 am Post subject: |
|
|
Disclaimer: I'm just having classes at my uni so if this post contains bugs, forgive me
deed_y wrote: | Hello.
I gave a look at your site and I've got to say I was impressed. I'm particularly interested by your GUI coded with OpenGL, it looks nice, but I wanted to say that your demo (test5) uses rather high CPU resources
It uses 85? of my cpu power on my athlon xp with 1,6Ghz ! (exactly like your test4 demo by the way )
Do you have plans to improve performaces ? |
It's not due to its poor performance that it's eating most of your CPU. Ideally it should eat 99? of it That's because I'm creating a game on top of that and games are the kinds of applications that don't interoperate with other apps, they should eat all of the CPU power to get the highest framerate possible.
It's doable however to get its CPU usage down to about 1?, at the cost of FPS - by doing lazy redraws, etc. That would make sense if the GUI was meant as a general purpose library for ordinary applications. It's not...
It's possible to make it more application friendly by inserting a call to e.g. Sleep(1) in the main loop. This will also make the app eat about 85? (or more) of the CPU, but it will go down as processing power is needed by other applications. You can check it out yourself. An app with no Sleep's in its code that eats 99? of the CPU makes other apps lag behind it. When you insert Sleep(1) or Sleep(0), it will also eat about 90? or more, but this can go down to 0? when other processes need some CPU cycles...
As for the raw performance in FPS - yes, I'm planning to improve it Out of curiosity, what framerates are you getting in the various demos and what hardware are you running them on ? /* I'm mainly concerned about the graphics card */
Quote: | By the way will you release the code source for your samples (test4, test5 ...) ? |
Nope... but not because I don't want to share it. There are archives containing my current sources. You can probably find the sources for demos 3-5 there. However, these may not compile with the current version of DMD. Anyways, I'm planning to merge demos 3 through 5 into a single one and you'll be able to grab its source.
The current source in the backup is a modified version of tech demo #5. It should compile with dmd.125. Older archives may contain sources for demo #4 and #3, but I don't guarantee anything
Quote: | Another question, did you have a look at the yaneurao library and samples (here : http://www.sun-inet.or.jp/~yaneurao/dlang/english.html). It is also very impressive (see the glexceed demo porting to d, and the samples), badfully all doc and comments are in japanese ! (that's very typical of japanse programmers, they do wonderful stuff but nobody can use it outside japan because they do not talk english, although every programmer in the rest of the world talks english ) |
Yup, I've seen it and played some Japanese games in D. They are quite cool
Quote: | Hope you will keep up the good work, cause D certainly needs good libraires (especially a good gui !) in order to be more used and known. |
Thanks, but keep in mind that this GUI is meant to be used in 3d OpenGL applications (yet this does not prevent it from being used for other stuff). |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
|
Back to top |
|
|
|