Multi-window in Mogre

Valerii

07-11-2013 16:50:15

Good day, everybody!

I'm working on project based on Mogre. I have got a problem in creating one more render window. I'm using library and main idea from bitbucket.org/JaredThirsk/mogreinwpf/wiki/Home and codeproject.com/Articles/29190/Blend-the-OGRE-Graphics-Engine-into-your-WPF-proje. When I want to create a new window, I write this in an implementation of user control(for example, button)
private void NewWindowButton_Click(object sender, RoutedEventArgs e)
{
new MainWindow().Show();
}

Is it right way? Or must I do some extra things, to create render window?

For example, screenshots of the program crush:
[attachment=1]snimok.JPG[/attachment]
And the exception:
[attachment=0]snimok2.JPG[/attachment]

Error translate:
AccessViolationException occured.
Attempt to read or write Protected Memory This is often an indicating that other memory is corrupt.


Log file seems to write nothing about exception
17:06:05: Creating resource group General
17:06:05: Creating resource group Internal
17:06:05: Creating resource group Autodetect
17:06:05: SceneManagerFactory for type 'DefaultSceneManager' registered.
17:06:05: Registering ResourceManager for type Material
17:06:05: Registering ResourceManager for type Mesh
17:06:05: Registering ResourceManager for type Skeleton
17:06:05: MovableObjectFactory for type 'ParticleSystem' registered.
17:06:05: OverlayElementFactory for type Panel registered.
17:06:05: OverlayElementFactory for type BorderPanel registered.
17:06:05: OverlayElementFactory for type TextArea registered.
17:06:05: Registering ResourceManager for type Font
17:06:05: ArchiveFactory for archive type FileSystem registered.
17:06:05: ArchiveFactory for archive type Zip registered.
17:06:05: FreeImage version: 3.10.0
17:06:05: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
17:06:05: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
17:06:05: DDS codec registering
17:06:05: Registering ResourceManager for type HighLevelGpuProgram
17:06:05: Registering ResourceManager for type Compositor
17:06:05: MovableObjectFactory for type 'Entity' registered.
17:06:05: MovableObjectFactory for type 'Light' registered.
17:06:05: MovableObjectFactory for type 'BillboardSet' registered.
17:06:05: MovableObjectFactory for type 'ManualObject' registered.
17:06:05: MovableObjectFactory for type 'BillboardChain' registered.
17:06:05: MovableObjectFactory for type 'RibbonTrail' registered.
17:06:05: Loading library .\RenderSystem_Direct3D9
17:06:05: Installing plugin: D3D9 RenderSystem
17:06:05: D3D9 : Direct3D9 Rendering Subsystem created.
17:06:05: D3D9: Driver Detection Starts
17:06:05: D3D9: Driver Detection Ends
17:06:05: Plugin successfully installed
17:06:05: Loading library .\Plugin_ParticleFX
17:06:05: Installing plugin: ParticleFX
17:06:05: Particle Emitter Type 'Point' registered
17:06:05: Particle Emitter Type 'Box' registered
17:06:05: Particle Emitter Type 'Ellipsoid' registered
17:06:05: Particle Emitter Type 'Cylinder' registered
17:06:05: Particle Emitter Type 'Ring' registered
17:06:05: Particle Emitter Type 'HollowEllipsoid' registered
17:06:05: Particle Affector Type 'LinearForce' registered
17:06:05: Particle Affector Type 'ColourFader' registered
17:06:05: Particle Affector Type 'ColourFader2' registered
17:06:05: Particle Affector Type 'ColourImage' registered
17:06:05: Particle Affector Type 'ColourInterpolator' registered
17:06:05: Particle Affector Type 'Scaler' registered
17:06:05: Particle Affector Type 'Rotator' registered
17:06:05: Particle Affector Type 'DirectionRandomiser' registered
17:06:05: Particle Affector Type 'DeflectorPlane' registered
17:06:05: Plugin successfully installed
17:06:05: Loading library .\Plugin_OctreeSceneManager
17:06:05: Installing plugin: Octree & Terrain Scene Manager
17:06:05: Plugin successfully installed
17:06:05: Loading library .\Plugin_CgProgramManager
17:06:05: Installing plugin: Cg Program Manager
17:06:05: Plugin successfully installed
17:06:05: *-*-* OGRE Initialising
17:06:05: *-*-* Version 1.4.8 (Eihort)
17:06:05: Creating resource group Bootstrap
17:06:05: Added resource location '../Media/packs/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
17:06:05: Added resource location '../Media' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/fonts' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/materials/programs' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/materials/scripts' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/materials/textures' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/models' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/overlays' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/particle' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/gui' of type 'FileSystem' to resource group 'General'
17:06:05: Added resource location '../Media/DeferredShadingMedia' of type 'FileSystem' to resource group 'General'
17:06:05: D3D9 : RenderSystem Option: Full Screen = No
17:06:05: D3D9 : RenderSystem Option: Video Mode = 640 x 480 @ 32-bit colour
17:06:05: CPU Identifier & Features
17:06:05: -------------------------
17:06:05: * CPU ID: GenuineIntel: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
17:06:05: * SSE: yes
17:06:05: * SSE2: yes
17:06:05: * SSE3: yes
17:06:05: * MMX: yes
17:06:05: * MMXEXT: yes
17:06:05: * 3DNOW: no
17:06:05: * 3DNOWEXT: no
17:06:05: * CMOV: yes
17:06:05: * TSC: yes
17:06:05: * FPU: yes
17:06:05: * PRO: yes
17:06:05: * HT: no
17:06:05: -------------------------
17:06:05: D3D9 : Subsystem Initialising
17:06:05: ***************************************
17:06:05: *** D3D9 : Subsystem Initialised OK ***
17:06:05: ***************************************
17:06:05: D3D9RenderSystem::createRenderWindow "OgreImageSource Windows 1", 0x0 windowed miscParams: externalWindowHandle=1640582
17:06:05: D3D9 : Created D3D9 Rendering Window 'OgreImageSource Windows 1' : 584x447, 32bpp
17:06:05: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
17:06:05: Registering ResourceManager for type Texture
17:06:05: Registering ResourceManager for type GpuProgram
17:06:05: Multiple render targets with independent bit depths supported
17:06:05: D3D9: Vertex texture format supported - PF_A8R8G8B8
17:06:05: D3D9: Vertex texture format supported - PF_B8G8R8A8
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
17:06:05: D3D9: Vertex texture format supported - PF_R8G8B8A8
17:06:05: D3D9: Vertex texture format supported - PF_DEPTH
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT16_R
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT32_R
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT16_GR
17:06:05: D3D9: Vertex texture format supported - PF_FLOAT32_GR
17:06:05: RenderSystem capabilities
17:06:05: -------------------------
17:06:05: * Hardware generation of mipmaps: yes
17:06:05: * Texture blending: yes
17:06:05: * Anisotropic texture filtering: yes
17:06:05: * Dot product texture operation: yes
17:06:05: * Cube mapping: yes
17:06:05: * Hardware stencil buffer: yes
17:06:05: - Stencil depth: 8
17:06:05: - Two sided stencil support: yes
17:06:05: - Wrap stencil values: yes
17:06:05: * Hardware vertex / index buffers: yes
17:06:05: * Vertex programs: yes
17:06:05: - Max vertex program version: vs_3_0
17:06:05: * Fragment programs: yes
17:06:05: - Max fragment program version: ps_3_0
17:06:05: * Texture Compression: yes
17:06:05: - DXT: yes
17:06:05: - VTC: no
17:06:05: * Scissor Rectangle: yes
17:06:05: * Hardware Occlusion Query: yes
17:06:05: * User clip planes: yes
17:06:05: * VET_UBYTE4 vertex element type: yes
17:06:05: * Infinite far plane projection: yes
17:06:05: * Hardware render-to-texture: yes
17:06:05: * Floating point textures: yes
17:06:05: * Non-power-of-two textures: yes
17:06:05: * Volume textures: yes
17:06:05: * Multiple Render Targets: 4
17:06:05: * Point Sprites: yes
17:06:05: * Extended point parameters: yes
17:06:05: * Max Point Size: 8192
17:06:05: * Vertex texture fetch: yes
17:06:05: - Max vertex textures: 4
17:06:05: - Vertex textures shared: no
17:06:05: ResourceBackgroundQueue - threading disabled
17:06:05: Particle Renderer Type 'billboard' registered
17:06:05: SceneManagerFactory for type 'OctreeSceneManager' registered.
17:06:05: SceneManagerFactory for type 'TerrainSceneManager' registered.
17:06:05: Parsing scripts for resource group Autodetect
17:06:05: Finished parsing scripts for resource group Autodetect
17:06:05: Parsing scripts for resource group Bootstrap
17:06:05: Parsing script OgreCore.material
17:06:05: Parsing script OgreProfiler.material
17:06:05: Parsing script Ogre.fontdef
17:06:05: Parsing script OgreDebugPanel.overlay
17:06:05: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
17:06:05: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
17:06:05: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
17:06:05: Font BlueHighwayusing texture size 512x512
17:06:05: Info: Freetype returned null for character 127 in font BlueHighway
17:06:05: Info: Freetype returned null for character 128 in font BlueHighway
17:06:05: Info: Freetype returned null for character 129 in font BlueHighway
17:06:05: Info: Freetype returned null for character 130 in font BlueHighway
17:06:05: Info: Freetype returned null for character 131 in font BlueHighway
17:06:05: Info: Freetype returned null for character 132 in font BlueHighway
17:06:05: Info: Freetype returned null for character 133 in font BlueHighway
17:06:05: Info: Freetype returned null for character 134 in font BlueHighway
17:06:05: Info: Freetype returned null for character 135 in font BlueHighway
17:06:05: Info: Freetype returned null for character 136 in font BlueHighway
17:06:05: Info: Freetype returned null for character 137 in font BlueHighway
17:06:05: Info: Freetype returned null for character 138 in font BlueHighway
17:06:05: Info: Freetype returned null for character 139 in font BlueHighway
17:06:05: Info: Freetype returned null for character 140 in font BlueHighway
17:06:05: Info: Freetype returned null for character 141 in font BlueHighway
17:06:05: Info: Freetype returned null for character 142 in font BlueHighway
17:06:05: Info: Freetype returned null for character 143 in font BlueHighway
17:06:05: Info: Freetype returned null for character 144 in font BlueHighway
17:06:05: Info: Freetype returned null for character 145 in font BlueHighway
17:06:05: Info: Freetype returned null for character 146 in font BlueHighway
17:06:05: Info: Freetype returned null for character 147 in font BlueHighway
17:06:05: Info: Freetype returned null for character 148 in font BlueHighway
17:06:05: Info: Freetype returned null for character 149 in font BlueHighway
17:06:05: Info: Freetype returned null for character 150 in font BlueHighway
17:06:05: Info: Freetype returned null for character 151 in font BlueHighway
17:06:05: Info: Freetype returned null for character 152 in font BlueHighway
17:06:05: Info: Freetype returned null for character 153 in font BlueHighway
17:06:05: Info: Freetype returned null for character 154 in font BlueHighway
17:06:05: Info: Freetype returned null for character 155 in font BlueHighway
17:06:05: Info: Freetype returned null for character 156 in font BlueHighway
17:06:05: Info: Freetype returned null for character 157 in font BlueHighway
17:06:05: Info: Freetype returned null for character 158 in font BlueHighway
17:06:05: Info: Freetype returned null for character 159 in font BlueHighway
17:06:05: Info: Freetype returned null for character 160 in font BlueHighway
17:06:05: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
17:06:05: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
17:06:05: Parsing script OgreLoadingPanel.overlay
17:06:05: Finished parsing scripts for resource group Bootstrap
17:06:05: Parsing scripts for resource group General
17:06:05: Parsing script Examples.program
17:06:05: Parsing script StdQuad_vp.program
17:06:05: Parsing script deferred.glsl.program
17:06:05: Parsing script deferred.hlsl.program
17:06:06: Parsing script deferred_post_debug.glsl.program
17:06:06: Parsing script deferred_post_debug.hlsl.program
17:06:06: Parsing script deferred_post_minilight.glsl.program
17:06:06: Parsing script deferred_post_minilight.hlsl.program
17:06:06: OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightSpecularColor does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 883)
17:06:06: Error at line 29 of deferred_post_minilight.hlsl.program: Invalid param_named_auto attribute - Parameter called lightSpecularColor does not exist.
17:06:06: Parsing script deferred_post_multipass.glsl.program
17:06:06: Parsing script deferred_post_multipass.hlsl.program
17:06:06: Parsing script deferred_post_onepass.glsl.program
17:06:06: Parsing script deferred_post_onepass.hlsl.program
17:06:06: Parsing script BlackAndWhite.material
17:06:06: Parsing script Bloom.material
17:06:06: Parsing script DepthShadowmap.material
17:06:06: Parsing script DOF.material
17:06:06: Parsing script Embossed.material
17:06:06: Parsing script Example-DynTex.material
17:06:06: Parsing script Example-Water.material
17:06:06: Parsing script Example.material
17:06:06: Parsing script Examples-Advanced.material
17:06:06: Parsing script facial.material
17:06:06: Parsing script Glass.material
17:06:06: Parsing script hdr.material
17:06:06: Parsing script HeatVision.material
17:06:06: Parsing script Hurt.material
17:06:06: Parsing script instancing.material
17:06:06: Parsing script Invert.material
17:06:06: Parsing script Laplace.material
17:06:06: Parsing script MotionBlur.material
17:06:06: Parsing script Ocean.material
17:06:06: Parsing script OffsetMapping.material
17:06:06: Parsing script Ogre.material
17:06:06: Parsing script OgreNewt_Example.material
17:06:06: Parsing script OldMovie.material
17:06:06: Parsing script OldTV.material
17:06:06: Parsing script Posterize.material
17:06:06: Parsing script RZR-002.material
17:06:06: Parsing script SharpenEdges.material
17:06:06: Parsing script smoke.material
17:06:06: Parsing script Tiling.material
17:06:06: Parsing script VarianceShadowmap.material
17:06:06: Parsing script deferred.material
17:06:06: Parsing script deferreddemo.material
17:06:06: Parsing script deferred_post_debug.material
17:06:06: Parsing script deferred_post_minilight.material
17:06:06: Parsing script deferred_post_multipass.material
17:06:06: Parsing script deferred_post_onepass.material
17:06:06: Parsing script Examples.compositor
17:06:06: Parsing script sample.fontdef
17:06:06: Parsing script emitted_emitter.particle
17:06:06: Parsing script Example-Water.particle
17:06:06: Parsing script Example.particle
17:06:06: Parsing script smoke.particle
17:06:06: Parsing script Compositor.overlay
17:06:06: Parsing script DP3.overlay
17:06:06: Parsing script Example-CubeMapping.overlay
17:06:06: Parsing script Example-DynTex.overlay
17:06:06: Parsing script Example-Water.overlay
17:06:06: Parsing script Shadows.overlay
17:06:06: Finished parsing scripts for resource group General
17:06:06: Parsing scripts for resource group Internal
17:06:06: Finished parsing scripts for resource group Internal
17:06:06: Mesh: Loading ogrehead.mesh.
17:06:06: Texture: WeirdEye.png: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
17:06:06: Texture: GreenSkin.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
17:06:06: Texture: spheremap.png: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
17:06:06: Texture: dirt01.jpg: Loading 1 faces(PF_R8G8B8,96x96x1) with 6 generated mipmaps from Image. Internal format is PF_X8R8G8B8,96x96x1.
17:06:06: Creating viewport on target 'rtt/236068416', rendering from camera 'DefaultCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
17:06:06: Render Target 'rtt/236068416' Average FPS: 0 Best FPS: 0 Worst FPS: 999
17:06:06: Creating viewport on target 'rtt/236069888', rendering from camera 'DefaultCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
17:06:06: Render Target 'rtt/236069888' Average FPS: 0 Best FPS: 0 Worst FPS: 999
17:06:06: Creating viewport on target 'rtt/236069568', rendering from camera 'DefaultCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
17:06:07: Creating resource group General
17:06:07: Creating resource group Internal
17:06:07: Creating resource group Autodetect
17:06:07: SceneManagerFactory for type 'DefaultSceneManager' registered.
17:06:07: Registering ResourceManager for type Material
17:06:07: Registering ResourceManager for type Mesh
17:06:07: Registering ResourceManager for type Skeleton
17:06:07: MovableObjectFactory for type 'ParticleSystem' registered.
17:06:07: OverlayElementFactory for type Panel registered.
17:06:07: OverlayElementFactory for type BorderPanel registered.
17:06:07: OverlayElementFactory for type TextArea registered.
17:06:07: Registering ResourceManager for type Font
17:06:07: ArchiveFactory for archive type FileSystem registered.
17:06:07: ArchiveFactory for archive type Zip registered.
17:06:07: FreeImage version: 3.10.0
17:06:07: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
17:06:07: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
17:06:07: Registering ResourceManager for type HighLevelGpuProgram
17:06:07: Registering ResourceManager for type Compositor
17:06:07: MovableObjectFactory for type 'Entity' registered.
17:06:07: MovableObjectFactory for type 'Light' registered.
17:06:07: MovableObjectFactory for type 'BillboardSet' registered.
17:06:07: MovableObjectFactory for type 'ManualObject' registered.
17:06:07: MovableObjectFactory for type 'BillboardChain' registered.
17:06:07: MovableObjectFactory for type 'RibbonTrail' registered.
17:06:07: Loading library .\RenderSystem_Direct3D9
17:06:07: Installing plugin: D3D9 RenderSystem
17:06:07: D3D9 : Direct3D9 Rendering Subsystem created.
17:06:07: D3D9: Driver Detection Starts
17:06:07: D3D9: Driver Detection Ends
17:06:07: Plugin successfully installed
17:06:07: Loading library .\Plugin_ParticleFX
17:06:07: Installing plugin: ParticleFX
17:06:07: Particle Emitter Type 'Point' registered
17:06:07: Particle Emitter Type 'Box' registered
17:06:07: Particle Emitter Type 'Ellipsoid' registered
17:06:07: Particle Emitter Type 'Cylinder' registered
17:06:07: Particle Emitter Type 'Ring' registered
17:06:07: Particle Emitter Type 'HollowEllipsoid' registered
17:06:07: Particle Affector Type 'LinearForce' registered
17:06:07: Particle Affector Type 'ColourFader' registered
17:06:07: Particle Affector Type 'ColourFader2' registered
17:06:07: Particle Affector Type 'ColourImage' registered
17:06:07: Particle Affector Type 'ColourInterpolator' registered
17:06:07: Particle Affector Type 'Scaler' registered
17:06:07: Particle Affector Type 'Rotator' registered
17:06:07: Particle Affector Type 'DirectionRandomiser' registered
17:06:07: Particle Affector Type 'DeflectorPlane' registered
17:06:07: Plugin successfully installed
17:06:07: Loading library .\Plugin_OctreeSceneManager
17:06:07: Installing plugin: Octree & Terrain Scene Manager
17:06:07: Plugin successfully installed
17:06:07: Loading library .\Plugin_CgProgramManager
17:06:07: Installing plugin: Cg Program Manager
17:06:07: Plugin successfully installed
17:06:07: *-*-* OGRE Initialising
17:06:07: *-*-* Version 1.4.8 (Eihort)


This is the main problem in the current time , and it stops the app development. So If somebody know, what's wrong, please, tell the solution

Thank in advance!

Beauty

11-11-2013 22:01:23

Hi Valerii,

Mogre and WPF were only tested by a few users. It's a little bit tricky as I read some time ago, but they had useful notes and 1 or 2 or 3 examples.
In the Ogre wiki user Meharin created a tiny wiki page about and I added related links. Look here:
http://www.ogre3d.org/tikiwiki/Mogre+and+WPF



AccessViolationException is the most common error when you work with Mogre, but doesn't tell you details.
If you have a problem by calling RenderOneFrame(), it also tells you nothing more.
It can have several reasons.
Such problems happens e.g. when an object was disposed by Ogre internals and the wrapper already points to it. Or when there is an invalide variable setting.
Ogre exceptions in the Ogre log file often tell the reason.
Your log file tells an error:

17:06:06: OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightSpecularColor does not exist. ...
17:06:06: Error at line 29 of deferred_post_minilight.hlsl.program: Invalid param_named_auto attribute - Parameter called lightSpecularColor does not exist.


Normally Ogre/Mogre crashes, when there is an Ogre exception.
Try to solve this problem. (e.g. comment out the functions or code, which create/use the related resources/variables/functions)
Maybe this is the reason for your crashes.

I used WPF before (not for 3D) and it's nice.
In the case that you only use it for multi-window - this should be also possible with common GUIs by Windows.Forms.
Additionally "Image in image" is possible when you use a second ViewPort.

Valerii

14-11-2013 13:39:13

Thank you very much for the reply!
I've look throught all the links above. They were very useful for me.

I've got one idea. I tried to make multi-window application using just C# (not WPF), for this aim I used the 6-th mogre tutoruial.
The main idea of creating such application: create one main window, in which we initialize root and some essential structures. There is a button on this form and when we push it we create a new thread, in which we create new window and initialize mogre window there. It seemed to work good(not perfect, because after creating 7-9 it can break down), and I decided to apply this approach within libriaries of Jared and Leslie (links to their works are in the first post).

So when I try to launch two window at once, there are two variants:
1) All windows don't respond
2) It works fine during short time, but then it can crash or freeze itself.

I try to find the error description and post it here.
If somebody has met such trouble, please, tell the solution.

Beauty

15-11-2013 17:38:29

Nice to hear that the links were useful.

I don't have much time now.
Just quickly related to the way of tutorial 6:
You create a GUI by Windows.Forms, which contains a Panel from the Visual Studio ToolBox.
In my application I called this Panel "renderPanel".
From this I save the handle as String to the Ogre parameter:

NameValuePairList ogreParams = new NameValuePairList();
ogreParams["externalWindowHandle"] = myForm.RenderPanel.Handle.ToString();


When I create the Ogre render window, I add the parameters:

RenderWindow renderWindow = myRroot.CreateRenderWindow("Main RenderWindow", 1024, 768, false, ogreParams);

Then the Ogre render output is directed to the panel of windows forms.

I suppose this way it's possible to create a second window, too.
Just try it.

Valerii

16-11-2013 15:56:07

Thank you for the idea. Yes, i've tried to do this in my application, but there are some problems with this approach.

I've solved multi-windowing in one process. I put one root in main window, then I create new windows in which images are rendered. To create these windows I send root throught parameters. It can render two or more window at once. But with every new window, it works slow. And sometimes it can break down with no message of a error.

So my aim now is to create application with MOgre and WPF in the context of prism (MVVM pattern). It is necessary to create multi-window in this application.

So I've got three main questions:
1)Is it real to create stable multi-window MVVM application with MOgre?

2) Which method is better and suitable for MVVM pattern: with one root and many render windows or every window has its own root?

3)What doesn't let to create many window within Jared and Leslie libraries? (link to the error discription bitbucket.org/JaredThirsk/mogreinwpf/issues?status=new&status=open)