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


C++ Drawable类代码示例

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


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

示例1: Drawable_get_scale

static VALUE Drawable_get_scale(VALUE vSelf) {
	// Get C++ object pointer from vSelf
	Drawable *pSelf;
	Data_Get_Struct(vSelf, Drawable, pSelf);
	float x = pSelf->GetScaleX();
	float y = pSelf->GetScaleY();
	VALUE vArr = rb_ary_new();
	rb_ary_push(vArr, rb_float_new(x));
	rb_ary_push(vArr, rb_float_new(y));
	return vArr;
}
开发者ID:freemaul,项目名称:SFML,代码行数:11,代码来源:sfDrawable.cpp

示例2: while

void RenderingEngine::ClearExpired(){
    simnode<Drawable>* node = _drawables->head;
    while (node != NULL) {
        Drawable* d = node->data;
        if(d->IsExpired()){
            node = _drawables->removeAndGetNext(node, !d->PreserveExpired());
            continue;
        }
        node = node->next;
    }
}
开发者ID:YouVisio,项目名称:frog-fu-youvisio,代码行数:11,代码来源:RenderingEngine.cpp

示例3: drawMapDrawables

	void AiEngine::drawMapDrawables() const
	{
		MapDrawablesSet::const_iterator it;
		for (it = mapDrawables.begin(); it != mapDrawables.end(); it++)
		{
			mapCanvas.reset();

			Drawable *drawable = *it;
			drawable->draw(mapCanvas);
		}
	}
开发者ID:hackcraft-sk,项目名称:swarm,代码行数:11,代码来源:AiEngine.cpp

示例4: drawScreenDrawables

	void AiEngine::drawScreenDrawables() const
	{
		ScreenDrawablesSet::const_iterator it;
		for (it = screenDrawables.begin(); it != screenDrawables.end(); it++)
		{
			screenCanvas.reset();

			Drawable *drawable = *it;
			drawable->draw(screenCanvas);
		}
	}
开发者ID:hackcraft-sk,项目名称:swarm,代码行数:11,代码来源:AiEngine.cpp

示例5: Component

Drawable::Drawable (const Drawable& other)
    : Component (other.getName())
{
    setInterceptsMouseClicks (false, false);
    setPaintingIsUnclipped (true);

    setComponentID (other.getComponentID());
    setTransform (other.getTransform());

    if (auto* clipPath = other.drawableClipPath.get())
        setClipPath (clipPath->createCopy());
}
开发者ID:imekon,项目名称:SampleBrowser2,代码行数:12,代码来源:juce_Drawable.cpp

示例6: DoesIntersect

bool Scene::DoesIntersect(const Ray &ray)
{
    for (std::vector<Drawable *>::const_iterator i = m_DrawableList.begin(); i != m_DrawableList.end(); i++) {
        Drawable *d = *i;

        if (d->Intersect(ray)) {
            return true;
        }
    }

    return false;
}
开发者ID:travisg,项目名称:ray,代码行数:12,代码来源:Scene.cpp

示例7: redo

void GraphicsEngine::redo()
{
    if (!redoStack.empty())
    {
        Drawable *obj = redoStack.back();
        obj->load();
        objects.push_back(obj);
        std::stable_sort(objects.begin(), objects.end(), [](const Drawable* a, const Drawable* b) { return a->sortIndex() < b->sortIndex(); });
        redoStack.pop_back();
        undoStack.push_back(obj);
    }
}
开发者ID:tterrag1098,项目名称:COSC482,代码行数:12,代码来源:GraphicsEngine.cpp

示例8: destroy_drawables

/**
 * \brief Destroys from Lua all drawable objects created
 * by this script.
 */
void LuaContext::destroy_drawables() {

  std::set<Drawable*>::iterator it;
  for (it = drawables.begin(); it != drawables.end(); ++it) {
    Drawable* drawable = *it;
    drawable->decrement_refcount();
    if (drawable->get_refcount() == 0) {
      delete drawable;
    }
  }
  drawables.clear();
  drawables_to_remove.clear();
}
开发者ID:ElAleyo,项目名称:solarus,代码行数:17,代码来源:DrawableAPI.cpp

示例9: StaticTrace_addTile

void StaticTrace_addTile(StaticTrace* self, Tile* tile, uint32_t x, uint32_t y)
{
	//if the position is correct
	if(x < self->nbCasesX && y < self->nbCasesY && tile)
	{
		//Add the tile
		self->tiles[x][y] = tile;

		//And set its position
		Drawable* tileDrawable = (Drawable*)tile;
		tileDrawable->setPosition(tileDrawable, self->padX + x*self->sizeX, self->padY + y*self->sizeY);
	}
}
开发者ID:MickaelSERENO,项目名称:ET3_Project_C,代码行数:13,代码来源:Trace.c

示例10: SetText

void TextDraw::SetText(
	Drawable & draw,
	const Font & font, const std::string & text,
	float x, float y, float scalex, float scaley,
	float r, float g, float b,
	VertexArray & output_array)
{
	RenderText(font, text, x, y, scalex, scaley, output_array);
	draw.SetTextures(font.GetFontTexture()->GetId());
	draw.SetVertArray(&output_array);
	draw.SetCull(false, false);
	draw.SetColor(r, g, b, 1.0);
}
开发者ID:HaohaoLau,项目名称:vdrift,代码行数:13,代码来源:text_draw.cpp

示例11: while

void BoxOctreeQuery::TestDrawables(Drawable** start, Drawable** end, bool inside)
{
    while (start != end)
    {
        Drawable* drawable = *start++;
        
        if ((drawable->GetDrawableFlags() & drawableFlags_) && (drawable->GetViewMask() & viewMask_))
        {
            if (inside || box_.IsInsideFast(drawable->GetWorldBoundingBox()))
                result_.Push(drawable);
        }
    }
}
开发者ID:Boshin,项目名称:Urho3D,代码行数:13,代码来源:OctreeQuery.cpp

示例12: w_draw

	/**
	* Draws an Image at the specified coordinates, with rotation and
	* scaling along both axes.
	* @param x The x-coordinate.
	* @param y The y-coordinate.
	* @param angle The amount of rotation.
	* @param sx The scale factor along the x-axis. (1 = normal).
	* @param sy The scale factor along the y-axis. (1 = normal).
	* @param ox The offset along the x-axis.
	* @param oy The offset along the y-axis.
	**/
	int w_draw(lua_State * L)
	{
		Drawable * drawable = luax_checktype<Drawable>(L, 1, "Drawable", GRAPHICS_DRAWABLE_T);
		float x = (float)luaL_optnumber(L, 2, 0.0f);
		float y = (float)luaL_optnumber(L, 3, 0.0f);
		float angle = (float)luaL_optnumber(L, 4, 0.0f);
		float sx = (float)luaL_optnumber(L, 5, 1.0f);
		float sy = (float)luaL_optnumber(L, 6, sx);
		float ox = (float)luaL_optnumber(L, 7, 0);
		float oy = (float)luaL_optnumber(L, 8, 0);
		drawable->draw(x, y, angle, sx, sy, ox, oy);
		return 0;
	}
开发者ID:AnisB,项目名称:love,代码行数:24,代码来源:wrap_Graphics.cpp

示例13: Draw

void Gameplay::Draw() {
	int activeAsteroids = 0;
	for(auto it = asteroids.begin(); it != asteroids.end(); ++it) {
		if(!(*it)->active)
			continue;
		activeAsteroids++;
		(*it)->fillInstanceData(asteroidDraw->instances);
	}
	if(activeAsteroids > 0) {
		asteroidDraw->setEffectTextures();
		asteroidDraw->drawInstanced(activeAsteroids);
	}

	for(auto it = sceneMgr->Begin(); it != sceneMgr->End(); ++it) {
		if(!(*it)->active)
			continue;
		(*it)->Draw();
	}

	laserDraw->setShader("laserEffect", "RenderLasers");
	laserDraw->draw();

	//draw glowy stuff
	resourceMgr->md3dImmediateContext->RSSetViewports(1, &resourceMgr->viewports["DScale2"]);
	resourceMgr->md3dImmediateContext->OMSetRenderTargets(1, &resourceMgr->renderTargets["DScale"], NULL);
	resourceMgr->md3dImmediateContext->ClearRenderTargetView(resourceMgr->renderTargets["DScale"], reinterpret_cast<const float*>(&Colors::Black));
	for(auto it = sceneMgr->Begin(); it != sceneMgr->End(); ++it) 
	{
		if(!(*it)->glow || !(*it)->active)
			continue;
		Drawable* temp = (*it)->GetComponent<Drawable>();
		if(temp)
		{
			temp->setShader("glowDraw", "RenderGlowy");
			temp->setEffectVariables();
			temp->setEffectTextures();
			(*it)->Draw();
			temp->setShader("betterPhongBump", "Render");
		}
	}
	laserDraw->setShader("glowDraw", "RenderGlowy");
	laserDraw->setEffectVariables();
	laserDraw->draw();
	laserDraw->points.clear();

	glow->setEffectVariables();
	glow->draw("DScale", "DScale2", "Pass2", "Original");

	closeButton->Draw( );
}
开发者ID:Daminvar,项目名称:Project-NN,代码行数:50,代码来源:Gameplay.cpp

示例14: execSyncV

void DrawableBase::execSyncV(      FieldContainer    &oFrom,
                                        ConstFieldMaskArg  whichField,
                                        AspectOffsetStore &oOffsets,
                                        ConstFieldMaskArg  syncMode,
                                  const UInt32             uiSyncInfo)
{
    Drawable *pThis = static_cast<Drawable *>(this);

    pThis->execSync(static_cast<Drawable *>(&oFrom),
                    whichField,
                    oOffsets,
                    syncMode,
                    uiSyncInfo);
}
开发者ID:Langkamp,项目名称:OpenSGDevMaster_Toolbox,代码行数:14,代码来源:OSGDrawableBase.cpp

示例15: UpdateDrawablesWork

void UpdateDrawablesWork(const WorkItem* item, unsigned threadIndex)
{
    const FrameInfo& frame = *(reinterpret_cast<FrameInfo*>(item->aux_));
    Drawable** start = reinterpret_cast<Drawable**>(item->start_);
    Drawable** end = reinterpret_cast<Drawable**>(item->end_);

    while (start != end)
    {
        Drawable* drawable = *start;
        if (drawable)
            drawable->Update(frame);
        ++start;
    }
}
开发者ID:julyfortoday,项目名称:Urho3D,代码行数:14,代码来源:Octree.cpp


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