I am trying to get OGRE to integrate with the .Net Framework so that I can use a GUI system that I am familiar with. I have it working except when I use the ST_EXTERIOR_CLOSE SceneManager. When using that SceneManager, the background is gray (the color of the form) instead of the color of the viewport which probably means that it is not only forgetting to draw the entities but it isn't rendering to the screen at all. I need to use the ST_EXTERIOR_CLOSE option otherwise I can't get the height of the terrain at a point. ST_EXTERIOR_FAR and ST_GENERIC both work but when trying to cast the normal SceneManager variable I got from using either of those options to a TerrainSceneManager, the TerrainSceneManager doesn't point to anything.
I was wondering if anyone could provide me with a solution to try to make it so that when using the ST_EXTERIOR_CLOSE option for the SceneManager, I could get OGRE to render to the window.
Thank you in advance for any help you can provide me with on the subject.
No Display When Using ST_EXTERIOR_CLOSE SceneManager
-
Magefire
- Gnoblar
- Posts: 11
- Joined: Sat Feb 19, 2005 10:52 pm
-
Magefire
- Gnoblar
- Posts: 11
- Joined: Sat Feb 19, 2005 10:52 pm
Update
I decided to change to using wxWidgets for the GUI and I upgraded to OGRE 1.0 and after making all the necessary changes to make the program compatible with 1.0, I was able to get the program to run when using ST_EXTERIOR_CLOSE as long as I didn't load the terrain file. I found, before updating, that the problem was occuring when I called the renderOneFrame() function of the Root object after the render window was set to active. It turned out that I was counting on another exception to occur in order to allow me to exit an infinite render loop I had set up and therefore exit the program with out displaying an error message. I was catching the exception caused by renderOneFrame and not doing anything about it.
After switching to wxWidgets and OGRE 1.0, I gained the functionality of the ST_EXTERIOR_CLOSE SceneManager option as long as I don't load any terrain configuration files. This is a problem since I chose this SceneManager specifically to allow me to load terrain and get its height. When the program crashes, my debugger tells me that there was an access violation and takes me to a file called 'xtree' (presumably .h since I am told it is located in the include folder, but on the tab in Microsoft Visual C++ 2003, there is no file type extension after 'xtree').
I am able to get errors written out to the ogre.log file if I put try-catch blocks around the renderOneFrame function. The code looks as follows:
With the try-catch block, the following error is written to the ogre.log file (hundreds of times since the function is called many times).
The textures and heightmap is located in a folder. I add the folder location by hand with ResourceGroupManager::getSingletonPtr()->addResourceLocation(resourceLocation).
I also initialize the resource groups. Since the resources are able to be loaded and displayed when I don't load the terrain, I am fairly sure that the path is being added correctly. The contents of my terrain configuration file are as follows:
I need help on getting the SceneManager to load and display the terrain correctly and without errors. Thank you in advance for any help you can provide me with on the problem.
After switching to wxWidgets and OGRE 1.0, I gained the functionality of the ST_EXTERIOR_CLOSE SceneManager option as long as I don't load any terrain configuration files. This is a problem since I chose this SceneManager specifically to allow me to load terrain and get its height. When the program crashes, my debugger tells me that there was an access violation and takes me to a file called 'xtree' (presumably .h since I am told it is located in the include folder, but on the tab in Microsoft Visual C++ 2003, there is no file type extension after 'xtree').
I am able to get errors written out to the ogre.log file if I put try-catch blocks around the renderOneFrame function. The code looks as follows:
Code: Select all
try
{
if (!oRoot->renderOneFrame())
MessageBox(NULL, "Render Error", "Error", MB_OK);
}
catch (...)
{
}
Code: Select all
-----------------------------------
Details:
-----------------------------------
Error #: -2005530516
Function: D3D9RenderSystem::_beginFrame
Description: Error beginning frame :Invalid call.
File: \Program Files\ogrenew\RenderSystems\Direct3D9\src\OgreD3D9RenderSystem.cpp
Line: 1965
Stack unwinding: D3D9RenderSystem::_beginFrame(..) <- <<beginning of stack>>
I also initialize the resource groups. Since the resources are able to be loaded and displayed when I don't load the terrain, I am fairly sure that the path is being added correctly. The contents of my terrain configuration file are as follows:
Code: Select all
WorldTexture=SnowGround.jpg
DetailTexture=SnowDetail.jpg
DetailTile=3
PageSource=Heightmap
Heightmap.image=HeightMap.png
PageSize=2049
TileSize=65
PageWorldX=1500
PageWorldZ=1500
#Scale.x=2.0
#Scale.y=0.6
#Scale.z=2.0