Rendering in DirectX9

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

Fra3ture
Just popping in
Just popping in
Posts: 9
Joined: Wed Oct 13, 2010 14:59

Rendering in DirectX9

Postby Fra3ture » Wed Oct 13, 2010 15:07

Hi there

I'm having a few problems getting CEGUI to render. This is what I have:

In my .h file I have the following code

Code: Select all

CEGUI::Direct3D9Renderer* d_renderer;


In my GUI method in the .cpp file I have this code:

Code: Select all

CEGUI::Direct3D9Renderer::bootstrapSystem(m_pD3DDevice9);
CEGUI::System::create(d_renderer);


When I compile the code I get the following error:
error C2664: 'CEGUI::System::create' : cannot convert parameter 1 from 'CEGUI::Direct3D9Renderer *' to 'CEGUI::Renderer &'


When I change the star next to Direct3D9Renderer to an ampersand I get this error:
error C2758: 'CGameApplication::d_renderer' : must be initialized in constructor base/member initializer list


But when I compile I get a whole heap of problems as I don't know what to set my d_renderer to in the constructor. My DirectX code works fine, when I run it I get a window popping up (which is all I want it to do right now).

Could someone please point out to me what it is I'm doing wrong here?

Magmatwister
Just popping in
Just popping in
Posts: 12
Joined: Thu Oct 07, 2010 20:15

Re: Rendering in DirectX9

Postby Magmatwister » Wed Oct 13, 2010 17:03

The bootstrap system creates the system for you. Also, as for the other error, you don't need to be storing it within a class. Instead just do:

CEGUI::Direct3D9Renderer& myRenderer = CEGUI::Direct3D9Renderer::bootstrapSystem( pDevice );

Within a method of your class.

Fra3ture
Just popping in
Just popping in
Posts: 9
Joined: Wed Oct 13, 2010 14:59

Re: Rendering in DirectX9

Postby Fra3ture » Wed Oct 13, 2010 18:52

So, in laymen terms: don't put the stuff in the header?


Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests