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


C++ DrawCursor函数代码示例

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


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

示例1: DrawCursorPos

/**
* @brief 绘制指定位置的光标
* 
* 如果光标不在指定位置,则不会绘制
*/
void DrawCursorPos(struct ChessBoard *cp, struct ChessPos pos)
{
    struct ChessPos *cursor;

    //绘制光标
    //仅在游戏正常进行时绘制
    if (cp->gameState == GSTAT_ACTIVE)
    {
        cursor = ActiveCursor(cp);

        if (MatchPos(*cursor, pos.line, pos.row))
        {
            DrawCursor(*cursor, cp->activePlayer);
        }

        if (cp->chessLocked)
        {
            cursor = &cp->lockedCursor;

            if (MatchPos(*cursor, pos.line, pos.row))
            {
                //棋子锁定光标是两玩家共用的
                DrawCursor(*cursor, PLY_BOTH);
            }
        }
    }
}
开发者ID:SwimmingTiger,项目名称:ChineseChess,代码行数:32,代码来源:graphics.cpp

示例2: DrawCursor

// Renders the buffer to the screen.
void CConsole::DrawBuffer(CTextRenderer& textRenderer)
{
	if (m_fHeight < m_iFontHeight)
		return;

	CMatrix3D savedTransform = textRenderer.GetTransform();

	textRenderer.Translate(2.0f, m_fHeight - (float)m_iFontOffset + 1.0f, 0.0f);

	textRenderer.Color(1.0f, 1.0f, 0.0f);
	textRenderer.PutAdvance(L"]");

	textRenderer.Color(1.0f, 1.0f, 1.0f);

	if (m_iBufferPos == 0)
		DrawCursor(textRenderer);

	for (int i = 0; i < m_iBufferLength; i++)
	{
		textRenderer.PrintfAdvance(L"%lc", m_szBuffer[i]);
		if (m_iBufferPos-1 == i)
			DrawCursor(textRenderer);
	}

	textRenderer.SetTransform(savedTransform);
}
开发者ID:2asoft,项目名称:0ad,代码行数:27,代码来源:CConsole.cpp

示例3: DrawCursor

void GraphView::CurrentProbeChanged(Draw *draw, int pi, int ni, int d) {

	wxRegion reg;

	DrawCursor(pi, true, &reg);

	int i = d;
	if (i)
		i = i > 0 ? -1 : 1;

	if (m_draw->GetDoubleCursor() && ni >= 0) {
		int vd = m_draw->GetValuesTable().size();

		int s, e;

		if (d >= 0) {
			s = std::max(0, ni - d);
			e = ni;
		} else {
			s = ni;
			e = std::min(vd - 1, ni - d);
		}

		for (int i = s; i <= e; ++i) 
			DrawPoint(i, &reg, false);
	}

	DrawCursor(ni, false, &reg);

	m_graphs->UpdateArea(reg);

}
开发者ID:cyclefusion,项目名称:szarp,代码行数:32,代码来源:drawview.cpp

示例4: GetDocument

void
MFCSequenceEditor::OnDraw(CDC* pdc)
{
	CRect	clipBox;
	int		cbType;
	cbType = pdc->GetClipBox(&clipBox);
//	fprintf(stderr, "OnDraw() clip (%d %d %d %d) type %s\n", clipBox.left, clipBox.top, clipBox.right, clipBox.bottom, cbType==COMPLEXREGION?"complex":cbType==SIMPLEREGION?"simple":cbType==NULLREGION?"null":"error");
//	fprintf(stderr, "lt %d\n", lastScheduledEvent.ticks);
	CDocument* pDoc = GetDocument();
#ifdef QUA_V_GDI_PLUS
	Graphics	graphics(pdc->m_hDC);
	DrawGridGraphics(graphics, clipBox);

// test the interoperation of GDI and GDI+
//	Color	p = Color::MakeARGB(100, 255, 20, 255);
//	Pen	semip(p, 3);
//	graphics.DrawLine(&semip, 0,0, 200, 200);
//	for (short i=0; i<NIR(); i++) {
//		MFCInstanceView *ir = (MFCInstanceView *)IR(i);
//		if (ir->bounds.Intersects(clipBox)) {
//			ir->Draw(&graphics, &clipBox);
//		}
//	}
	DrawCursor(graphics, clipBox);
#else
	DrawGrid(pdc, &clipBox);
	DrawCursor(pdc, &clipBox);
#endif
//	fprintf(stderr, "OnDraw() finito\n");
}
开发者ID:dakyri,项目名称:qua,代码行数:30,代码来源:MFCDataEditor.cpp

示例5: DrawCursor

void
ViewBuffer::MoveCursor(int32 x, int32 y)
{
	DrawCursor(fCursorX, fCursorY);
	DrawCursor(x, y);
	
	fCursorX = x;
	fCursorY = y;
}
开发者ID:mmanley,项目名称:Antares,代码行数:9,代码来源:ViewBuffer.cpp

示例6: scare_mouse

void CGame::PlayTurn() {

	int x,y;

	scare_mouse();
	DrawBoard();
	DrawPlayer();
	DrawScores();
	DrawCursor();

	blit(background, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
	unscare_mouse();

	while (!players[currplayer].Done()) {

		if (mouse_b & 1) {

			x = mouse_x;
			y = mouse_y;
			players[currplayer].HandleMouse(x,y);
			rest (200); //rest for a bit so it doesnt keep catching mouse clicks
			
			scare_mouse();
			DrawBoard();
			DrawScores(); //shouldnt have to redraw this, but i dont have time to do a decent redraw management system
			if (!players[currplayer].Done())
				DrawPlayer(); //only redraw if not at end of turn
			DrawCursor();
	
			blit(background, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
			unscare_mouse();
		}

		
	}//end while

	players[currplayer].ResetTurnComplete();
		

	//update currplayer

	int oldcurrplayer;
	oldcurrplayer = currplayer;

	do {
		if (currplayer == (numplayers-1)) {  //if currplayer is last in line
			currplayer = 0;
		}
		else {
			currplayer++;
		}

	//stop increment currplayer if the curr isnt playing AND we have gone through the whole list already
	} while (!players[currplayer].stillplaying && currplayer != oldcurrplayer);


}
开发者ID:Josh-Stewart,项目名称:Scarbble,代码行数:57,代码来源:game.cpp

示例7: DrawCursor

void					
BF_GUI_ColorView::MouseDown(BPoint point)
{
	if(point.x>255) return;
	DrawCursor(false);
	*piColor = (uint8)point.x;	
	DrawCursor(true);
	
	poUnit->Draw(poUnit->Bounds());
}
开发者ID:mmadia,项目名称:befar-svn_clone,代码行数:10,代码来源:BF_GUI_SetupDialog.cpp

示例8: EraseCursor

/*-----------------------------------------------------------------*/
void __fastcall TChoosePaletteForm::SelectColor (COLORREF _color)
{
    EraseCursor();
    for (int i=0; i<MAX_PAL_ENTRY; i++)
        if (_color==Data->palette->GetColor(i)) {
            index = i;
            DrawCursor();
            return;
        }
    index = 0;
    DrawCursor();
}
开发者ID:damianbrunold,项目名称:dbweave,代码行数:13,代码来源:farbauswahl2_form.cpp

示例9: UpdateDisplay

/**
**  Display update.
**
**  This functions updates everything on screen. The map, the gui, the
**  cursors.
*/
void UpdateDisplay()
{
	if (GameRunning || Editor.Running == EditorEditing) {
		DrawMapArea();
		DrawMessages();

		if (CursorState == CursorStateRectangle) {
			DrawCursor();
		}

		if ((Preference.BigScreen && !BigMapMode) || (!Preference.BigScreen && BigMapMode)) {
			UiToggleBigMap();
		}

		if (!BigMapMode) {
			for (size_t i = 0; i < UI.Fillers.size(); ++i) {
				UI.Fillers[i].G->DrawSubClip(0, 0,
											 UI.Fillers[i].G->Width,
											 UI.Fillers[i].G->Height,
											 UI.Fillers[i].X, UI.Fillers[i].Y);
			}
			DrawMenuButtonArea();
			DrawUserDefinedButtons();

			UI.Minimap.Draw();
			UI.Minimap.DrawViewportArea(*UI.SelectedViewport);

			UI.InfoPanel.Draw();
			DrawResources();
			UI.StatusLine.Draw();
			UI.StatusLine.DrawCosts();
			UI.ButtonPanel.Draw();
		}

		DrawTimer();
	}

	DrawPieMenu(); // draw pie menu only if needed

	DrawGuichanWidgets();

	if (CursorState != CursorStateRectangle) {
		DrawCursor();
	}

	//
	// Update changes to display.
	//
	Invalidate();
}
开发者ID:Clemenshemmerling,项目名称:Stratagus,代码行数:56,代码来源:mainloop.cpp

示例10: DrawGrid

void Game::ComposeFrame()
{
	const int baseX = 100;
	const int baseY = 100;

	if( CheckForVictory() == EMPTY )
	{
		DrawGrid( baseX, baseY );

		DoUserInput();
		DrawCursor( cursorX, cursorY );
	}
	else {
		DrawGrid( baseX, baseY );

		if( CheckForVictory() == X ){
			winR = 255;
		}
		else {
			winB = 255;
		}

		gfx.DrawLine( winX1 + 50, winY1 + 140, winX2 + 50, winY2 + 140, winR, 0, winB );
	}

	
}
开发者ID:kylepollina,项目名称:Connect-Four,代码行数:27,代码来源:Game.cpp

示例11: SetHighColor

void
BF_GUI_ColorView::Draw(BRect o_Rect)
{
	// fill back //
	SetHighColor(SYS_COLOR(BF_COLOR_DIALOG_BACK));
	BRect oRect(Bounds());	
	FillRect(oRect);		
	
	// draw lines //
	BPoint oPointTop(0,4),oPointBottom(0,oRect.Height()-4);
	rgb_color oCol;
	RGB_SET(oCol,0,0,0);
	for(int32 i=0;i<256;i++){	
		SetHighColor(oCol);
		
		StrokeLine(oPointTop,oPointBottom);
		
		oPointTop.x++;
		oPointBottom.x++;

		if(iColorIndex==0) oCol.red++;else
		if(iColorIndex==1) oCol.green++;else
		if(iColorIndex==2) oCol.blue++;
	}
	DrawCursor(true);
}
开发者ID:mmadia,项目名称:befar-svn_clone,代码行数:26,代码来源:BF_GUI_SetupDialog.cpp

示例12: dc

void PageSettingsTabs1::SetCursor(void)
{
  CRect rectCursorAnim;
  m_staticCursorAnim.GetClientRect(&rectCursorAnim);
  CClientDC dc(m_staticCursorAnim.m_hWnd);
  CBrush brush(::CreateSolidBrush(RGB(0,0,0)));
  dc.FillRect(rectCursorAnim, brush);

  rectCursorAnim.right  -= 12;
  rectCursorAnim.right  /= 2;
  rectCursorAnim.bottom -= 8;

  m_cursor.reset();
  m_cursor = CursorFactory::CreateCursor(
    m_hWnd,
    true,
    static_cast<CursorStyle>(m_comboCursor.GetCurSel()),
    dc,
    rectCursorAnim,
    m_tabData->crCursorColor,
    this,
    true);

  DrawCursor();
}
开发者ID:kevbui,项目名称:console,代码行数:25,代码来源:PageSettingsTabs1.cpp

示例13: RegistLoop

void RegistLoop (double timestep ){
	int ww = param.x_resolution;
	int hh = param.y_resolution;
	Music.Update ();    
	check_gl_error();
    ClearRenderContext ();
    set_gl_options (GUI);
    SetupGuiDisplay ();
	TColor col;
		
	update_ui_snow (timestep);
	draw_ui_snow();

	Tex.Draw (BOTTOM_LEFT, 0, hh - 256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), scale);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top, 
//			0, colMBackgr, col, 0.2);

	FT.AutoSizeN (3);
	FT.SetColor (colWhite);
	int top = AutoYPosN (24);
	FT.DrawString (area.left, top, "Select your player name:");
	FT.DrawString (area.left + framewidth + arrowwidth, top, "Select a character:");

	FT.AutoSizeN (4);
	if (curr_focus == 0) col = colDYell; else col = colWhite;
	DrawFrameX (area.left, area.top, framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (col);
	FT.DrawString (area.left + 20, area.top, Players.GetName (curr_player));
	Tex.DrawDirectFrame (Players.GetAvatarID (curr_player), 
		area.left + 60, AutoYPosN (40), texsize, texsize, 3, colWhite);

	if (curr_focus == 1) col = colDYell; else col = colWhite;
	DrawFrameX (area.left + framewidth + arrowwidth, area.top, 
		framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (col);
	FT.DrawString (area.left + framewidth + arrowwidth + 20, 
		area.top, CharList[curr_character].name);
	Tex.DrawDirectFrame (CharList[curr_character].preview, 
		area.right - texsize - 60 - arrowwidth, 
		AutoYPosN (40), texsize, texsize, 3, colWhite);


	FT.SetColor (colWhite);
	PrintArrow (0, (curr_player > 0));	

	PrintArrow (1, (curr_player < last_player));
	PrintArrow (2, (curr_character > 0));	
	PrintArrow (3, (curr_character < last_character));

	PrintTextButton (0, curr_focus);
	PrintTextButton (1, curr_focus);

	if (param.ice_cursor) DrawCursor ();
    Winsys.SwapBuffers();
} 
开发者ID:cdlewis,项目名称:extremetuxracer,代码行数:60,代码来源:regist.cpp

示例14: dbw3_assert

/*-----------------------------------------------------------------*/
void __fastcall CrFeld::EnableCursor()
{
    dbw3_assert(frm);
    dbw3_assert(frm->CursorTimer);
    DrawCursor();
    frm->CursorTimer->Enabled = true;
}
开发者ID:damianbrunold,项目名称:dbweave,代码行数:8,代码来源:cursor.cpp

示例15: DrawAnyCursor

/**
**	Draw the cursor and prepare tobe restored by HideAnyCursor again.
**      Note: This function can be called, without calling HideAnyCursor first,
**            which means that this function should re-use/free memory of the
**            last call.
**            When calling multiple times, the old cursor is expected to be
**            overdrawn by something else (else HideAnyCursor is needed!)
**            Also the cursors are not invalidated (refresh on real screen)
**            here, but this is done by InvalidateCursorAreas.
**
**  FIXME: event handler should be temporary stopped while copying
**         CursorX,CursorY,.. because between two copy commands another
**         event can occure, which let invalid mouse position be delivered.
*/
global void DrawAnyCursor(void)
{
    // Disable any previous drawn cursor
    OldCursorInvalidate=OldCursorW=
	OldCursorRectangleInvalidate=OldCursorRectangleW=
	BuildingCursor=0;

    //
    //	First, Selecting rectangle
    //
    if( CursorState==CursorStateRectangle
	     && (CursorStartX!=CursorX || CursorStartY!=CursorY) ) {
	DrawVisibleRectangleCursor(CursorStartX,CursorStartY,CursorX,CursorY);
    }
    //
    //	Or Selecting position for building
    //
    else if( CursorBuilding && CursorOn==CursorOnMap ) {
	DrawBuildingCursor();
	BuildingCursor=1;
    }

    //
    //	Last, Normal cursor.
    //  This will also save (part of) drawn rectangle cursor, but that's ok.
    //
    DrawCursor(GameCursor,CursorX,CursorY,GameCursor->SpriteFrame);
}
开发者ID:saniv,项目名称:freecraft-ale-clone,代码行数:42,代码来源:cursor.c


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