BetaGUI : BetaGUI 2.5 update - Style system added.

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Epimetheus
Halfling
Posts: 82
Joined: Sat Sep 17, 2005 3:28 pm
Location: Sweden

Post by Epimetheus »

Now i just get alot of warnings instead, if this works fine for others, could it possible compiler related? :O

http://rafb.net/p/CICUPb43.html
Last edited by Epimetheus on Wed May 30, 2007 1:01 am, edited 1 time in total.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Epimetheus wrote:Now i just get alot of warnings instead, if this works fine for others, could it possible compiler related? :O
It may. Give us a sample and perhaps we can resolve them.
Epimetheus
Halfling
Posts: 82
Joined: Sat Sep 17, 2005 3:28 pm
Location: Sweden

Post by Epimetheus »

Just edited my last post but here is the error log:
http://rafb.net/p/CICUPb43.html
Epimetheus
Halfling
Posts: 82
Joined: Sat Sep 17, 2005 3:28 pm
Location: Sweden

Post by Epimetheus »

Maybe this log is a bit better, easier to read:
http://rafb.net/p/ox9bc186.html
Epimetheus
Halfling
Posts: 82
Joined: Sat Sep 17, 2005 3:28 pm
Location: Sweden

Post by Epimetheus »

Hmm... odd, I solved the problem by moving the "optional" cpp section of the code to a actual separate file...

Well thanks anyway for your help... no ill go being stupid on my own :P

Edit:
Got this problem instead:

Code: Select all

