I m trying to create a windowless Ogre application, but it seems that the method RenderWindow::setVisible(false) is completely ignored by the application. Is there a way to accomplish that?
Thank you
Tommaso
I m trying to create a windowless Ogre application, but it seems that the method RenderWindow::setVisible(false) is completely ignored by the application. Is there a way to accomplish that?
Thank you
Tommaso
You should not be using RenderWindow
but RenderTexture
if you don t want to open a window. It works almost exactly the same as RenderWindow
because it is derived from RenderTarget
as well. You should have almost no trouble just switching them around with your current parameters except for changing the constructor.
Please update your question with some concrete code if you do run into trouble with the switch.
As far as I know you have to create a window even if you just want create a windowless app. It is not possible to initialize Ogre without creating a RenderWindow (window = m_root->initialise(true, "App")
)
With Ogre 1.8 you can hide the window by calling window->setHidden(true)
Thanks to this method you can bypass the problem and make a "windowless" app.
As Svenstaro said, you can redirect the rendering into a RenderTexture. I use the code below to render my frames into a texture :
m_window = m_root->initialise(true, "App");
m_window->setHidden(true);
Ogre::WindowEventUtilities::messagePump(); // Force the window to be hidden (necessary under Ubuntu for my case)
m_camera = m_sceneMgr->createCamera("Cam");
Ogre::TexturePtr rtt_texture = Ogre::TextureManager::getSingleton().createManual("RttTex",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, 640, 480, 0,
Ogre::PF_R8G8B8,
Ogre::TU_RENDERTARGET);
Ogre::RenderTexture* m_tex = rtt_texture->getBuffer()->getRenderTarget();
Ogre::Viewport* vp = m_tex->addViewport(m_camera);
vp->setClearEveryFrame(true);
vp->setBackgroundColour(Ogre::ColourValue::Black);
vp->setOverlaysEnabled(false);
m_camera->setAspectRatio(Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
In the RenderLoop :
while(1)
{
m_root->renderOneFrame();
m_tex->update();
// Other stuffs
}
I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...
Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...
I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...
How can I create an empty file at the DOS/Windows command-line? I tried: copy nul > file.txt But it always displays that a file was copied. Is there another method in the standard cmd? It should ...
I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...
My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...
Yes, I know, the archive bit is evil. That being said, is there support for querying it with find , and modifying it with chmod ? My googling has turned up nothing......
I built a Java application that is delivered on USB sticks. To ensure compatibility, I ship an appropriate JVM on the sticks. I made an EXE that simply invokes this JVM with the application jar. Now ...