Help me to correct the result in Irrlich 0.12 in VC++7.1

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
darkpower
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 10, 2005 09:57
Contact:

Help me to correct the result in Irrlich 0.12 in VC++7.1

Postby darkpower » Thu Oct 13, 2005 09:59

I trying to use CEGUI 0.4 in Irrlicht 0.12.
I had compiled all sample with Irrlicht 0.12 and they display correctly.
uncomment the line ine file CEGUIConfig.h.

Code: Select all

#define CEGUI_SAMPLES_USE_IRRLICHT


below is an example of FirstWindow.
select renderer type is ok.
Image
the result is ok.(I think)
Image



For now I try to recode the FirstWindow in simplest for fit with my program frame work.
The files's directory struct is similar with FirstWindow.
Here is the result of my program.
Image
and here is the irrlicht console
Image


What is my fault in the program ?
It is not correct in Text of the window.
I can't see the cursor like the FirstWindow.
below is my code , the project is only single file.
main.cpp

Code: Select all

#include <irrlicht.h>
#include <cegui.h>
#include <renderers/irrlichtrenderer/irrlichtrenderer.h>


int
main(
   int      arg_c ,
   char**      arg_v )
{
   using namespace      irr;
   
   IrrlichtDevice      *irr_device      = 0;

   
   using namespace      video;
   using namespace      core;
   
   irr_device = createDevice(
      EDT_DIRECTX9 ,
      core :: dimension2d< s32 >( 800 , 600 ) ,
      32 ,
      false ,
      true ,
      false ,
      0 );
   if( irr_device == 0) return -1;
   
   irr_device -> setWindowCaption( L"ทดลองใช้ CEGUI" );
   using namespace      scene;
   ISceneManager   *irr_s_mrg   = irr_device -> getSceneManager( );
   IVideoDriver   *irr_vd      = irr_device -> getVideoDriver( );

   ICameraSceneNode   *irr_camera = irr_s_mrg->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(0,0,1));
   irr_camera->setFOV(1.56f);
   irr_vd -> setAmbientLight(video::SColor(255,255,255,255));
   
   using namespace      CEGUI;
   IrrlichtRenderer   *irr_gui_render   = new IrrlichtRenderer( irr_device , true );
   
   System* cegui_system = new System( irr_gui_render );
   
   Imageset      *taharezImages   = ImagesetManager::getSingleton().createImageset("../datafiles/imagesets/TaharezLook.imageset");
   
   cegui_system -> setDefaultMouseCursor( &taharezImages -> getImage( "MouseArrow" ) );
   FontManager::getSingleton().createFont("../datafiles/fonts/Commonwealth-10.font");
   SchemeManager::getSingleton().loadScheme("../datafiles/schemes/TaharezLookWidgets.scheme");
   
   WindowManager* winMgr = &WindowManager::getSingleton( );
   
   DefaultWindow* root = (DefaultWindow*)winMgr -> createWindow("DefaultWindow", "Root");
   cegui_system -> setGUISheet( root );
   
   FrameWindow* wnd = (FrameWindow*)winMgr -> createWindow("TaharezLook/FrameWindow", "Demo Window");

   root -> addChildWindow( wnd );

   wnd->setPosition(Point(0.25f, 0.25f));
   wnd->setSize(Size(0.5f, 0.5f));

   wnd->setMaximumSize(Size(1.0f, 1.0f));
   wnd->setMinimumSize(Size(0.1f, 0.1f));

   wnd->setText( "Some Thing" );
   
   video :: SColor      BLACK_COLOR( 255 , 0 , 0 , 0 );
   while( irr_device -> run( ) )
   {
      irr_vd -> beginScene( true , true , BLACK_COLOR );
      
      irr_s_mrg -> drawAll( );

      cegui_system -> renderGUI( );
      
      irr_vd -> endScene( );
   }
   
   delete cegui_system;
   
   delete irr_gui_render;
   irr_gui_render = 0;
   
   
   irr_device -> drop( );

   return 0;
}



[size=xx-large]
[color=CC0000]
Some one please help me!
[/color]
Thank you.
[/size]


:P

User avatar
darkpower
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 10, 2005 09:57
Contact:

Re: Help me to correct the result in Irrlich 0.12 in VC++7.1

Postby darkpower » Fri Oct 14, 2005 07:07

Now i can fix the cursor problem
by add Irrlicht IEventReceiver subclass the the event.
Image

But The textrender is still problem. :cry:

User avatar
darkpower
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 10, 2005 09:57
Contact:

Re: Help me to correct the result in Irrlich 0.12 in VC++7.1

Postby darkpower » Fri Oct 14, 2005 07:25

Finally I got the keyword line.
on I add the line below the program is work!!!

Code: Select all

irr_vd -> setTextureCreationFlag( irr :: video :: ETCF_ALWAYS_32_BIT , true );


Here is he result
Image


Thank all in irc.freenode.net at cegui


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests