当前位置: 首页>>代码示例>>C++>>正文


C++ CEGUI_THROW函数代码示例

本文整理汇总了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;
}
开发者ID:ALArmagost,项目名称:IV-Network,代码行数:16,代码来源:CEGUIAffector.cpp

示例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()));
    }
};
开发者ID:respu,项目名称:xsilium-engine,代码行数:16,代码来源:Shader.cpp

示例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."));
}
开发者ID:ALArmagost,项目名称:IV-Network,代码行数:16,代码来源:CEGUIWindowRendererModule.cpp

示例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()));
    }
开发者ID:baibaiwei,项目名称:cegui,代码行数:16,代码来源:IconvStringTranscoder.cpp

示例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);
}
开发者ID:respu,项目名称:xsilium-engine,代码行数:16,代码来源:Renderer.cpp

示例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()));
    }
};
开发者ID:respu,项目名称:xsilium-engine,代码行数:16,代码来源:Shader.cpp

示例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);
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:17,代码来源:ViewportTarget.cpp

示例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;
}
开发者ID:esrrhs,项目名称:fuck-music-player,代码行数:16,代码来源:helper.cpp

示例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);
}
开发者ID:respu,项目名称:xsilium-engine,代码行数:19,代码来源:WindowRendererManager.cpp

示例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;
}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:17,代码来源:AnimationManager.cpp

示例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;
}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:17,代码来源:Renderer.cpp

示例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;
}
开发者ID:esrrhs,项目名称:fuck-music-player,代码行数:16,代码来源:helper.cpp

示例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));
}
开发者ID:Toby91,项目名称:DDEngine,代码行数:18,代码来源:Texture.cpp

示例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.
}
开发者ID:ALArmagost,项目名称:IV-Network,代码行数:20,代码来源:CEGUIImage.cpp

示例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);
}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:18,代码来源:NamedElement.cpp


注:本文中的CEGUI_THROW函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。