Exception: WindowFactoryManager::getFactory

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Exception: WindowFactoryManager::getFactory

Postby Durin » Tue May 15, 2007 17:26

I am a CEGUI beginner and i tried the Tutorial "The Beginner Guide to Creating a CEGUI Window". Compiling is no problem, but after start the programm crashes.
My Code:

Code: Select all

_root = new Ogre::Root("", "");
_window = _root->createRenderWindow("CDK", 1024, 768, false, &opts);
_GUIRenderer = new CEGUI::OgreCEGUIRenderer(_window, Ogre::RENDER_QUEUE_OVERLAY, true, 3000, _sceneMgr);
new CEGUI::System(_GUIRenderer);
_EditorGuiSheet=CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow",(CEGUI::utf8*)"Sheet");  CEGUI::System::getSingleton().setGUISheet(_EditorGuiSheet);
CEGUI::FrameWindow*fWnd=(CEGUI::FrameWindow*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/FrameWindow","testWindow");
_EditorGuiSheet->addChildWindow(fWnd);
fWnd->setPosition( (CEGUI::UVector2(cegui_reldim(0.25f),cegui_reldim(0.25f)) ) );
fWnd->setSize(CEGUI::UVector2(cegui_reldim(0.5f), cegui_reldim(0.5f)));
fWnd->setText( "Hello World!" );


And the CEGUI Logfile:
15/05/2007 19:22:05 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
15/05/2007 19:22:05 (InfL1) + Crazy Eddie's GUI System - Event log +
15/05/2007 19:22:05 (InfL1) + (http://www.cegui.org.uk/) +
15/05/2007 19:22:05 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

15/05/2007 19:22:05 (InfL1) CEGUI::Logger singleton created.
15/05/2007 19:22:06 (InfL1) ---- Begining CEGUI System initialisation ----
15/05/2007 19:22:06 (InfL1) CEGUI::ImagesetManager singleton created
15/05/2007 19:22:06 (InfL1) CEGUI::FontManager singleton created.
15/05/2007 19:22:06 (InfL1) CEGUI::WindowFactoryManager singleton created
15/05/2007 19:22:06 (InfL1) CEGUI::WindowManager singleton created
15/05/2007 19:22:06 (InfL1) CEGUI::SchemeManager singleton created.
15/05/2007 19:22:06 (InfL1) CEGUI::MouseCursor singleton created.
15/05/2007 19:22:06 (InfL1) CEGUI::GlobalEventSet singleton created.
15/05/2007 19:22:06 (InfL1) CEGUI::WidgetLookManager singleton created.
15/05/2007 19:22:06 (InfL1) CEGUI::WindowRendererManager singleton created
15/05/2007 19:22:06 (InfL1) WindowFactory for 'DefaultWindow' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'DragContainer' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'ScrolledContainer' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'ClippedContainer' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Checkbox' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/PushButton' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/RadioButton' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Combobox' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ComboDropList' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Editbox' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/FrameWindow' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ItemEntry' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Listbox' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ListHeader' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ListHeaderSegment' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Menubar' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/PopupMenu' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/MenuItem' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/MultiColumnList' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/MultiLineEditbox' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ProgressBar' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ScrollablePane' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Scrollbar' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Slider' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Spinner' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/TabButton' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/TabControl' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Thumb' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Titlebar' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/Tooltip' windows added.
15/05/2007 19:22:06 (InfL1) WindowFactory for 'CEGUI/ItemListbox' windows added.
15/05/2007 19:22:06 (InfL1) Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
15/05/2007 19:22:06 (InfL1) CEGUI::System singleton created.
15/05/2007 19:22:06 (InfL1) ---- CEGUI System initialisation completed ----
15/05/2007 19:22:06 (InfL1) ---- Version 0.5.1 ----
15/05/2007 19:22:06 (InfL1) ---- Renderer module is: CEGUI::OgreRenderer - Official Ogre based renderer module for CEGUI ----
15/05/2007 19:22:06 (InfL1) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
15/05/2007 19:22:06 (InfL1) ---- Scripting module is: None ----
15/05/2007 19:22:06 (InfL1) Attempting to load Scheme from file 'TaharezLookSkin.scheme'.
15/05/2007 19:22:07 (InfL1) Attempting to create an Imageset from the information specified in file 'TaharezLook.imageset'.
15/05/2007 19:22:07 (InfL1) Started creation of Imageset from XML specification:
15/05/2007 19:22:07 (InfL1) ---- CEGUI Imageset name: TaharezLook
15/05/2007 19:22:07 (InfL1) ---- Source texture file: TaharezLook.tga in resource group: (Default)
15/05/2007 19:22:07 (InfL1) ===== Falagard 'root' element: look and feel parsing begins =====
15/05/2007 19:22:08 (InfL1) ===== Look and feel parsing completed =====
15/05/2007 19:22:09 (InfL1) No window factories specified for module 'CEGUIFalagardBase' - adding all available factories...
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Button' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Default' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Editbox' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/FrameWindow' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ItemEntry' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ListHeader' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ListHeaderSegment' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Listbox' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Menubar' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/MenuItem' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/MultiColumnList' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/MultiLineEditbox' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/PopupMenu' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ProgressBar' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ScrollablePane' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Scrollbar' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Slider' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Static' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/StaticImage' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/StaticText' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/SystemButton' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/TabButton' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/TabControl' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Titlebar' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ToggleButton' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/Tooltip' added.
15/05/2007 19:22:09 (InfL1) WindowRendererFactory 'Falagard/ItemListbox' added.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/AlternateProgressBar' using base type 'Falagard/ProgressBar', window renderer '' and Look'N'Feel 'TaharezLook/AltProgressBar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Button' using base type 'Falagard/Button', window renderer '' and Look'N'Feel 'TaharezLook/Button'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Checkbox' using base type 'Falagard/Checkbox', window renderer '' and Look'N'Feel 'TaharezLook/Checkbox'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ComboDropList' using base type 'Falagard/ComboDropList', window renderer '' and Look'N'Feel 'TaharezLook/ComboDropList'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ComboEditbox' using base type 'Falagard/Editbox', window renderer '' and Look'N'Feel 'TaharezLook/ComboEditbox'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Combobox' using base type 'Falagard/Combobox', window renderer '' and Look'N'Feel 'TaharezLook/Combobox'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Editbox' using base type 'Falagard/Editbox', window renderer '' and Look'N'Feel 'TaharezLook/Editbox'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/FrameWindow' using base type 'Falagard/FrameWindow', window renderer '' and Look'N'Feel 'TaharezLook/FrameWindow'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/HorizontalScrollbar' using base type 'Falagard/Scrollbar', window renderer '' and Look'N'Feel 'TaharezLook/HorizontalScrollbar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/HorizontalScrollbarThumb' using base type 'Falagard/Thumb', window renderer '' and Look'N'Feel 'TaharezLook/HorizontalScrollbarThumb'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ImageButton' using base type 'Falagard/Button', window renderer '' and Look'N'Feel 'TaharezLook/ImageButton'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/LargeVerticalScrollbar' using base type 'Falagard/Scrollbar', window renderer '' and Look'N'Feel 'TaharezLook/LargeVerticalScrollbar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/LargeVerticalScrollbarThumb' using base type 'Falagard/Thumb', window renderer '' and Look'N'Feel 'TaharezLook/LargeVerticalScrollbarThumb'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ListHeader' using base type 'Falagard/ListHeader', window renderer '' and Look'N'Feel 'TaharezLook/ListHeader'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ListHeaderSegment' using base type 'Falagard/ListHeaderSegment', window renderer '' and Look'N'Feel 'TaharezLook/ListHeaderSegment'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Listbox' using base type 'Falagard/Listbox', window renderer '' and Look'N'Feel 'TaharezLook/Listbox'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Menubar' using base type 'Falagard/Menubar', window renderer '' and Look'N'Feel 'TaharezLook/Menubar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/MenuItem' using base type 'Falagard/MenuItem', window renderer '' and Look'N'Feel 'TaharezLook/MenuItem'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/MultiColumnList' using base type 'Falagard/MultiColumnList', window renderer '' and Look'N'Feel 'TaharezLook/MultiColumnList'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/MultiLineEditbox' using base type 'Falagard/MultiLineEditbox', window renderer '' and Look'N'Feel 'TaharezLook/MultiLineEditbox'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/PopupMenu' using base type 'Falagard/PopupMenu', window renderer '' and Look'N'Feel 'TaharezLook/PopupMenu'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ProgressBar' using base type 'Falagard/ProgressBar', window renderer '' and Look'N'Feel 'TaharezLook/ProgressBar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/RadioButton' using base type 'Falagard/RadioButton', window renderer '' and Look'N'Feel 'TaharezLook/RadioButton'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/ScrollablePane' using base type 'Falagard/ScrollablePane', window renderer '' and Look'N'Feel 'TaharezLook/ScrollablePane'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Slider' using base type 'Falagard/Slider', window renderer '' and Look'N'Feel 'TaharezLook/Slider'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/SliderThumb' using base type 'Falagard/Thumb', window renderer '' and Look'N'Feel 'TaharezLook/SliderThumb'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Spinner' using base type 'Falagard/Spinner', window renderer '' and Look'N'Feel 'TaharezLook/Spinner'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/StaticImage' using base type 'Falagard/StaticImage', window renderer '' and Look'N'Feel 'TaharezLook/StaticImage'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/StaticText' using base type 'Falagard/StaticText', window renderer '' and Look'N'Feel 'TaharezLook/StaticText'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/SystemButton' using base type 'Falagard/SystemButton', window renderer '' and Look'N'Feel 'TaharezLook/ImageButton'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/TabButton' using base type 'Falagard/TabButton', window renderer '' and Look'N'Feel 'TaharezLook/TabButton'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/TabControl' using base type 'Falagard/TabControl', window renderer '' and Look'N'Feel 'TaharezLook/TabControl'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/TabPane' using base type 'Falagard/TabPane', window renderer '' and Look'N'Feel 'TaharezLook/TabPane'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Titlebar' using base type 'Falagard/Titlebar', window renderer '' and Look'N'Feel 'TaharezLook/Titlebar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/Tooltip' using base type 'Falagard/Tooltip', window renderer '' and Look'N'Feel 'TaharezLook/Tooltip'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/VerticalScrollbar' using base type 'Falagard/Scrollbar', window renderer '' and Look'N'Feel 'TaharezLook/VerticalScrollbar'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/VerticalScrollbarThumb' using base type 'Falagard/Thumb', window renderer '' and Look'N'Feel 'TaharezLook/VerticalScrollbarThumb'.
15/05/2007 19:22:09 (InfL1) Creating falagard mapping for type 'TaharezLook/VUMeter' using base type 'Falagard/ProgressBar', window renderer '' and Look'N'Feel 'TaharezLook/VUMeter'.
15/05/2007 19:22:09 (Error) Exception: WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'Falagard/FrameWindow' Window objects is not registered with the system.


Sorry the bad english and Thx for answers and help.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed May 16, 2007 00:37

After creating the "CEGUI::System" do a:

Code: Select all

CEGUI::SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");
CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
CEGUI::FontManager::getSingleton().createFont("Commonwealth-10.font");

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Postby Durin » Wed May 16, 2007 10:19

I have done the changes but is doesn´t work. CEGUI.log is just the same. Thanks for the answer. I hope the problem is not so hard...

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed May 16, 2007 11:58

This code is based on Ogre's Basic Tutorial #6 and works with your test FrameWindow. I'm using Ogre v1.4 and ogrenew\Dependencies\include\CEGUI\CEGUIVersion.h is 0.5.1.

BasicTutorial6.h

Code: Select all

//mem probs without this next one
#include <OgreNoMemoryMacros.h>
#include <CEGUI/CEGUIImageset.h>
#include <CEGUI/CEGUISystem.h>
#include <CEGUI/CEGUILogger.h>
#include <CEGUI/CEGUISchemeManager.h>
#include <CEGUI/CEGUIWindowManager.h>
#include <CEGUI/CEGUIWindow.h>
#include <CEGUI/elements/CEGUIPushButton.h>
#include "OgreCEGUIRenderer.h"
#include "OgreCEGUIResourceProvider.h"

#include <CEGUI/elements/CEGUIFrameWindow.h>

//regular mem handler
#include <OgreMemoryMacros.h>

#include "ExampleApplication.h"

CEGUI::MouseButton convertOgreButtonToCegui(int buttonID)
{
   using namespace OIS;

   switch (buttonID)
   {
   case OIS::MB_Left:
       return CEGUI::LeftButton;
   case OIS::MB_Right:
       return CEGUI::RightButton;
   case OIS::MB_Middle:
       return CEGUI::MiddleButton;
// Not sure what to do with this one...
//   case MouseEvent::BUTTON3_MASK:
//       return CEGUI::X1Button;
   default:
       return CEGUI::LeftButton;
   }
}


class GuiFrameListener : public ExampleFrameListener, public OIS::MouseListener, public OIS::KeyListener
{
private:
  CEGUI::Renderer* mGUIRenderer;
  bool mShutdownRequested;

public:
  // NB using buffered input
  GuiFrameListener(RenderWindow* win, Camera* cam, CEGUI::Renderer* renderer)
      : ExampleFrameListener(win, cam, true, true),
        mGUIRenderer(renderer),
        mShutdownRequested(false)
  {
       mMouse->setEventCallback( this );
       mKeyboard->setEventCallback( this );
  }

  // Tell the frame listener to exit at the end of the next frame
  void requestShutdown(void)
  {
      mShutdownRequested = true;
  }

  bool frameEnded(const FrameEvent& evt)
  {
      if (mShutdownRequested)
          return false;
      else
          return ExampleFrameListener::frameEnded(evt);
  }

  bool mouseMoved( const OIS::MouseEvent &e )
  {
      using namespace OIS;

      CEGUI::System::getSingleton().injectMouseMove(
              e.state.X.rel,e.state.Y.rel);

      return true;
  }

  bool mousePressed (const OIS::MouseEvent &e, OIS::MouseButtonID id)
  {
      CEGUI::System::getSingleton().injectMouseButtonDown(
        convertOgreButtonToCegui(id));

      return true;
  }

  bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id )
  {
      CEGUI::System::getSingleton().injectMouseButtonUp(
        convertOgreButtonToCegui(id));

      return true;
  }

  bool keyPressed( const OIS::KeyEvent &e )
  {
      if(e.key == OIS::KC_ESCAPE)
      {
          mShutdownRequested = true;
          return true;
      }

      CEGUI::System::getSingleton().injectKeyDown(e.key);
      CEGUI::System::getSingleton().injectChar(e.text);

      return true;
  }

  bool keyReleased( const OIS::KeyEvent &e )
  {
      CEGUI::System::getSingleton().injectKeyUp(e.key);

      return true;
  }
};

class Application : public ExampleApplication
{
private:
   CEGUI::OgreCEGUIRenderer* mGUIRenderer;
   CEGUI::System* mGUISystem;
   CEGUI::Window* mEditorGuiSheet;
public:
   Application()
      : mGUIRenderer(0),
      mGUISystem(0),
      mEditorGuiSheet(0)
   {
   }

   ~Application()
   {
      if(mEditorGuiSheet)
      {
         CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
      }
      if(mGUISystem)
      {
         delete mGUISystem;
         mGUISystem = 0;
      }
      if(mGUIRenderer)
      {
         delete mGUIRenderer;
         mGUIRenderer = 0;
      }
   }
protected:
   void createScene(void)
   {
      // Set ambient light
      mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
      // Set up GUI system
      mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
      mGUISystem = new CEGUI::System(mGUIRenderer);
      CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
      CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
      mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
      CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseMoveCursor");
      mGUISystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
      mEditorGuiSheet= CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow", (CEGUI::utf8*)"Sheet"); 
      mGUISystem->setGUISheet(mEditorGuiSheet);

/*
      CEGUI::PushButton* quitButton = (CEGUI::PushButton*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Button", (CEGUI::utf8*)"Quit");
      mEditorGuiSheet->addChildWindow(quitButton);
      quitButton->setPosition(CEGUI::UVector2(cegui_reldim(0.35f), cegui_reldim( 0.45f)) );
      quitButton->setSize(CEGUI::UVector2(cegui_reldim(0.35f), cegui_reldim( 0.1f)) );
      quitButton->setText("Quit");
*/
      mEditorGuiSheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"Tutorial Gui.xml");
      mGUISystem->setGUISheet(mEditorGuiSheet);
      CEGUI::PushButton* quitButton = (CEGUI::PushButton*)CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Quit");

      setupEventHandlers();

CEGUI::FrameWindow*fWnd=(CEGUI::FrameWindow*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/FrameWindow","testWindow");
mEditorGuiSheet->addChildWindow((CEGUI::Window*)fWnd);
fWnd->setPosition( (CEGUI::UVector2(cegui_reldim(0.25f),cegui_reldim(0.25f)) ) );
fWnd->setSize(CEGUI::UVector2(cegui_reldim(0.5f), cegui_reldim(0.5f)));
fWnd->setText( "Hello World!" );
   }
   void createFrameListener(void)
   {
      mFrameListener = new GuiFrameListener(mWindow, mCamera, mGUIRenderer);
      mRoot->addFrameListener(mFrameListener);
   }
   void setupEventHandlers(void)
   {
      CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
      wmgr.getWindow((CEGUI::utf8*)"Quit")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&Application::handleQuit, this));
   }
   bool handleQuit(const CEGUI::EventArgs& e)
   {
      static_cast<GuiFrameListener*>(mFrameListener)->requestShutdown();
      return true;
   }
};


main.cpp

Code: Select all

//#include "BasicTutorial1.h" // The SceneNode, Entity, and SceneManager constructs
//#include "BasicTutorial2.h" // Cameras, Lights, and Shadows
//#include "BasicTutorial3.h" // Terrain, Sky, Fog, and the Root object
//#include "BasicTutorial4.h" // Frame Listeners and Unbuffered Input
#include "BasicTutorial6.h" // CEGUI
//#include "ois.h" // CEGUI with OIS for input
//#include "IntermediateTutorial3.h" // Mouse Picking and SceneQuery Masks
//#include "IntermediateTutorial4.h" // Using multiple SceneManagers
//#include "IntermediateTutorial5.h" //
//#include "MovableText_demo.h"

//#include "DotSceneOctree.h"
//#include "Rotation.h"
//#include "MoveRobot.h" // and gridScreenshots
//#include "Terrain.h"
//#include "Sun.h"
//#include "input.h"
//#include "KenchoCamera.h"
//#include "DemoStates.h"
//#include "dotScene_demo.h"

#if !defined(WIN_MAIN)
   #if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
   #define WIN32_LEAN_AND_MEAN
   #include "windows.h"

   INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
   #else
   int main(int argc, char **argv)
   #endif
   {
      Application app;
      try
      {
         app.go();
      }
      catch( Exception& e )
      {
   #if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
         MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
   #else
         fprintf(stderr, "An exception has occured: %s\n",e.getFullDescription().c_str());
   #endif
      }
      
      return 0;
   }
