FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TechDemo #5 - GUI
Goto page 1, 2  Next
 
Post new topic   Reply to topic     Forum Index -> FragBots
View previous topic :: View next topic  
Author Message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Wed May 04, 2005 6:10 pm    Post subject: TechDemo #5 - GUI Reply with quote

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 Wink Any ideas/info ?


Last edited by h3r3tic on Tue Dec 13, 2005 7:02 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Thu May 05, 2005 9:43 am    Post subject: Reply with quote

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 Smile ( 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 Very Happy


Last edited by h3r3tic on Tue Dec 13, 2005 7:02 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu May 05, 2005 4:25 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Thu May 05, 2005 4:54 pm    Post subject: Reply with quote

I've done an OpenGL based GUI with some ideas taken from GTK.
Here's a shot from TechDemo # 5 (without fancy cursors): http://158.75.59.9/~h3/viewImg.spy?img=code/heresy/images/guiBeginnings3.PNG


Last edited by h3r3tic on Tue Dec 13, 2005 7:02 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu May 05, 2005 6:04 pm    Post subject: Reply with quote

that's pretty neat : ) how long did it take you to code up?
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Thu May 05, 2005 6:10 pm    Post subject: Reply with quote

Thanks Smile 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 Very Happy
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu May 05, 2005 7:35 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Thu May 05, 2005 7:43 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Thu May 05, 2005 10:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Fri May 06, 2005 11:44 am    Post subject: Reply with quote

Thanks for the feedback Very Happy 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 Wink (and of course heavily uses Derelict -> thanks goto Aldacron)

/* For me it looks clean and it IS fast Smile 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
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sun May 15, 2005 2:50 pm    Post subject: Re: TechDemo #5 - GUI Reply with quote

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
View user's profile Send private message MSN Messenger
deed_y



Joined: 29 May 2005
Posts: 2

PostPosted: Sun May 29, 2005 6:56 pm    Post subject: Reply with quote

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 Very Happy
It uses 85? of my cpu power on my athlon xp with 1,6Ghz ! (exactly like your test4 demo by the way Wink)
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 Very Happy)

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
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sun May 29, 2005 9:28 pm    Post subject: Reply with quote

working link http://www.sun-inet.or.jp/~yaneurao/dlang/english.html

deed_y: I'm not sure if you realize his GUI is rendered using OpenGL.

Oh, almost forget... Welcome to the forums deed_y! Smile
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Mon May 30, 2005 1:41 am    Post subject: Reply with quote

Disclaimer: I'm just having classes at my uni so if this post contains bugs, forgive me Laughing

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 Very Happy
It uses 85? of my cpu power on my athlon xp with 1,6Ghz ! (exactly like your test4 demo by the way Wink)
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 Smile 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 Razz 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 Wink

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 Very Happy)


Yup, I've seen it and played some Japanese games in D. They are quite cool Very Happy

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
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Mon May 30, 2005 10:35 am    Post subject: Reply with quote

deed_y wrote:
By the way will you release the code source for your samples (test4, test5 ...) ?


TechDemo#3 is dated at 2005-03-04, I've got no exact sources for it, however there are sources to a version that's been modified a little (2005-03-10): http://158.75.59.9/~h3/code/heresy/backup/src-2005-03-10.rar

http://158.75.59.9/~h3/code/heresy/backup/src-2005-04-21.zip is dated the same as TechDemo#4

http://158.75.59.9/~h3/code/heresy/backup/src-2005-05-05_2.rar seems to contain the sources for TechDemo#5

I do not have sources to any earlier demos of Heresy::FragBots. These are irrevelant as TechDemo#3 is clearly a successor to demos #1 and #2 (thus there are no links to them on my site)

Note that I guarantee absolutely no support for these sources at the moment...


Last edited by h3r3tic on Tue Dec 13, 2005 7:03 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> FragBots All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group