00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00034 #include "SO3WidgetFactory.h"
00035
00036 namespace SO3
00037 {
00038
00039 SWidgetFactory::SWidgetFactory()
00040 {
00041
00042 }
00043
00044 SWidgetFactory::SWidgetFactory(std::string widgetType)
00045 {
00046 type = widgetType;
00047
00048
00049 #if OGRE_VERSION >= ((1 << 16) | (7 << 8) | 0)
00050 Ogre::ResourceGroupManager::getSingleton().createResourceGroup(std::string(SO3_INTERNAL_RESOURCE_GROUP)+"/Widgets/"+type, true);
00051 #endif
00052 }
00053
00054 SWidgetFactory::~SWidgetFactory()
00055 {
00056
00057 #if OGRE_VERSION >= ((1 << 16) | (7 << 8) | 0)
00058 Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(std::string(SO3_INTERNAL_RESOURCE_GROUP)+"/Widgets/"+type);
00059 #endif
00060 }
00061
00062 std::string SWidgetFactory::GetType()
00063 {
00064 return type;
00065 }
00066
00067 SWidget* SWidgetFactory::CreateWidget(SScene* targetScene, std::string widgetName, int xPos, int yPos, unsigned short width, unsigned short height, SViewPort* targetViewport, unsigned int widgetZOrder)
00068 {
00069 return CreateWidgetImpl(targetScene, widgetName, xPos, yPos, width, height, targetViewport, widgetZOrder);
00070 }
00071
00072 SWidget* SWidgetFactory::CreateWidget(SScene* targetScene, std::string widgetName, int xPos, int yPos, unsigned short width, unsigned short height, SViewPort* targetViewport)
00073 {
00074 return CreateWidgetImpl(targetScene, widgetName, xPos, yPos, width, height, targetViewport);
00075 }
00076
00077 SWidget* SWidgetFactory::CreateWidget(SScene* targetScene, std::string widgetName, unsigned short width, unsigned short height, SMaterial* targetMaterial, unsigned short targetTechnique, unsigned short targetPass, unsigned short targetTextureUnit)
00078 {
00079 return CreateWidgetImpl(targetScene, widgetName, width, height, targetMaterial, targetTechnique, targetPass, targetTextureUnit);
00080 }
00081
00082 void SWidgetFactory::DeleteWidget(SWidget* existingWidget)
00083 {
00084 assert(existingWidget->GetType() == type);
00085 DeleteWidgetImpl(existingWidget);
00086 }
00087
00088 }