SpaceNavPhysics: OgreOverlayManager.cpp:54: static Ogre::OverlayManager& Ogre::OverlayManager::getSingleton(): Assertion `ms_Singleton' failed.
Aborted (core dumped)
on runtime
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Post by CABAListic »

Just a side node: I recently stumbled upon that error with uint myself. From somewhere within Ogre (I think), sys/types.h is included in Linux which defines uint. To fix it, it is sufficient to write at the top of the source files using uint: "using Ogre::uint;".
cdkeito
Orc
Posts: 468
Joined: Sat Jan 27, 2007 12:06 pm

Post by cdkeito »

Interesting GUI, with a "little" patchup it work here too.

But a question:

can you post a example to diplay a FPS label on the screen?
please.
Last edited by cdkeito on Mon Jun 11, 2007 1:13 pm, edited 1 time in total.
rluck
Kobold
Posts: 29
Joined: Fri Jun 08, 2007 7:20 am
x 1

Post by rluck »

Theres a whole lot of example code in this thread, but its really hard to decipher what works and what doesn't. Does anyone have a clear, and concise way of putting this into a project that doesn't use ExampleApplication.h?
User avatar
AntonTheManton
Greenskin
Posts: 100
Joined: Sun Jan 14, 2007 1:47 am

Doesn't Compile

Post by AntonTheManton »

Nice concept, but I had a compiler error for every line of of your code (99).

I'm using GNU GCC (G++). It looks like there are problems with namespaces and it doesn't like 'uint'.

Rats - I was really hoping I could get a GUI up and running in under an hour.
User avatar
AntonTheManton
Greenskin
Posts: 100
Joined: Sun Jan 14, 2007 1:47 am

Woops

Post by AntonTheManton »

Just read a previous forum post, that suggested putting:
using Ogre::uint;
at the top of the source and it compiled!

Wow.
rluck
Kobold
Posts: 29
Joined: Fri Jun 08, 2007 7:20 am
x 1

Post by rluck »

rluck wrote:Theres a whole lot of example code in this thread, but its really hard to decipher what works and what doesn't. Does anyone have a clear, and concise way of putting this into a project that doesn't use ExampleApplication.h?
I've got it working for the most part, but like a lot of people, I'm stuck at the call back. I used GlobalExplorers example, and I'm at a loss of where to go. I've been looking at betajaen's example code also, and looking at his call back, and I'm wondering if onButtonPress is what I should be using.

edit: Adding a logMessage to do_sth shows that when the button is pressed, it executes that code twice. Once for the press, and once for the release. Anyone got any ideas?

edit2: BetaGUI::FocusState reveals FS_SELECT and FS_SELECT_OFF. Perhaps an if or switch?
User avatar
AntonTheManton
Greenskin
Posts: 100
Joined: Sun Jan 14, 2007 1:47 am

Callback

Post by AntonTheManton »

I also got stuck on the callback - why wasn't it just implemented as a regular function call or variable you can check against. My code isn't designed with the callback/event handler model.

I spent about 2 hours trying to modfiy/implement the 'simple' code. Waste of time. That is by far by the worst code I have ever come across in any program ever. Ever. Which deserves a prize (I mark student assignments all the time).

I gave up and just made my own GUI system using OGRE Overlays - it took under 5 minutes, so I highly suggest just making your own if you are looking for something simple to read/write text in boxes. Have a look at the 'Example' code - you can more or less copy how the debug panel is drawn and turn it into a different display (really only takes 5 mins).
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Re: Callback

Post by betajaen »

AntonTheManton wrote:I spent about 2 hours trying to modfiy/implement the 'simple' code. Waste of time. That is by far by the worst code I have ever come across in any program ever. Ever. Which deserves a prize (I mark student assignments all the time).
Hey! I mean come on.

What version are you using anyway?
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2

Re: Callback

Post by ajs15822 »

betajaen wrote:
AntonTheManton wrote:I spent about 2 hours trying to modfiy/implement the 'simple' code. Waste of time. That is by far by the worst code I have ever come across in any program ever. Ever. Which deserves a prize (I mark student assignments all the time).
Hey! I mean come on.

What version are you using anyway?
At least look at the uncompressed version:
http://www.nxogre.org/screens/betagui.h
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16

Post by KungFooMasta »

Not to be offensive, but I wouldn't use that code posted on the wiki either. It should be updated to a good useable, friendly version. And a working demo wouldn't hurt either.. :)

Just adding helpful suggestions. The easier it is to use the library without problems, the more time you can spend on NxOgre. :)
User avatar
To1ne
Halfling
Posts: 68
Joined: Thu May 10, 2007 3:24 pm

Post by To1ne »

BetaGUI is great I think.
I'm using it in a project I made for school. It's so easy to add new features (in the uncompressed version). I actually don't get why you publish the compressed version?

It took me also a lot off hours work to get it working. And indeed the Wiki-page is not complete. Maybe I'll try to make a new tutorial after my exams... . (somewhere after 19 june). If betajaen has no objection, or makes before me.

I've (tried to) study the other GUI's (QuickGUI, CEGUI & OpenGUI), and this one looked the easiest one to use. I can be wrong, if so let me know. It's hard to choose one without study each one for a looong time?? (and I didn't have time for my project)
Actually it would be nice if someone can make a complete comparison of the different GUI's: all there features, advantages/disadantages, ... .

@AntonTheManton:
Maybe try betajaen's example code on page 3 this worked almost from the start...
User avatar
mullencm
Gnoblar
Posts: 23
Joined: Sun Oct 30, 2005 8:38 pm

Post by mullencm »

I thought is was very straight forwarded and elegant. I got ver 15 to work in 2min, even the compressed version.

My question is what is the status of the other versions, and should I move up to 20 or 25. They seam to be hidden and under promoted as compared to 15, although have more refinement and feachers.

I am I missing out?
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

2.5 is incomplete, it's missing most of the widgets. The most complete one is the Bullet version which is based on version 2 (I believe).

http://get.nxogre.org/betagui/BetaGUI-Bullet.h

It has nice special effects and other lovely things.
Epimetheus
Halfling
Posts: 82
Joined: Sat Sep 17, 2005 3:28 pm
Location: Sweden

Post by Epimetheus »

Is there anywhere to get a res pack that works with the latest betagui release?
User avatar
mullencm
Gnoblar
Posts: 23
Joined: Sun Oct 30, 2005 8:38 pm

Post by mullencm »

using 16 from the above post

Do I have to handle tuning on and off the active and over states for buttons like this.

From my overrided onButtonPress function

Code: Select all

void mBetaGUIListener::onButtonPress(BetaGUI::Button* inButton, unsigned char mouseDown)
{
	if( inButton == VizhenApp::getSingletonPtr()->Button1 )
	{
		if( mouseDown == 1 )	//mouseDown
		{
			inButton->activate(true);
			VizhenApp::getSingletonPtr()->MPH = 42;
		}
		else if( mouseDown == 0 )	//mouseUp
		{
			inButton->activate(false);
			inButton->over(true);
		}
	}
}
This seams to be working just fine, I ask because it seams like I might be over complicating things.
-chase
User avatar
To1ne
Halfling
Posts: 68
Joined: Thu May 10, 2007 3:24 pm

Post by To1ne »

I did it like this:

Code: Select all

void onButtonPress(BetaGUI::Button *ref) {      
   if (ref == mGUI_ExitButton)
      mShutdown = true;
} 
User avatar
dazKind
Gnoblar
Posts: 24
Joined: Thu May 04, 2006 10:43 am

Re: Callback

Post by dazKind »

AntonTheManton wrote:I also got stuck on the callback - why wasn't it just implemented as a regular function call or variable you can check against. My code isn't designed with the callback/event handler model.

I spent about 2 hours trying to modfiy/implement the 'simple' code. Waste of time. That is by far by the worst code I have ever come across in any program ever. Ever. Which deserves a prize (I mark student assignments all the time).

I gave up and just made my own GUI system using OGRE Overlays - it took under 5 minutes, so I highly suggest just making your own if you are looking for something simple to read/write text in boxes. Have a look at the 'Example' code - you can more or less copy how the debug panel is drawn and turn it into a different display (really only takes 5 mins).
Well, good for you. Though I doubt that you really knew what you were doing. It took me 5 minutes to implent the bulletversion of betagui into my game. No edges or drawbacks. This includes looking at the classes, a quick glance at the wiki and tweaking the ressource-files. It simply works like it is supposed to.

After using CEGUI, GuiChan and OpenGUI in past I was looking for something really lightweight to satisfy my GUI-needs. BetaGUI is exactly the thing I need right now.

Betajaen: Thanks for providing such nice and helpfull piece of code.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Re: Callback

Post by betajaen »

dazKind wrote:Betajaen: Thanks for providing such nice and helpfull piece of code.
Your welcome.


@Everyone else

:P
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2

Re: Callback

Post by ajs15822 »

betajaen wrote:
dazKind wrote:Betajaen: Thanks for providing such nice and helpfull piece of code.
Your welcome.


@Everyone else

:P
/me gives a standing ovation to betajaen

The hardest thing to do as a programmer is to write code that does more with less. :wink:
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Thank you!

I've been toying with converting BetaGUI 2.5 to use Cairo and bypass the whole image/material idea. I have some fantastic ideas including replacing the current callback system, improve the business logic, work in the 3D world and use overlays, special effects and some other amazing interface concepts. In as little of code as possible. Not quite as BetaGUI 3, as it's a group project but something as equal in standing.

The only let down is Cairo, all of the latest versions for me do not work with the BetaCairo code either nothing is drawn or it crashes. An older version works, but it uses eight dependencies, quite awful considering I managed to compile it down to one DLL. :?