• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ eRect类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: invalidate

void eWidget::invalidate(eRect area, int force)
{
	if ( (!(state & stateVisible)) && (!force))
		return;

	if (area.isNull())
		area=eRect(0, 0, size.width(), size.height());

	eWidget *w=this;

	// problem: überlappende, nicht transparente fenster

	while (force || (((int)w->getBackgroundColor())==-1))
	//	while (1)
	{
		force=0;
		if (!w->parent)	// spaetestens fuers TLW sollte backgroundcolor aber non-transparent sein
			break;
		area.moveBy(w->position.x(), w->position.y());
		w=w->parent;
		area.moveBy(w->clientrect.x(), w->clientrect.y());
		area&=w->clientrect;
	}
	w->redraw(area);
}
开发者ID:TitanNit,项目名称:tdt,代码行数:25,代码来源:ewidget.cpp


示例2: _renderLightPass

void eDeferredRenderer::_renderLightPass(eScene &scene, const eCamera &cam, const eRect &area)
{
    eStateManager::push();
    eStateManager::bindTexture(0, m_diffuseRt);
    eStateManager::bindTexture(1, m_normalsRt);
    eStateManager::bindTexture(2, m_specularRt);
    eStateManager::bindTexture(3, m_positionRt);
    eStateManager::bindTexture(4, m_deferredShadowMap);
    eStateManager::setTextureFilter(0, eTEXFILTER_NEAREST);
    eStateManager::setTextureFilter(1, eTEXFILTER_NEAREST);
    eStateManager::setTextureFilter(2, eTEXFILTER_NEAREST);
    eStateManager::setTextureFilter(3, eTEXFILTER_NEAREST);
    eStateManager::setTextureFilter(4, eTEXFILTER_BILINEAR);
    eStateManager::setTextureAddressMode(4, eTEXADDRMODE_CLAMP);
    eStateManager::setCap(eCAP_BLENDING, eTRUE);
    eStateManager::setBlendModes(eBLEND_ONE, eBLEND_ONE, eBLENDOP_ADD);
    eStateManager::bindPixelShader(m_psDefLight);
    eStateManager::bindVertexShader(m_vsQuad);

    for (eU32 i=0; i<scene.getLightCount(); i++)
    {
        const eLight &light = scene.getLight(i);

        if (light.activateScissor(area.getDimension(), cam))
        {
            _renderLightDistance(scene, light);
            _renderShadowMap(cam, light);

            light.activate(m_gfx, cam.getViewMatrix());
            renderQuad(area, area.getDimension());
        }
    }

    eStateManager::pop();
}
开发者ID:DX94,项目名称:Enigma-Studio-3,代码行数:35,代码来源:deferredrenderer.cpp


示例3: renderQuad

void eDeferredRenderer::_visualizeGeometryBuffer(const eRect &area) const
{
    eStateManager::push();
    eStateManager::bindVertexShader(m_vsQuad);
    eStateManager::bindPixelShader(m_psQuad);
    eStateManager::setCullingMode(eCULLING_NONE);
    eStateManager::setTextureAddressMode(0, eTEXADDRMODE_CLAMP);
    eStateManager::setCap(eCAP_ZBUFFER, eFALSE);
    eStateManager::setCap(eCAP_BLENDING, eFALSE);

    const eInt w = area.getWidth();
    const eInt h = area.getHeight();

    // Image at top left.
    eStateManager::bindTexture(0, m_specularRt);
   // renderQuad(eRect(0, h/2, w/2, h-1), area.getDimension());

    // Image at top right.
    eStateManager::bindTexture(0, m_diffuseRt);
    renderQuad(eRect(w/2, h/2, w-1, h-1), area.getDimension());

    // Image at bottom left.
    eStateManager::bindTexture(0, m_normalsRt);
    renderQuad(eRect(0, 0, w/2, h/2), area.getDimension());

    // Image at bottom right.
    eStateManager::bindTexture(0, m_positionRt);
    renderQuad(eRect(w/2, 0, w-1, h/2), area.getDimension());

    eStateManager::pop();
}
开发者ID:DX94,项目名称:Enigma-Studio-3,代码行数:31,代码来源:deferredrenderer.cpp


示例4: redrawLeftTop

void PluginOffsetScreen::redrawWidget(gPainter *target, const eRect &where)
{
	target->setForegroundColor( foreColor );
	if ( where.intersects( eRect(	ePoint( left, top ), eSize( 100, 100 ) ) ) )
		redrawLeftTop( target );
	if ( where.intersects( eRect( ePoint( right-3, bottom-100 ), eSize( 3, 100 ) ) ) )
		redrawRightBottom( target );
}
开发者ID:ChakaZulu,项目名称:tuxbox_apps,代码行数:8,代码来源:setup_osd.cpp


示例5: setFullScreenPosition

void eVideoWidget::setFullScreenPosition(eRect pos)
{
    posFullsizeLeft = pos.left();
    posFullsizeTop = pos.top();
    posFullsizeWidth = pos.width();
    posFullsizeHeight = pos.height();
    setPosition(0, posFullsizeLeft, posFullsizeTop, posFullsizeWidth, posFullsizeHeight);
}
开发者ID:OpenAR-P,项目名称:enigma2-pli-arp,代码行数:8,代码来源:evideo.cpp


示例6: setFullScreenPosition

void eVideoWidget::setFullScreenPosition(eRect pos)
{
	posFullsizeLeft = pos.left();
	posFullsizeTop = pos.top();
	posFullsizeWidth = pos.width();
	posFullsizeHeight = pos.height();
	cXineLib* xineLib = cXineLib::getInstance();
	xineLib->setVideoWindow(posFullsizeLeft, posFullsizeTop, posFullsizeWidth, posFullsizeHeight);
	setPosition(0, posFullsizeLeft, posFullsizeTop, posFullsizeWidth, posFullsizeHeight);
}
开发者ID:Leatherface75,项目名称:enigma2pc,代码行数:10,代码来源:evideo.cpp


示例7: renderQuad

void eDeferredRenderer::_showGeometryBuffer(eTexture2d *target, const eRect &area) const
{
    const eInt w = area.getWidth();
    const eInt h = area.getHeight();

    eGfx->freshRenderState().targets[0] = target;

    renderQuad(eRect(  0, h/3, w/2,     h), area.getSize(), m_rtShadow);    // top left
    renderQuad(eRect(w/2, h/3,   w,     h), area.getSize(), m_texDistMap);  // top right
    renderQuad(eRect(  0, h/3, w/2, 2*h/3), area.getSize(), m_rtSpecular);  // middle left
    renderQuad(eRect(w/2, h/3,   w, 2*h/3), area.getSize(), m_rtDiffuse);   // middle right
    renderQuad(eRect(  0,   0, w/2,   h/3), area.getSize(), m_rtNormals);   // bottom left
    renderQuad(eRect(w/2,   0,   w,   h/3), area.getSize(), m_rtPosition);  // bottom right
}
开发者ID:enigmastudio,项目名称:Enigma-Studio-4,代码行数:14,代码来源:deferredrenderer.cpp


示例8: _renderAmbientPass

void eDeferredRenderer::_renderAmbientPass(eTexture2d *target, eTexture2d *depthTarget, const eScene &scene, const eRect &area)
{
    // calculate the ambient color
    eColor ambient;
    for (eU32 i=0; i<scene.getLightCount(); i++)
        ambient += scene.getLight(i).getAmbient();

    // render the ambient light
    static eConstBuffer<eVector4, eST_PS> cb;
    cb.data = ambient;

    eRenderState &rs = eGfx->freshRenderState();
    rs.targets[0] = target;
	rs.depthTarget = depthTarget;
    rs.ps = m_psDefAmbient;
    rs.constBufs[eCBI_PASS_AMBIENT] = &cb;
    rs.textures[0] = m_rtDiffuse;
	rs.textures[3] = m_rtPosition;
    rs.textures[4] = m_rtEnvironment;
    rs.texFlags[0] = eTMF_CLAMP|eTMF_NEAREST;
	rs.texFlags[3] = eTMF_CLAMP|eTMF_NEAREST;
    rs.texFlags[4] = eTMF_CLAMP|eTMF_NEAREST;

    eGfx->clear(eCM_COLOR, eCOL_YELLOW);
    renderQuad(area, area.getSize(), nullptr);
}
开发者ID:enigmastudio,项目名称:Enigma-Studio-4,代码行数:26,代码来源:deferredrenderer.cpp


示例9: clearRegion

static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *local_style, ePyObject pforeColor, ePyObject pforeColorSelected, ePyObject pbackColor, ePyObject pbackColorSelected, int selected, gRegion &rc, eRect &sel_clip, const ePoint &offset, bool cursorValid, bool clear=true)
{
	if (selected && sel_clip.valid())
	{
		gRegion part = rc - sel_clip;
		if (!part.empty())
		{
			painter.clip(part);
			style.setStyle(painter, eWindowStyle::styleListboxNormal);
			clearRegionHelper(painter, local_style, offset, pbackColor, cursorValid, clear);
			painter.clippop();
			selected = 0;
		}
		part = rc & sel_clip;
		if (!part.empty())
		{
			painter.clip(part);
			style.setStyle(painter, eWindowStyle::styleListboxSelected);
			clearRegionSelectedHelper(painter, local_style, offset, pbackColorSelected, cursorValid, clear);
			painter.clippop();
			selected = 1;
		}
	}
	else if (selected)
	{
		style.setStyle(painter, eWindowStyle::styleListboxSelected);
		clearRegionSelectedHelper(painter, local_style, offset, pbackColorSelected, cursorValid, clear);
		if (local_style && local_style->m_selection)
			painter.blit(local_style->m_selection, offset, eRect(), gPainter::BT_ALPHATEST);
	}
	else
	{
		style.setStyle(painter, eWindowStyle::styleListboxNormal);
		clearRegionHelper(painter, local_style, offset, pbackColor, cursorValid, clear);
	}

	if (selected)
	{
		if (pforeColorSelected)
		{
			unsigned int color = PyInt_AsUnsignedLongMask(pforeColorSelected);
			painter.setForegroundColor(gRGB(color));
		}
		/* if we have a local foreground color set, use that. */
		else if (local_style && local_style->m_foreground_color_selected_set)
			painter.setForegroundColor(local_style->m_foreground_color_selected);
	}
	else
	{
		if (pforeColor)
		{
			unsigned int color = PyInt_AsUnsignedLongMask(pforeColor);
			painter.setForegroundColor(gRGB(color));
		}
		/* if we have a local foreground color set, use that. */
		else if (local_style && local_style->m_foreground_color_set)
			painter.setForegroundColor(local_style->m_foreground_color);
	}
}
开发者ID:Akki01,项目名称:enigma2,代码行数:59,代码来源:elistboxcontent.cpp


示例10: dc

gPainter::gPainter(gDC &dc, eRect rect): dc(dc), rc(gRC::getInstance()), foregroundColor(0), backgroundColor(0), cornerRound(0)
{
	if (rect.isNull())
		rect=eRect(ePoint(0, 0), dc.getSize());
//	ASSERT(!gPainter_instances);
	gPainter_instances++;
	begin(rect);
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:8,代码来源:grc.cpp


示例11: setSpinner

void gDC::setSpinner(eRect pos, ePtr<gPixmap> *pic, int len)
{
	ASSERT(m_pixmap);
	ASSERT(m_pixmap->surface);
	m_spinner_saved = new gPixmap(pos.size(), m_pixmap->surface->bpp);
	m_spinner_temp = new gPixmap(pos.size(), m_pixmap->surface->bpp);
	m_spinner_pos = pos;

	m_spinner_i = 0;
	m_spinner_num = len;

	int i;
	if (m_spinner_pic)
		delete[] m_spinner_pic;

	m_spinner_pic = new ePtr<gPixmap>[len];

	for (i = 0; i < len; ++i)
		m_spinner_pic[i] = pic[i];
}
开发者ID:Adga52,项目名称:enigma2,代码行数:20,代码来源:grc.cpp


示例12: setSelectionClip

void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
{
	m_selection_clip = rect;
	if (m_listbox)
		rect.moveBy(ePoint(0, m_listbox->getEntryTop()));
	if (m_clip.valid())
		m_clip |= rect;
	else
		m_clip = rect;
	if (update && m_listbox)
		m_listbox->entryChanged(m_cursor);
}
开发者ID:Akki01,项目名称:enigma2,代码行数:12,代码来源:elistboxcontent.cpp


示例13: clip

void gPainter::clip(eRect clip)
{
	if ( dc.islocked() )
		return;
	gOpcode o;
	o.dc=&dc;
	o.opcode=gOpcode::clip;
	clip.moveBy(logicalZero.x(), logicalZero.y());
	cliparea.push(cliparea.top()&clip);
	o.parm.clip=new gOpcode::para::pclip(cliparea.top());

	rc.submit(o);
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:13,代码来源:grc.cpp


示例14: _renderLightPass

void eDeferredRenderer::_renderLightPass(eTexture2d *target, eTexture2d *depthTarget, const eScene &scene, const eCamera &cam, const eRect &area)
{
    for (eU32 i=0; i<scene.getLightCount(); i++)
    {
        const eLight &light = scene.getLight(i);
        if (light.activateScissor(area.getSize(), cam))
        {
            // create shadow map for light
#ifndef eCFG_NO_ENGINE_DEFERRED_SHADOWS
            _renderLightDistance(scene, light);
            _renderShadowMap(cam, light, depthTarget);
#endif

            // perform deferred lighting+shadowing
            eRenderState &rs = eGfx->freshRenderState();
            rs.targets[0] = target;
			rs.depthTarget = depthTarget;
            rs.textures[0] = m_rtDiffuse;
            rs.textures[1] = m_rtNormals;
            rs.textures[2] = m_rtSpecular;
            rs.textures[3] = m_rtPosition;
            rs.textures[4] = m_rtShadow;
            rs.texFlags[0] = eTMF_CLAMP|eTMF_NEAREST;
            rs.texFlags[1] = eTMF_CLAMP|eTMF_NEAREST;
            rs.texFlags[2] = eTMF_CLAMP|eTMF_NEAREST;
            rs.texFlags[3] = eTMF_CLAMP|eTMF_NEAREST;
            rs.texFlags[4] = eTMF_BILINEAR;
            rs.blending = eTRUE;
            rs.blendSrc = eBM_ONE;
            rs.blendDst = eBM_ONE;
            rs.ps = m_psDefLight;
            rs.vs = m_vsQuad;

            light.activate(cam.getViewMatrix());
            renderQuad(area, area.getSize());
        }
    }
}
开发者ID:enigmastudio,项目名称:Enigma-Studio-4,代码行数:38,代码来源:deferredrenderer.cpp


示例15: eraseBackground

void eWidget::redraw(eRect area)		// area bezieht sich nicht auf die clientarea
{
	if (getTLW()->just_showing)
		return;

	if (state & stateVisible )
	{
		if (area.isNull())
			area=eRect(0, 0, size.width(), size.height());
		if (area.width()>0)
		{
			gPainter *p=getPainter(area);
			if (p)
			{
				eraseBackground(p, area);
				redrawWidget(p, area);
				delete p;
			}
		}
		if(!childlist.empty())
		{
			area.moveBy(-clientrect.x(), -clientrect.y());		// ab hier jetzt schon.

			ePtrList<eWidget>::iterator It(childlist);
			while (It != childlist.end())
			{
				eRect cr=area&eRect((*It)->position, (*It)->size);
				if (!cr.isEmpty())
				{
					cr.moveBy(-It->position.x(), -It->position.y());
					It->redraw(cr);
				}
				++It;
			}
		}
	}
}
开发者ID:TitanNit,项目名称:tdt,代码行数:37,代码来源:ewidget.cpp


示例16: DrawText

void DrawText(const eRect& r, const char* s)
{
	//	strupr(const_cast<char*>(s));
	ePoint p = r.Beg();
	for(int i = 0; s[i]; ++i)
	{
		if(p.x + font.w > r.right)
			break;
		char c = s[i];
		if(c >= 96)
			c -= 32;
		font.Draw(c, p);
		p.x += font.w;
	}
}
开发者ID:open-develop,项目名称:unrealspeccyp,代码行数:15,代码来源:ui.cpp


示例17: DrawText

void DrawText(const eRect& r, const char* s)
{
	//	strupr(const_cast<char*>(s));
	ePoint p = r.Beg();
	for(int i = 0; s[i]; ++i)
	{
		if(p.x + font.w > r.right)
			break;
		char c = toupper(s[i]);
		if(byte(c) >= 128) // non-ASCII
			c = '?';
		font.Draw(c, p);
		p.x += font.w;
	}
}
开发者ID:djdron,项目名称:UnrealSpeccyP,代码行数:15,代码来源:ui.cpp


示例18: fill

int gAccel::fill(gSurface *dst, const eRect &area, unsigned long col)
{
#ifdef ATI_ACCEL
	ati_accel_fill(
		dst->data_phys, dst->x, dst->y, dst->stride, 
		area.left(), area.top(), area.width(), area.height(),
		col);
	return 0;
#endif
#if 0 // def BCM_ACCEL
	bcm_accel_fill(
		dst->data_phys, dst->x, dst->y, dst->stride, 
		area.left(), area.top(), area.width(), area.height(),
		col);
	return 0;
#endif
	return -1;
}
开发者ID:FFTEAM,项目名称:enigma2-5,代码行数:18,代码来源:accel.cpp


示例19: _renderAlphaLightPass

void eDeferredRenderer::_renderAlphaLightPass(eTexture2d *target, eTexture2d *depthTarget, const eScene &scene, const eCamera &cam, const eRect &area)
{
    eRenderState &rs = eGfx->freshRenderState();
    rs.targets[0] = target;
	rs.depthTarget = depthTarget;
    rs.viewport.set(0, 0, m_rtNormals->width, m_rtNormals->height);

    for (eU32 i=0; i<scene.getLightCount(); i++)
    {
        const eLight &light = scene.getLight(i);
        if (light.activateScissor(area.getSize(), cam))
        {
            light.activate(cam.getViewMatrix());
            m_allJobs.render(cam, eRJW_ALPHA_ON|eRJW_LIGHTED_ON|eRJW_SHADOWS_BOTH);
        }
    }
}
开发者ID:enigmastudio,项目名称:Enigma-Studio-4,代码行数:17,代码来源:deferredrenderer.cpp


示例20: MIN

eRect eRect::operator|(const eRect &r) const
{
	if ( valid() ) {
	if ( r.valid() ) {
		eRect tmp;
		tmp.setLeft(   MIN( x1, r.x1 ) );
		tmp.setRight(  MAX( x2, r.x2 ) );
		tmp.setTop(	   MIN( y1, r.y1 ) );
		tmp.setBottom( MAX( y2, r.y2 ) );
		return tmp;
	} else {
		return *this;
	}
	} else {
	return r;
	}
}
开发者ID:TitanNit,项目名称:tdt,代码行数:17,代码来源:erect.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ eString类代码示例发布时间:2022-05-31
下一篇:
C++ ePtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap