Crystal Space
Welcome,
Guest
. Please
login
or
register
.
May 19, 2013, 01:43:27 pm
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
9223
Posts in
2230
Topics by
5381
Members
Latest Member:
Chett
Crystal Space
Crystal Space Development
General Crystal Space Discussion
Help with static image in cegui
« previous
next »
Pages:
[
1
]
Author
Topic: Help with static image in cegui (Read 6374 times)
raq77
Newbie
Posts: 41
Help with static image in cegui
«
on:
March 27, 2008, 05:01:34 pm »
Hello, I am writing code that will allow me to show a picture or another depending on the button pressed. When I press the first button image is displayed in a new window perfectly, but when I hit another button for the second time, I get the follow error:
Microsoft C++ exception: CEGUI::AlreadyExistsException @ 0x0012f734
I suppose the problem is that whenever I pulse a button creates a new ImagesetManager, but I don't know how to delete the manager ever, because I don't know how many times you can press a button.
This is the code:
CEGUI::Imageset* set;
CEGUI::DefaultWindow* win;
if (formaCarcasa == 1){
win = static_cast<CEGUI::DefaultWindow*>(CEGUI::WindowManager::getSingleton().getWindow("Window2/Image2"));
set = CEGUI::ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage2","/lib/escenario/fuegos2.jpg");
win->setProperty("Image","set:ImageForStaticImage2 image:full_image");
}
else if (formaCarcasa == 4){
win = static_cast<CEGUI::DefaultWindow*>(CEGUI::WindowManager::getSingleton().getWindow("Window2/Image2"));
set = CEGUI::ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage2","/lib/escenario/fuegos3.jpg");
win->setProperty("Image","set:ImageForStaticImage2 image:full_image");
}
Can somebody help me, please? Thanks in advance.
Logged
raq77
Newbie
Posts: 41
Re: Help with static image in cegui
«
Reply #1 on:
April 01, 2008, 05:21:08 pm »
Ok, this is the solution:
if (CEGUI::ImagesetManager::getSingletonPtr()->isImagesetPresent("ImageForStaticImage2") == true)
CEGUI::ImagesetManager::getSingletonPtr()->destroyImageset("ImageForStaticImage2");
win = static_cast<CEGUI::DefaultWindow*>(CEGUI::WindowManager::getSingleton().getWindow("Window2/Image2"));
if (type == 1){
set = CEGUI::ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage2","/lib/escenario/fuegos2.jpg");
}else if (type == 2){
set = CEGUI::ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage2","/lib/escenario/fuegos3.jpg");
}
Greetings.
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Crystal Space Development
-----------------------------
=> General Crystal Space Discussion
=> Support
-----------------------------
Crystal Space Project Development
-----------------------------
=> Feature Requests
=> Plugins
=> Bug Reports
-----------------------------
Crystal Space Development
-----------------------------
=> Game Content Creation
-----------------------------
Miscellaneous
-----------------------------
=> Article/Tutorial Requests
=> Article/Tutorial Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Development Discussion
-----------------------------
Crystal Space Projects
-----------------------------
=> Project Discussion
=> WIP Projects
=> Finished Projects
-----------------------------
Associate Projects
-----------------------------
=> CEL Discussion
=> Crystal Core Discussion
=> CrystalBlend Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Google Summer of Code
-----------------------------
Associate Projects
-----------------------------
=> Apricot (Open Game)
=> Ares Project
Loading...