本文整理汇总了C++中CEGUI_THROW函数的典型用法代码示例。如果您正苦于以下问题:C++ CEGUI_THROW函数的具体用法?C++ CEGUI_THROW怎么用?C++ CEGUI_THROW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CEGUI_THROW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CEGUI_THROW
//----------------------------------------------------------------------------//
KeyFrame* Affector::createKeyFrame(float position)
{
if (d_keyFrames.find(position) != d_keyFrames.end())
{
CEGUI_THROW(InvalidRequestException(
"Affector::createKeyFrame: Unable to create KeyFrame "
"at given position, there already is a KeyFrame "
"on that position."));
}
KeyFrame* ret = new KeyFrame(this, position);
d_keyFrames.insert(std::make_pair(position, ret));
return ret;
}
示例2: glGetProgramInfoLog
//----------------------------------------------------------------------------//
void OpenGL3Shader::outputProgramLog(GLuint program)
{
char logBuffer[LOG_BUFFER_SIZE];
GLsizei length;
logBuffer[0] = '\0';
glGetProgramInfoLog(program, LOG_BUFFER_SIZE, &length, logBuffer);
if (length > 0)
{
std::stringstream sstream;
sstream << "OpenGL3Shader linking has failed.\n" << logBuffer;
CEGUI_THROW(RendererException(sstream.str()));
}
};
示例3: CEGUI_THROW
//----------------------------------------------------------------------------//
void WindowRendererModule::registerFactory(const String& type_name)
{
FactoryRegistry::iterator i = d_registry.begin();
for ( ; i != d_registry.end(); ++i)
{
if ((*i)->d_type == type_name)
{
(*i)->registerFactory();
return;
}
}
CEGUI_THROW(UnknownObjectException("No factory for WindowRenderere type '" +
type_name + "' in this module."));
}
示例4: throwErrorException
//------------------------------------------------------------------------//
void throwErrorException(int err)
{
std::string reason;
if (err == EINVAL)
reason = "Incomplete " + d_fromCode + " sequence.";
else if (err == EILSEQ)
reason = "Invalid " + d_fromCode + " sequence.";
else
reason = "Unknown error.";
CEGUI_THROW(InvalidRequestException(String(
"Failed to convert from \"") + d_fromCode.c_str() +
"\" to \"" + d_toCode.c_str() + "\": " + reason.c_str()));
}
示例5: CEGUI_THROW
//----------------------------------------------------------------------------//
void OpenGL3Renderer::destroySystem()
{
System* sys;
if (!(sys = System::getSingletonPtr()))
CEGUI_THROW(InvalidRequestException(
"CEGUI::System object is not created or was already destroyed."));
OpenGL3Renderer* renderer = static_cast<OpenGL3Renderer*>(sys->getRenderer());
DefaultResourceProvider* rp =
static_cast<DefaultResourceProvider*>(sys->getResourceProvider());
System::destroy();
delete rp;
destroy(*renderer);
}
示例6: glGetShaderInfoLog
//----------------------------------------------------------------------------//
void OpenGL3Shader::outputShaderLog(GLuint shader)
{
char logBuffer[LOG_BUFFER_SIZE];
GLsizei length;
logBuffer[0] = '\0';
glGetShaderInfoLog(shader, LOG_BUFFER_SIZE, &length, logBuffer);
if (length > 0)
{
std::stringstream ss;
ss << "OpenGL3Shader compilation has failed.\n" << logBuffer;
CEGUI_THROW(RendererException(ss.str()));
}
};
示例7: CEGUI_THROW
//----------------------------------------------------------------------------//
Direct3D9ViewportTarget::Direct3D9ViewportTarget(Direct3D9Renderer& owner) :
Direct3D9RenderTarget<>(owner)
{
// initialise renderer size
D3DVIEWPORT9 vp;
if (FAILED(d_owner.getDevice()->GetViewport(&vp)))
CEGUI_THROW(RendererException("Unable to access "
"required view port information from Direct3DDevice9."));
Rectf area(
Vector2f(static_cast<float>(vp.X), static_cast<float>(vp.Y)),
Sizef(static_cast<float>(vp.Width), static_cast<float>(vp.Height))
);
setArea(area);
}
示例8: Utf16ToACP
std::string Utf16ToACP(const std::wstring& utf16text)
{
const int len = WideCharToMultiByte(CP_ACP, 0, utf16text.c_str(), -1,
0, 0, 0, 0);
if (!len)
CEGUI_THROW(CEGUI::InvalidRequestException(
"Utf16ToUtf8 - WideCharToMultiByte failed"));
char* buff = new char[len];
WideCharToMultiByte(CP_ACP, 0, utf16text.c_str(), -1,
buff, len, 0, 0);
const std::string result(buff);
delete[] buff;
return result;
}
示例9: CEGUI_THROW
/*************************************************************************
Add a new WindowRenderer factory
*************************************************************************/
void WindowRendererManager::addFactory(WindowRendererFactory* wr)
{
if (wr == 0)
{
return;
}
if (d_wrReg.insert(std::make_pair(wr->getName(), wr)).second == false)
{
CEGUI_THROW(AlreadyExistsException("A WindowRendererFactory named '"+wr->getName()+"' already exist"));
}
char addr_buff[32];
sprintf(addr_buff, "(%p)", static_cast<void*>(wr));
Logger::getSingleton().logEvent("WindowRendererFactory '"+wr->getName()+
"' added. " + addr_buff);
}
示例10: CEGUI_THROW
//----------------------------------------------------------------------------//
void AnimationManager::destroyAnimation(const String& name)
{
AnimationMap::iterator it = d_animations.find(name);
if (it == d_animations.end())
{
CEGUI_THROW(UnknownObjectException("Animation with name '" + name
+ "' not found."));
}
Animation* animation = it->second;
destroyAllInstancesOfAnimation(animation);
d_animations.erase(it);
CEGUI_DELETE_AO animation;
}
示例11: CEGUI_THROW
//----------------------------------------------------------------------------//
Texture& DirectFBRenderer::createTexture(const CEGUI::String& name,
const String& filename,
const String& resourceGroup)
{
if (d_textures.find(name) != d_textures.end())
CEGUI_THROW(AlreadyExistsException(
"A texture named '" + name + "' already exists."));
DirectFBTexture* tex = new DirectFBTexture(d_directfb, name,
filename, resourceGroup);
d_textures[name] = tex;
logTextureCreation(tex);
return *tex;
}
示例12: Utf16ToString
CEGUI::String Utf16ToString(const wchar_t* const utf16text)
{
const int len = WideCharToMultiByte(CP_UTF8, 0, utf16text, -1,
0, 0, 0, 0);
if (!len)
CEGUI_THROW(CEGUI::InvalidRequestException(
"Utf16ToUtf8 - WideCharToMultiByte failed"));
CEGUI::utf8* buff = new CEGUI::utf8[len];
WideCharToMultiByte(CP_UTF8, 0, utf16text, -1,
reinterpret_cast<char*>(buff), len, 0, 0);
const CEGUI::String result(buff);
delete[] buff;
return result;
}
示例13: CEGUI_THROW
//----------------------------------------------------------------------------//
void OpenGLESTexture::loadFromMemory(const void* buffer,
const Sizef& buffer_size,
PixelFormat pixel_format)
{
if (!isPixelFormatSupported(pixel_format))
CEGUI_THROW(InvalidRequestException(
"Data was supplied in an unsupported pixel format."));
initPixelFormatFields(pixel_format);
setTextureSize_impl(buffer_size);
// store size of original data we are loading
d_dataSize = buffer_size;
updateCachedScaleValues();
blitFromMemory(buffer, Rectf(Vector2f(0, 0), buffer_size));
}
示例14: d_owner
/*************************************************************************
Constructor
*************************************************************************/
Image::Image(const Imageset* owner, const String& name, const Rect& area, const Point& render_offset, float horzScaling, float vertScaling) :
d_owner(owner),
d_area(area),
d_offset(render_offset),
d_name(name)
{
if (!d_owner)
{
CEGUI_THROW(NullObjectException("Image::Image - Imageset pointer passed to Image constructor must be valid."));
}
// setup initial image scaling
setHorzScaling(horzScaling);
setVertScaling(vertScaling);
// TODO: if we ever store texture co-ordinates, they should be calculated here.
}
示例15: getChildByNamePath_impl
//----------------------------------------------------------------------------//
void NamedElement::addChild_impl(Element* element)
{
NamedElement* named_element = dynamic_cast<NamedElement*>(element);
if (named_element)
{
const NamedElement* const existing = getChildByNamePath_impl(named_element->getName());
if (existing && named_element != existing)
CEGUI_THROW(AlreadyExistsException("Failed to add "
"Element named: " + named_element->getName() + " to element at: " +
getNamePath() + " since an Element with that name is already "
"attached."));
}
Element::addChild_impl(element);
}