#endif

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Postby Durin » Wed May 16, 2007 15:47

I don´t want to use ExampleApplication.h because i want to work with ogre myself without the mighty ExampleApplication.h. I made changes in my Code like the code before and I get following errors now:
16/05/2007 17:40:45 (Error) Exception: WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'Falagard/Button' Window objects is not registered with the system.
16/05/2007 17:40:45 (Error) Exception: GUILayout_xmlHandler::startElement - layout loading has been aborted since no WindowFactory is available for 'TaharezLook/Button' objects.
16/05/2007 17:40:45 (Error) WindowManager::loadWindowLayout - loading of layout from file 'Tutorial Gui.xml' failed.


Always I add something like a button or a window or any CEGUI-Elements, i get the message WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'Falagard/"Any CEGUI-Element"' Window objects is not registered with the system.

Is this a linking problem? Are there wrong settings in my VS8-Project-File?
Or missing cegui files?

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed May 16, 2007 16:44

That's why I posted that code above.

That code works, which would test your "other" settings. If the code above does not work then there's something wrong with the way the Ogre resources are laid out (resource.cfg), the version of Cegui, the included files, etc.

Please try to run that code above. The createScene() function is currently set to work with a layout file but you can use the Cegui "widget creation" code just above it.

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Postby Durin » Wed May 16, 2007 19:04

Can you please send me your .scheme files and everything goes along with this like .lookandfeel file and so on. I´m not quite sure if I have the right once and I´m not good enough to proof them. Perhaps the fault is in the files depending on the Look.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu May 17, 2007 13:34


User avatar
Ayudo
Just popping in
Just popping in
Posts: 12
Joined: Mon Feb 14, 2005 23:07
Location: germany, munich
Contact:

Postby Ayudo » Wed May 23, 2007 18:50

I had the same problem.

The problem is that the .scheme files changed from 0.4 to 0.5

0.4

Code: Select all

<FalagardMapping WindowType="RevoltLook/StaticText" TargetType="Falagard/StaticText" LookNFeel="RevoltLook/StaticText" />

0.5

Code: Select all

<FalagardMapping WindowType="RevoltLook/StaticText" TargetType="DefaultWindow" LookNFeel="RevoltLook/StaticText" Renderer="Falagard/StaticText" />


Just update your .scheme file and it will work.

My exakt error was:
(Error) Exception: WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'Falagard/StaticText' Window objects is not registered with the system.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed May 23, 2007 19:12

There's a Python script somewhere on the Wiki to perform that update.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests