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


C++ Sampler::getTexture方法代码示例

本文整理汇总了C++中texture::Sampler::getTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ Sampler::getTexture方法的具体用法?C++ Sampler::getTexture怎么用?C++ Sampler::getTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在texture::Sampler的用法示例。


在下文中一共展示了Sampler::getTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lua_TextureSampler_getTexture

int lua_TextureSampler_getTexture(lua_State* state)
{
    // Get the number of parameters.
    int paramCount = lua_gettop(state);

    // Attempt to match the parameters to a valid binding.
    switch (paramCount)
    {
        case 1:
        {
            if ((lua_type(state, 1) == LUA_TUSERDATA))
            {
                Texture::Sampler* instance = getInstance(state);
                void* returnPtr = (void*)instance->getTexture();
                if (returnPtr)
                {
                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                    object->instance = returnPtr;
                    object->owns = false;
                    luaL_getmetatable(state, "Texture");
                    lua_setmetatable(state, -2);
                }
                else
                {
                    lua_pushnil(state);
                }

                return 1;
            }
            else
            {
                lua_pushstring(state, "lua_TextureSampler_getTexture - Failed to match the given parameters to a valid function signature.");
                lua_error(state);
            }
            break;
        }
        default:
        {
            lua_pushstring(state, "Invalid number of parameters (expected 1).");
            lua_error(state);
            break;
        }
    }
    return 0;
}
开发者ID:Brashworks,项目名称:GamePlay,代码行数:45,代码来源:lua_TextureSampler.cpp

示例2: getTexture

Texture* ParticleEmitter::getTexture() const
{
    Texture::Sampler* sampler = _spriteBatch ? _spriteBatch->getSampler() : NULL;
    return sampler? sampler->getTexture() : NULL;
}
开发者ID:hgl888,项目名称:RuntimeCanvas,代码行数:5,代码来源:ParticleEmitter.cpp


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