SetGUITheme3D()

Just starting out? Need help? Post your questions and find answers here.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

SetGUITheme3D()

Post by Fluid Byte »

How the heck does it work? Why is anything related to CEGUI so cryptic/weird/complicated?
That command is not even documented as well as InputEvent3D(). And all the 3D GUI examples are missing.
The CEGUI implementation in PB is really very lousy and seemed to be done in a hurry.

Well, is there any working example demonstrating how to change themes at runtime? :?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SetGUITheme3D()

Post by Fred »

Well, nothing fancy:

Code: Select all

IncludeFile "Screen3DRequester.pb"

If InitEngine3D()

  InitSprite()
  InitKeyboard()
  InitMouse()
 
  Add3DArchive("Data\"          , #PB_3DArchive_FileSystem)
  Add3DArchive("GUI\", #PB_3DArchive_FileSystem)
  Add3DArchive("GUI\schemes", #PB_3DArchive_FileSystem)
  Add3DArchive("GUI\imagesets", #PB_3DArchive_FileSystem)
  Add3DArchive("GUI\fonts", #PB_3DArchive_FileSystem)
  Add3DArchive("GUI\looknfeel", #PB_3DArchive_FileSystem)
  Add3DArchive("GUI\layouts", #PB_3DArchive_FileSystem)
 
  If Screen3DRequester()
    ;-Camera
    CreateCamera(0,0,0,100,100)
    SetGUITheme3D("WindowsLook", "")
    OpenWindow3D(0, 0, 0, 320, 150, "ButtonGadget3D")
    ButtonGadget3D(0, 10, 50, 300, 40, "Bouton standard")
    ButtonGadget3D(4, 10, 95, 300, 40, "Bouton à bascule", #PB_Button_Toggle)
    ShowGUI(255,1)
   
    Repeat
      Repeat :    Event = WindowEvent3D() :  Until Event = 0
       
      ExamineKeyboard()
   
      If ExamineMouse()
        InputEvent3D(MouseX(),MouseY(),MouseButton(#PB_MouseButton_Left),"")
      EndIf

      RenderWorld()
      Screen3DStats()     
      FlipBuffers()
    Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
  EndIf
   
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: SetGUITheme3D()

Post by Fluid Byte »

Nothing fancy? Sure. If you are being the author. Anything else is just trial and error.

Anyway, it doesn't work. I want switch to the "SleekSpace" theme available from the CEGUI homepage (http://www.cegui.org.uk/skins/). But what I get is some weird error from the C++ Runtime Libraries:
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Assertion failed!

Program: ...
File: y:\cegui\include\CEGUISingleton.h
Line: 73

Expression: !ms_Singleton

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
---------------------------
Abbrechen Wiederholen Ignorieren
---------------------------
Now isn't that just awesome ... :x

Here's the code I used:

Code: Select all

InitEngine3D() : InitSprite() : InitKeyboard() : InitMouse()

Fullscreen = 0

If Fullscreen
	OpenScreen(800,600,32,"CEGUI")
Else
	OpenWindow(0,0,0,800,600,"CEGUI",#PB_Window_SystemMenu | 1)
	OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0)
EndIf

Add3DArchive("SleekSpace\",#PB_3DArchive_FileSystem)

CreateCamera(0,0,0,100,100)

SetGUITheme3D("SleekSpace","")

OpenWindow3D(0,100,100,400,300,"CEGUI DEMO")
ButtonGadget3D(0,10,50,300,40,"Normal Button")
ButtonGadget3D(1,10,95,300,40,"Toggle Button",#PB_Button_Toggle)

ShowGUI(255,1)

Repeat
	Repeat
		Event = WindowEvent()
	
		Select Event
			Case #PB_Event_CloseWindow : End
		EndSelect
	Until Event = 0
	
 	Repeat
		Event3D = WindowEvent3D()
		
		Select Event3D
			Case #PB_Event3D_CloseWindow
			CloseWindow3D(EventWindow3D())		
		EndSelect
 	Until Event3D = 0
	
	ExamineKeyboard() : ExamineMouse()
	
	InputEvent3D(MouseX(),MouseY(),MouseButton(#PB_MouseButton_Left),"")
	
	RenderWorld()
	DisplaySprite(0,300,300)
	FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SetGUITheme3D()

Post by Fred »

Take a look to CEGui.log file, it should provide more errors. The theme is probably too old.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: SetGUITheme3D()

Post by Fluid Byte »

Since the CEGUI demo on purebasic.com (http://www.purebasic.com/Ogre1.6.zip) is the only working example available I had a closer look on that. It seems there is a master theme called "Taharez". In fact I deleted all the unnecessary stuff and it boiled down to this:
  • Commonv2c.ttf
  • Commonwealth-10.font
  • TaharezLook.imageset
  • TaharezLook.looknfeel
  • TaharezLook.scheme
  • TaharezLook.tga
These are the only files you need to have a fully functional skin for fullscreen games/apps in PureBasic. Just put them into a single folder and it via Add3DArchive(). Yes, I know there are files like .config and .layout which actually have a specific purpose but this is advanced stuff and not important now.

More info here: http://www.cegui.org.uk/wiki/index.php/ ... ion#Layout

Back to the skins ...

The reason the "SleekSpace" skin fails to load is that it relies on the "Taharez" skin in order to work. In fact I looks like all skins are based on "Taharez". I have downloaded them all from the webpage and tested with these results:

- AquaLook: fails
- Marti: fails
- Quadratic: works
- Revolt: fails
- SleekSpace: works (text is missing)

What I find a bit disappointing:

The skins on the CEGUI homepage are very outdated as some of them being 3 years old. Besides being outdated it's really frustrating that there are only 5 skins in total to download of which only 1 (!) is working with the current build. Overall it doesn't add to the credibility of CEGUI being the right choice for PureBasic.

[EDIT]
I jut checked the "Quadratic" theme with more than just a single button. It fails with all other controls. So now 5 of 5 skins don't work ...
[/EDIT]
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Psychophanta
Addict
Addict
Posts: 4975
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: SetGUITheme3D()

Post by Psychophanta »

10 years later the issue is not changed.
Any working example there?
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
Post Reply