Jump to content
  • Advertisement
Sign in to follow this  
lougv22

can not hide CEGUI window

This topic is 3911 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am working on a game in C++. It uses Ogre for its graphics engine and CEGUI for its graphical interface. So I have this function in class DigitalCameraWindow: bool DigitalCameraWindow::handleCaptureClick(const CEGUI::EventArgs& e) { // Hide the digital camera window. window->hide(); // A character array to hold the full path to the image file. char imageName[100]; // An object of type Image to store information about the new image being inserted. Image* newImage; // Obtain the name of the zone the player is currently in. std::string zoneName = ZoneManager::getSingleton().getZone(ZoneManager::getSingleton().getActive())->zonename; try { // Call function createImage of class ImageManager to construc the image name and instantiate // an object of type Image. newImage = Star::ImageManager::getSingletonPtr()->createImage("Picture", "jpg", zoneName, "", imageName); // This will add a line for the current image in text file "imagepaths.txt". Star::ImageManager::getSingletonPtr()->addImage(newImage); // Generate the actual image file and save it to the appropriate folder. GraphicsSystem::getSingleton().getCamera().writeScreenToFile(imageName); // Call method sendImageToServer of class ImageManager to send an image packet accross the network // to the Server portion of the game. Star::ImageManager::getSingletonPtr()->sendImageToServer(newImage); } // End try catch(Star::Exception) { Star::Logger::getSingletonPtr()->log(Star::Logger::LOG_NORMAL, "Exception occured while capturing the image."); } // End catch // After the picture is taken we will show the digital camera window again so the player can // take another picture if they choose to do so. //window->show(); return true; } // End handleCaptureClick Basically it simulates taking a picture with a camera by capturing the screen. The problem is that when it captures the screen it also captures the digital camera interface. In order to solve that problem I am trying to hide the CEGUI window that represents the digital camera. I am attempting to do that in the following line of code: window->hide(); However, the window is not being hidden until the end of the method. Does anybody know why this is happening?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!