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


C++ spNativeTexture::getFormat方法代码示例

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


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

示例1: cmp

 static bool cmp(const spNativeTexture& t2, const spNativeTexture& t1)
 {
     if (t1->getFormat() > t2->getFormat())
         return true;
     if (t1->getWidth() > t2->getWidth())
         return true;
     return t1->getHeight() > t2->getHeight();
 }
开发者ID:hicks0074,项目名称:oxygine-framework,代码行数:8,代码来源:PostProcess.cpp

示例2: operator

 bool operator()(const spNativeTexture& t1, const spNativeTexture& t2) const
 {
     if (t1->getFormat() < _tf)
         return true;
     if (t1->getWidth() < _w)
         return true;
     return t1->getHeight() < _h;
 }
开发者ID:hicks0074,项目名称:oxygine-framework,代码行数:8,代码来源:PostProcess.cpp

示例3: isGood

    bool RenderTargetsManager::isGood(const spNativeTexture& t, int w, int h, TextureFormat tf) const
    {
        if (!t)
            return false;

        if (!t->getHandle())
            return false;

        if (t->getFormat() == tf &&
                t->getWidth() >= w && t->getHeight() >= h &&
                t->getWidth() <= (w + ALIGN_SIZE) && t->getHeight() <= (h + ALIGN_SIZE))
            return true;
        return false;
    }
开发者ID:hicks0074,项目名称:oxygine-framework,代码行数:14,代码来源:PostProcess.cpp

示例4: TextureLine

        TextureLine(spNativeTexture t)
        {
            setVerticalMode(Box9Sprite::TILING_FULL);
            setHorizontalMode(Box9Sprite::TILING_FULL);
            Sprite::setResAnim(DebugActor::resSystem->getResAnim("checker"));

            AnimationFrame f;
            Vector2 s = fitSize(itemSize, Vector2((float)t->getWidth(), (float)t->getHeight()));

            setSize(s);

            Diffuse df;
            df.base = t;

            f.init(0, df, RectF(0, 0, 1.0f, 1.0f), RectF(0, 0, s.x, s.y), s);
            spSprite image = initActor(new Sprite,
                                       arg_blend = blend_disabled,
                                       arg_resAnim = f);
            addChild(image);

            spColorRectSprite rect = initActor(new ColorRectSprite,
                                               arg_color = Color(Color::White, 255),
                                               arg_attachTo = this);

            rect->addTween(Sprite::TweenColor(Color(Color::White, 0)), 4000, -1, true);

            char path[255];
            path::normalize(t->getName().c_str(), path);

            char txt[255];
            safe_sprintf(txt, "%s\n<div c=\"FF0000\">%s</div>-<div c=\"0000ff\">%dx%d</div>\nid: %d",
                         path,
                         textureFormat2String(t->getFormat()),
                         t->getWidth(), t->getHeight(), t->getObjectID());

            spTextField text = initActor(new TextField,
                                         arg_color = Color::Black,
                                         arg_w = (float)itemSize.x,
                                         arg_vAlign = TextStyle::VALIGN_TOP,
                                         arg_hAlign = TextStyle::HALIGN_LEFT,
                                         arg_multiline = true,
                                         arg_attachTo = rect,
                                         arg_htmlText = txt
                                        );

            text->setBreakLongWords(true);

            rect->setSize(text->getTextRect().size.cast<Vector2>() + Vector2(2, 2));
            rect->setY((itemSize.y - rect->getHeight()) / 2.0f);
        }
开发者ID:ivlevAstef,项目名称:PrototypeCarGame,代码行数:50,代码来源:TexturesInspector.cpp

示例5: load_texture_internal

	void load_texture_internal(const std::string &file, spNativeTexture nt, LoadResourcesContext *load_context)
	{
		ImageData im;
		spMemoryTexture mt = new MemoryTexture;

		LOGD("loading atlas: %s", file.c_str());
		file::buffer bf;
		file::read(file.c_str(), bf);
		LOGD("atlas file loaded: %s", file.c_str());
		mt->init(bf, Renderer::getPremultipliedAlphaRender(), nt->getFormat());
		//mt->init(2048, 2048, TF_R8G8B8A8);
		im = mt->lock();
		LOGD("atlas size: %d %d", im.w, im.h);

		//Object::dumpCreatedObjects();
		load_context->createTexture(mt, nt);
	}
开发者ID:luiseduardohdbackup,项目名称:oxygine-framework,代码行数:17,代码来源:ResAtlas.cpp

示例6: load_texture_internal

    void load_texture_internal(const std::string& file, spNativeTexture nt, bool linearFilter, bool clamp2edge, LoadResourcesContext* load_context)
    {
        ImageData im;
        spMemoryTexture mt = new MemoryTexture;

        LOGD("loading atlas: %s", file.c_str());
        file::buffer bf;
        file::read(file.c_str(), bf);
        LOGD("atlas file loaded: %s", file.c_str());
        mt->init(bf, true, nt->getFormat());
        im = mt->lock();
        LOGD("atlas size: %d %d", im.w, im.h);

        CreateTextureTask opt;
        opt.src = mt;
        opt.dest = nt;
        opt.linearFilter = linearFilter;
        opt.clamp2edge = clamp2edge;
        load_context->createTexture(opt);
    }
开发者ID:HaoDongGuo,项目名称:oxygine-framework,代码行数:20,代码来源:ResAtlas.cpp


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