fix swapBuffers error on close & camera props

This commit is contained in:
floralrainfall 2023-07-18 01:36:13 -04:00
parent ef52688d66
commit eda5b0aa22
3 changed files with 15 additions and 1 deletions

View File

@ -124,7 +124,8 @@ namespace RNR
ogreCamera->getParentSceneNode()->setOrientation(Ogre::Quaternion(cam->getCFrame().getRotation()));
}
ogreRoot->renderOneFrame(this->delta);
if(isVisible())
ogreRoot->renderOneFrame(this->delta);
}
Ogre::NameValuePairList OgreWidget::getRenderOptions()

View File

@ -13,6 +13,7 @@ namespace RNR
private:
CoordinateFrame m_cframe;
virtual void deserializeProperty(char* prop_name, pugi::xml_node prop);
virtual void addProperties(std::vector<ReflectionProperty>& properties);
public:
Camera();
~Camera();

View File

@ -20,4 +20,16 @@ namespace RNR
setCFrame(XML::getCFrame(node));
}
}
void Camera::addProperties(std::vector<ReflectionProperty>& properties)
{
ReflectionProperty _properties[] = {
{ this, std::string("CFrame"), std::string(""),
ACCESS_NONE, OPERATION_READWRITE, PROPERTY_CFRAME,
REFLECTION_GETTER(Camera* instance = (Camera*)object; return &instance->m_cframe; ),
REFLECTION_SETTER(Camera* instance = (Camera*)object; instance->setCFrame(*(CoordinateFrame*)value); ) },
};
properties.insert(properties.end(), _properties, _properties+(sizeof(_properties)/sizeof(ReflectionProperty)));
}
}