I've posted an article on The Code Project demonstrating OGRE running in the WPF (Windows Presentation Foundation).
Check it out if it sounds useful to you

http://www.codeproject.com/KB/WPF/OgreInTheWpf.aspx
Well not using Mogre would reduce you app's download size quite a bit. (Mogre is quite large)pjcast wrote: Though, I was thinking of not using Mogre, but just Ogre directly with rendering/scene/logic in C++ - only exporting a few C functions. Not sure if that would give a speed improvement (though, Mogre is pretty darn fast), but would at least cut out one additional dependency/layer for me (I've always had issues in the past while using Mogre and trying to stay updated with current Ogre release).
Code: Select all
protected void UpdateStats()
{
string currFps = "Current FPS: ";
string worstFps = "Total timer: ";
try
{
OverlayElement guiCurr = OverlayManager.Singleton.GetOverlayElement("Core/CurrFps");
OverlayElement guiWorst = OverlayManager.Singleton.GetOverlayElement("Core/WorstFps");
long statsUpdateTicks;
HiPerfTimer.QueryPerformanceCounter(out statsUpdateTicks);
if (lastStatsUpdate != 0)
{
double statsTimeLapse = (double)(statsUpdateTicks - lastStatsUpdate) / (double)perfFreq;
guiCurr.Caption = currFps + (framecount / statsTimeLapse).ToString();
guiWorst.Caption = worstFps + framecount + " " + statsTimeLapse.ToString();
}
lastStatsUpdate = statsUpdateTicks;
}
catch {}
framecount = 0;
}
Code: Select all
// Create our Direct3D object
Direct3DCreate9Ex(D3D_SDK_VERSION, (IDirect3D9Ex**) &mpD3D); // Umm.. this cast may not be valid
if( NULL == mpD3D)
{
if( NULL == (mpD3D = Direct3DCreate9(D3D_SDK_VERSION)) ) // Fallback for non-Vista
{
OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Failed to create Direct3D9 object", "D3D9RenderSystem::D3D9RenderSystem" );
}
}
Ok! So I almost gave up on figuring out the deal on lockable textures but then hit the google jackpot. I found out the following things:Mawen wrote: ....Next step: figuring out how to accomplish the same thing in WinXP, since Direct3D 9Ex is Vista-only. (Apparently, you have to use a locking texture in XP. It isn't clear to me from the MSDN docs whether locking textures works on just XP, or both XP and Vista, so we will have to see!)
jmix90 wrote:I don't understand why we do not use directly the D3DImage ?![]()