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

C++ drawFrame函数代码示例

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

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



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

示例1: killTimers

void 
AreaSelect::disableSelection()
{
  // stop all the timer 
  killTimers();
  if (showedSF) {
    drawFrame(); // to erase the frame
  }
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:9,代码来源:areaselect.cpp


示例2: glClear

void GLSideCameraView::paintGL()
{
    // Clean the color of the screen.
    glClear( GL_COLOR_BUFFER_BIT );
    glPushMatrix();
    drawFrame();
    glScalef( 0.5, 0.5, 0.0 );
    glPopMatrix();
 }
开发者ID:BackupTheBerlios,项目名称:ktoon-svn,代码行数:9,代码来源:glsidecameraview.cpp


示例3: destroyResultsDialog

// TODO: Track and display TPS in GUI.
void GuiManager::runCurrentMatch() {
  interrupted_ = false;
  restarting_ = false;
  runnerConsole_->Hide();
  destroyResultsDialog();
  sf::RenderWindow *window = window_;
  try {
    while (window->isOpen() && !interrupted_ && !restarting_ && !quitting_) {
      while (!paused_ && !restarting_ && !engine_->isGameOver()
          && engine_->getGameTime() < nextDrawTime_) {
        engine_->processTick();
      }
      
      while (!interrupted_ && !restarting_ && !quitting_
             && (nextDrawTime_ <= engine_->getGameTime()
                 || engine_->isGameOver())) {
        processMainWindowEvents(window, gfxManager_, viewWidth_, viewHeight_);
        clearTeamErroredForActiveConsoles(engine_);
        drawFrame(window);
        if (!paused_ && !engine_->isGameOver()) {
          nextDrawTime_ += tpsFactor_;
        }
        if (engine_->isGameOver() && !showedResults_) {
          ReplayBuilder *replayBuilder = engine_->getReplayBuilder();
          Team **teams = engine_->getRankedTeams();
          replayBuilder->setResults(teams, engine_->getNumTeams());
          delete teams;
          showResults(replayBuilder);
          showedResults_ = true;
        }
      }
    }
  } catch (EngineException *e) {
    errorConsole_->println(e->what());
    wxMessageDialog errorMessage(NULL, e->what(),
        "BerryBots encountered an error", wxOK | wxICON_EXCLAMATION);
    errorMessage.ShowModal();
    newMatchDialog_->Show();
    delete e;
    return;
  }

  if (!window->isOpen()) {
    listener_->onAllWindowsClosed();
  }

  // TODO: Display CPU usage in GUI

  if (!interrupted_) {
    gfxManager_->destroyBbGfx();
    delete engine_;
    engine_ = 0;
    delete gfxHandler_;
    gfxHandler_ = 0;
  }
}
开发者ID:Voidious,项目名称:BerryBots,代码行数:57,代码来源:guimanager.cpp


示例4: setFont

reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &rect, const Common::String &text, const int16 foreColor, const int16 backColor, const GuiResourceId fontId, const int16 skipColor, const int16 borderColor, const bool dimmed, const bool gc) {
	_borderColor = borderColor;
	_text = text;
	_textRect = rect;
	_foreColor = foreColor;
	_dimmed = dimmed;

	setFont(fontId);

	int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
	int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;

	mulinc(_textRect, Ratio(_xResolution, scriptWidth), Ratio(_yResolution, scriptHeight));

	CelObjView view(celInfo.resourceId, celInfo.loopNo, celInfo.celNo);
	_skipColor = view._skipColor;
	_width = view._width * _xResolution / view._xResolution;
	_height = view._height * _yResolution / view._yResolution;

	Common::Rect bitmapRect(_width, _height);
	if (_textRect.intersects(bitmapRect)) {
		_textRect.clip(bitmapRect);
	} else {
		_textRect = Common::Rect();
	}

	SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _xResolution, _yResolution, 0, false, gc);

	// NOTE: The engine filled the bitmap pixels with 11 here, which is silly
	// because then it just erased the bitmap using the skip color. So we don't
	// fill the bitmap redundantly here.

	_backColor = _skipColor;
	erase(bitmapRect, false);
	_backColor = backColor;

	view.draw(bitmap.getBuffer(), bitmapRect, Common::Point(0, 0), false, Ratio(_xResolution, view._xResolution), Ratio(_yResolution, view._yResolution));

	if (_backColor != skipColor && _foreColor != skipColor) {
		erase(_textRect, false);
	}

	if (text.size() > 0) {
		if (_foreColor == skipColor) {
			error("TODO: Implement transparent text");
		} else {
			if (borderColor != -1) {
				drawFrame(bitmapRect, 1, _borderColor, false);
			}

			drawTextBox();
		}
	}

	return _bitmap;
}
开发者ID:86400,项目名称:scummvm,代码行数:56,代码来源:text32.cpp


示例5: Q_D

void QLCDNumber::paintEvent(QPaintEvent *)
{
    Q_D(QLCDNumber);
    QPainter p(this);
    drawFrame(&p);
    if (d->smallPoint)
        d->drawString(d->digitStr, p, &d->points, false);
    else
        d->drawString(d->digitStr, p, 0, false);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:10,代码来源:qlcdnumber.cpp


示例6: Q_UNUSED

void QgsComposerItemGroup::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget )
{
  Q_UNUSED( option );
  Q_UNUSED( widget );
  drawFrame( painter );
  if ( isSelected() )
  {
    drawSelectionBoxes( painter );
  }
}
开发者ID:CzendaZdenda,项目名称:qgis,代码行数:10,代码来源:qgscomposeritemgroup.cpp


示例7: SDL_GetTicks

void Game::RL()
{
    Ptime = Ctime;
    Ctime = SDL_GetTicks();
    deltatime = Ctime - Ptime;
   if (deltatime > 0.15)
    {deltatime = 0.15;}
        composeFrame();
        drawFrame();
}
开发者ID:GracefulComet,项目名称:Graceful-engine-VS,代码行数:10,代码来源:Game.cpp


示例8: painter

void Digit::paintStatic()
{
    QPainter painter(this);
    painter.fillRect(rect(), Qt::black);
    //Fill the widget rec with black color

    int pad = width() / 10;
    drawFrame(&painter, rect().adjusted(pad, pad, -pad, -pad));
    painter.drawPixmap(0, 0, m_pixmap);
}
开发者ID:Zimuge,项目名称:wfhs,代码行数:10,代码来源:digit.cpp


示例9: drawFrame

void DataRecorderView::draw(QPainter * p)
{
	drawFrame(p);
	
	QFont newFont(QString::fromLatin1("helvetica"),10);
	p->setFont(newFont);
	p->drawText(getDrawingPlace(), AlignCenter, QString::fromLatin1("Data\nRec"));

	CompView::draw(p);
}
开发者ID:BackupTheBerlios,项目名称:ksimus,代码行数:10,代码来源:datarecorderview.cpp


示例10: if

void WindowManager::init_gameLog(bool firstTime)
{	if (firstTime)
		gameLog = newwin(10,101,27,1);
	else {
		wresize(gameLog,10,101);
		wclear(gameLog);
	}
	drawFrame(26,0,37,102);
	scrollok(gameLog,TRUE);
}
开发者ID:case93,项目名称:Chiasmus2,代码行数:10,代码来源:WindowManager.cpp


示例11: drawRectangle

void GfxMgr::drawBox(int x1, int y1, int x2, int y2, int color1, int color2, int m) {
	x1 += m;
	y1 += m;
	x2 -= m;
	y2 -= m;

	drawRectangle(x1, y1, x2, y2, color1);
	drawFrame(x1 + 2, y1 + 2, x2 - 2, y2 - 2, color2, color2);
	flushBlock(x1, y1, x2, y2);
}
开发者ID:fissionchris,项目名称:scummvm,代码行数:10,代码来源:graphics.cpp


示例12: disMnuHed

void cInterface:: disMnuHed(char* hed)
	{
	 drawFrame(right,bottom);
	 fillData(right);
	 disTime(right);
	 moveto(300,72);
	 settextstyle(7,0,3);
	 settextjustify(1,1);
	 setcolor(10);
	 outtext(hed);
	}
开发者ID:kra3,项目名称:Feed-Back-Agent,代码行数:11,代码来源:cui.hpp


示例13: GameOver

void GameOver(Display *d, int *in)
{
  do{
    splashPhoto(d,GOVER_SCREEN);
    drawString(d, fontdata, (char*)"PRESS SPACE TO PLAY AGAIN", 350, 540, white,1);
    drawString(d, fontdata, (char*)"OR ESC TO QUIT", 350, 580, warning,0);
    drawFrame(d,REFRESH_RATE);
    *in=input(d);
  }while(in==0);

}
开发者ID:ProjectElves,项目名称:SoftwareEngineering,代码行数:11,代码来源:game.c


示例14: loop

/* Game play loop */
void  loop(){
  
  if (continueGame){                                                      // If the game is still in play
    drawFrame();                                                          // Draw the frame
    drawScore();                                                          // Draw the score
    movePaddle();                                                         // Update the location of the paddle
    boolean paddleCollision = checkPaddleCollision();                     // Determine if the ball has hit the paddle or block
    boolean blockCollision = checkBlockCollision();
    if(score == numBlocks)                                                // If the score is equivalent to the number of blocks, game is over
      winner();                                                           // Display message to user
    else{                                                                 // The game is still in play
      if(paddleCollision || blockCollision)                               // Redraw screen to draw over any collisions
        drawFrame();
      delay(50);                                                          // Slight delay
      continueGame = updatePos();                                         // Update the position of the ball
    }
  }
  else                                                                    // The game is over, the ball fell off the screen. Display message to user.
    gameOver();
}
开发者ID:benjmyers,项目名称:Ballduino,代码行数:21,代码来源:ballduino.c


示例15: painter

///
/// reimplemented functions
///
void MemChartPrivate::paintEvent(QPaintEvent *e)
{

    QPainter painter(this);
    drawBackground(&painter);
    drawCaption(&painter);
    drawFrame(&painter);
    drawLegend(&painter);
    drawHistogram(&painter);
    drawSelectedRegion(&painter);
}
开发者ID:cocosvsn,项目名称:Memmon,代码行数:14,代码来源:memchart.cpp


示例16: setFont

reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect &rect, const Common::String &text, const uint8 foreColor, const uint8 backColor, const uint8 skipColor, const GuiResourceId fontId, const TextAlign alignment, const int16 borderColor, const bool dimmed, const bool doScaling, reg_t *outBitmapObject) {

	_field_22 = 0;
	_borderColor = borderColor;
	_text = text;
	_textRect = rect;
	_width = width;
	_height = height;
	_foreColor = foreColor;
	_backColor = backColor;
	_skipColor = skipColor;
	_alignment = alignment;
	_dimmed = dimmed;

	setFont(fontId);

	if (doScaling) {
		int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
		int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;

		Ratio scaleX(_scaledWidth, scriptWidth);
		Ratio scaleY(_scaledHeight, scriptHeight);

		_width = (_width * scaleX).toInt();
		_height = (_height * scaleY).toInt();
		mulinc(_textRect, scaleX, scaleY);
	}

	// _textRect represents where text is drawn inside the
	// bitmap; clipRect is the entire bitmap
	Common::Rect bitmapRect(_width, _height);

	if (_textRect.intersects(bitmapRect)) {
		_textRect.clip(bitmapRect);
	} else {
		_textRect = Common::Rect();
	}

	_bitmap = _segMan->allocateHunkEntry("FontBitmap()", _width * _height + BITMAP_HEADER_SIZE);

	byte *bitmap = _segMan->getHunkPointer(_bitmap);
	buildBitmapHeader(bitmap, _width, _height, _skipColor, 0, 0, _scaledWidth, _scaledHeight, 0, false);

	erase(bitmapRect, false);

	if (_borderColor > -1) {
		drawFrame(bitmapRect, 1, _borderColor, false);
	}

	drawTextBox();

	*outBitmapObject = _bitmap;
	return _bitmap;
}
开发者ID:MisturDust319,项目名称:scummvm,代码行数:54,代码来源:text32.cpp


示例17: QImage

void QgsComposerPicture::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
{
  if ( !painter )
  {
    return;
  }

  if ( mMode == SVG )
  {
    int newDpi = ( painter->device()->logicalDpiX() + painter->device()->logicalDpiY() ) / 2;
    if ( newDpi != mCachedDpi )
    {
      mSvgCacheUpToDate = false;
      mCachedDpi = newDpi;
      mImage = QImage( rect().width() * newDpi / 25.4, rect().height() * newDpi / 25.4, QImage::Format_ARGB32 );
    }

    if ( !mSvgCacheUpToDate )
    {
      updateImageFromSvg();
    }
  }

  painter->save();
  painter->rotate( mRotation );
  drawBackground( painter );

  if ( mMode != Unknown )
  {
    double widthRatio = mImage.width() / rect().width();
    double heightRatio = mImage.height() / rect().height();
    double targetWidth, targetHeight;
    if ( widthRatio > heightRatio )
    {
      targetWidth = rect().width();
      targetHeight = mImage.height() / widthRatio;
    }
    else
    {
      targetHeight = rect().height();
      targetWidth = mImage.width() / heightRatio;
    }
    painter->drawImage( QRectF( 0, 0, targetWidth, targetHeight ), mImage, QRectF( 0, 0, mImage.width(), mImage.height() ) );
  }

  //frame and selection boxes
  drawFrame( painter );
  if ( isSelected() )
  {
    drawSelectionBoxes( painter );
  }

  painter->restore();
}
开发者ID:HydroCouple,项目名称:FVHMComponent,代码行数:54,代码来源:qgscomposerpicture.cpp


示例18: setContentSize

bool UiEditorPanel::init()
{
	auto winSize = CCDirector::sharedDirector()->getWinSize();
	setContentSize(winSize);

	drawFrame();
	addChild(UiEditorBtnsPanel::create());
	addChild(UiEditorAttrsPanel::create());
	//scheduleUpdate();
	return true;
}
开发者ID:SeedAsh,项目名称:UiEditor,代码行数:11,代码来源:UiEditorPanel.cpp


示例19: vec4

void ZoneScene::draw()
{
    Zone *zone = m_game->zone();
    vec4 clearColor = zone ? zone->info().fogColor : vec4(0.4, 0.4, 0.6, 0.1);
    if(m_renderCtx->beginFrame(clearColor))
    {
        clearLog();
        drawFrame();
    }
    m_renderCtx->endFrame();
}
开发者ID:pixelbound,项目名称:equilibre,代码行数:11,代码来源:ZoneViewerWindow.cpp


示例20: Q_UNUSED

void QgsComposerLabel::paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
{
  Q_UNUSED( itemStyle );
  Q_UNUSED( pWidget );
  if ( !painter )
  {
    return;
  }
  if ( !shouldDrawItem() )
  {
    return;
  }

  drawBackground( painter );
  painter->save();

  //antialiasing on
  painter->setRenderHint( QPainter::Antialiasing, true );

  double penWidth = hasFrame() ? ( pen().widthF() / 2.0 ) : 0;
  double xPenAdjust = mMarginX < 0 ? -penWidth : penWidth;
  double yPenAdjust = mMarginY < 0 ? -penWidth : penWidth;
  QRectF painterRect( xPenAdjust + mMarginX, yPenAdjust + mMarginY, rect().width() - 2 * xPenAdjust - 2 * mMarginX, rect().height() - 2 * yPenAdjust - 2 * mMarginY );

  if ( mHtmlState )
  {
    if ( mFirstRender )
    {
      contentChanged();
      mFirstRender = false;
    }
    painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 );
    mWebPage->setViewportSize( QSize( painterRect.width() * mHtmlUnitsToMM * 10.0, painterRect.height() * mHtmlUnitsToMM * 10.0 ) );
    mWebPage->settings()->setUserStyleSheetUrl( createStylesheetUrl() );
    mWebPage->mainFrame()->render( painter );
  }
  else
  {
    const QString textToDraw = displayText();
    painter->setFont( mFont );
    //debug
    //painter->setPen( QColor( Qt::red ) );
    //painter->drawRect( painterRect );
    QgsComposerUtils::drawText( painter, painterRect, textToDraw, mFont, mFontColor, mHAlignment, mVAlignment, Qt::TextWordWrap );
  }

  painter->restore();

  drawFrame( painter );
  if ( isSelected() )
  {
    drawSelectionBoxes( painter );
  }
}
开发者ID:ndavid,项目名称:QGIS,代码行数:54,代码来源:qgscomposerlabel.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ drawGrid函数代码示例发布时间:2022-05-30
下一篇:
C++ drawEllipse函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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