Hi,
Right now i am studying the DXRS (from NoesisGUI) to create an OGRE renderer but in the mean time i can give the essential code hints how to render NoesisGUI with the DXRS.
1. Copy the Data & GUI folder in the same dir where you executeable is also all Noesis dll's (do not forget FreeImage.dll)
2. Start up the noesis system
// Launch Noesis Kernel
NsGetKernel()->Init();
// Start Up Noesis Systems
m_Device = NULL;
m_pWindow->getCustomAttribute("D3DDEVICE", &m_Device);
Noesis::Render::SetDX9Device(m_Device);
NsGetKernel()->InitSystems();
// Create surface for rendering vector graphics
IDirect3DSurface9* backBuffer;
m_Device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer);
Noesis::Core::Ptr<Noesis::Render::IRenderTarget2D> color = NsGetSystem<Noesis::Render::IDX9RenderSystem>()->WrapRenderTarget(backBuffer);
backBuffer->Release();
IDirect3DSurface9* depthBuffer;
m_Device->GetDepthStencilSurface(&depthBuffer);
Noesis::Core::Ptr<Noesis::Render::IRenderTarget2D> mask = NsGetSystem<Noesis::Render::IDX9RenderSystem>()->WrapRenderTarget(depthBuffer);
depthBuffer->Release();
Noesis::Core::Ptr<Noesis::Drawing::IVGLSurface> surface = NsGetSystem<Noesis::Drawing::IVGLSystem>()->CreateSurface(color, mask);
// Load UI resource
Noesis::Core::Ptr<Noesis::Gui::IUIResource> guiResource = NsGetSystem<Noesis::Resource::IResourceSystem>()->Load("Gui/Samples/SDKTutorial/UI.xaml");
m_UIRoot = guiResource->GetRoot();
// Create the UI renderer
m_UIRenderer = Noesis::Gui::CreateRenderer(m_UIRoot);
m_UIRenderer->SetSurface(surface);
m_UIRenderer->SetSurfaceClearMode(Noesis::Gui::SurfaceClearMode_Manual);
m_UIRenderer->SetAntialiasingMode(Noesis::Gui::AntialiasingMode_PPAA);
here the member def,
Noesis::Core::Ptr<Noesis::Gui::IRenderer> m_UIRenderer;
Noesis::Core::Ptr<Noesis::Gui::UIElement> m_UIRoot;
IDirect3DStateBlock9* m_StateBlock;
IDirect3DDevice9* m_Device;
3. Call Noesis update loop inside a renderqueue listener (m_pSceneManager->addRenderQueueListener(this))
Inside the renderQueueStarted do this
void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation)
{
// We're going to render ourselves in the Overlay Queue
if(queueGroupId == Ogre::RENDER_QUEUE_OVERLAY)
{
if(!m_StateBlock)
m_Device->CreateStateBlock(D3DSBT_ALL, &m_StateBlock);
// Tick kernel
NsGetKernel()->Tick();
// Update UI
m_UIRenderer->Update(1.0f/60.0f);
// Draw surface
m_StateBlock->Capture();
m_Device->Clear( 0, NULL, D3DCLEAR_STENCIL, 0, 1.0f, 1 );
NsGetSystem<Noesis::Render::IDX9RenderSystem>()->SyncInternalState();
const Noesis::Core::Ptr<Noesis::Drawing::VGLCommands>& commands = m_UIRenderer->WaitForUpdate();
m_UIRenderer->Render(commands);
m_UIRenderer->WaitForRender();
m_StateBlock->Apply();
}
}
Keep in mind this was just test code but it should help you to get started
cheers