It is currently Tue Jul 23, 2019 2:09 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: SetGUITheme3D()
PostPosted: Sun Oct 18, 2009 1:47 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2336
Location: Berlin, Germany
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: SetGUITheme3D()
PostPosted: Sun Oct 18, 2009 1:54 pm 
Online
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13595
Location: France
Well, nothing fancy:

Code:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: SetGUITheme3D()
PostPosted: Sun Oct 18, 2009 2:31 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2336
Location: Berlin, Germany
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:

Quote:
---------------------------
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:
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: SetGUITheme3D()
PostPosted: Sun Oct 18, 2009 2:35 pm 
Online
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13595
Location: France
Take a look to CEGui.log file, it should provide more errors. The theme is probably too old.


Top
 Profile  
Reply with quote  
 Post subject: Re: SetGUITheme3D()
PostPosted: Sun Oct 18, 2009 4:41 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2336
Location: Berlin, Germany
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: SetGUITheme3D()
PostPosted: Mon Jun 10, 2019 2:11 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4571
Location: Spa, relaxing and thinking, and learning...
10 years later the issue is not changed.
Any working example there?

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 18 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye