本文整理汇总了C++中drawCursor函数的典型用法代码示例。如果您正苦于以下问题:C++ drawCursor函数的具体用法?C++ drawCursor怎么用?C++ drawCursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawCursor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ofTranslate
//--------------------------------------------------------------
void ofxFileDialog::drawNewFolder() {
bool drawnCursor = false;
int x = 0, y = s_charHeight;
s_font->setColor(m_settings->getTextColor(), m_settings->getAlpha());
s_font->setShadowColor(m_settings->getTextShadowColor(), m_settings->getAlpha());
ofTranslate(0, m_visibleLines*0.5*s_charHeight);
// info text
s_font->drawString(s_newFolderText, x, y, s_textShadow);
// new folder name with cursor
y += s_charHeight*2;
for(unsigned int i = 0; i < m_text.size(); ++i) {
// draw cursor
if(m_saveAsState == FILENAME && i == m_position) {
drawCursor(x, y);
drawnCursor = true;
}
// text
x = s_font->drawCharacter(m_text[i], x, y, s_textShadow);
}
// draw cursor if we have no text, or if we're at the end of the buffer
if(!drawnCursor) {
drawCursor(x, y);
}
}
开发者ID:Akira-Hayasaka,项目名称:ofxGLEditor,代码行数:32,代码来源:ofxFileDialog.cpp
示例2: drawNewFolder
//--------------------------------------------------------------
void ofxFileDialog::drawSaveAs() {
bool drawnCursor = false;
int x = 0, y = s_charHeight;
s_font->setColor(m_settings->getTextColor(), m_settings->getAlpha());
s_font->setShadowColor(m_settings->getTextShadowColor(), m_settings->getAlpha());
if(m_saveAsState == FOLDER_DIALOG) {
drawNewFolder();
}
else {
ofPushMatrix();
ofTranslate(0, s_charHeight*2);
// info text
s_font->drawString(s_saveAsText, x, y, s_textShadow);
// new file name with cursor
y += s_charHeight*2;
for(unsigned int i = 0; i < m_text.size(); ++i) {
// draw cursor
if(m_saveAsState == FILENAME && i == m_position) {
drawCursor(x, y);
drawnCursor = true;
}
// text
x = s_font->drawCharacter(m_text[i], x, y, s_textShadow);
}
// draw cursor if we have no text, or if we're at the end of the buffer
if(m_saveAsState == FILENAME && !drawnCursor) {
drawCursor(x, y);
}
drawFilenames(5, 2, m_saveAsState == BROWSER);
ofPopMatrix();
y = m_height-s_charHeight;
if(m_saveAsState == FOLDER) {
int width = s_font->stringWidth(s_newFolderButtonText);
ofSetColor(m_settings->getCursorColor().r, m_settings->getCursorColor().g,
m_settings->getCursorColor().b, m_settings->getCursorColor().a * m_settings->getAlpha());
ofRectMode rectMode = ofGetRectMode();
ofSetRectMode(OF_RECTMODE_CORNER);
ofDrawRectangle(x, y-s_charWidth, width, s_charHeight);
ofSetRectMode(rectMode);
}
s_font->drawString(s_newFolderButtonText, 0, y, s_textShadow);
}
}
开发者ID:Akira-Hayasaka,项目名称:ofxGLEditor,代码行数:53,代码来源:ofxFileDialog.cpp
示例3: shape
void UBGraphicsCompass::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
{
if (UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Selector &&
UBDrawingController::drawingController ()->stylusTool() != UBStylusTool::Play)
return;
mShowButtons = shape().contains(event->pos());
mCloseSvgItem->setVisible(mShowButtons);
mResizeSvgItem->setVisible(mShowButtons);
if (mShowButtons)
{
if (hingeRect().contains(event->pos()))
setCursor(rotateCursor());
else if (event->pos().x() > rect().right() - sPencilLength - sPencilBaseLength)
setCursor(drawCursor());
else if (resizeButtonRect().contains(event->pos()))
setCursor(resizeCursor());
else if (closeButtonRect().contains(event->pos()))
setCursor(closeCursor());
else
setCursor(moveCursor());
}
else
{
setCursor(mOuterCursor);
}
event->accept();
update();
}
开发者ID:KubaO,项目名称:Sankore-3.1,代码行数:29,代码来源:UBGraphicsCompass.cpp
示例4: glBindTexture
void TextBox::redrawSelf()
{
if (!keyFocus)
isHighlighted = false;
glBindTexture(GL_TEXTURE_2D, 0);
glColor4ub(30, 30, 30, 100);
glBegin(GL_QUADS);
glVertex2f(x, y);
glVertex2f(x+width, y);
glVertex2f(x+width, y+height);
glVertex2f(x, y+height);
glEnd();
if (isHighlighted)
drawHighlight();
drawOutline();
screenPrintf(x, y, *textParams, text.c_str());
if (keyFocus)
drawCursor();
}
开发者ID:yixu34,项目名称:RefuseRobots,代码行数:25,代码来源:textbox.cpp
示例5: displayPreGame
void displayPreGame() {
glLoadIdentity();
drawPreGameBack();
drawText();
drawCursor();
curtain.drawCurtain();
}
开发者ID:JUSTIVE,项目名称:ballRollPool,代码行数:7,代码来源:pregame.cpp
示例6: ofPushStyle
void mgsCooperSymbols::drawGrid(float x, float y) {
ofPushStyle();
clearCell(shiftCounter-1,rowCounter,gw+2,gh);
drawCursor();
ofSetColor(symbolColor);
ofNoFill();
if(randomStrokeP) randomStroke();
if (!singleShapesP) {
switch((int)ofRandom(1, numberOfShapes+1)) {
case 1:
drawSquare(x+shiftCounter, y+rowCounter, gw);
break;
case 2:
drawTri(x+shiftCounter, y+rowCounter, gw);
break;
case 3:
drawCircle(x+shiftCounter+gw/2, y+rowCounter+gh/2, gw/2);
break;
}
} else {
switch(numberOfShapes) {
case 1:
drawSquare(x+shiftCounter, y+rowCounter, gw);
break;
case 2:
drawTri(x+shiftCounter, y+rowCounter, gw);
break;
case 3:
drawCircle(x+shiftCounter+gw/2, y+rowCounter+gw/2, gw/2);
break;
}
}
ofPopStyle();
}
开发者ID:ioros,项目名称:dayForNightSFPC,代码行数:34,代码来源:mgsCooperSymbols.cpp
示例7: drawCells
void drawCells() {
uchar x,y;
for(y=0; y<9; y++)
for(x=0; x<9; x++)
drawCell(x,y);
drawCursor();
}
开发者ID:VWarlock,项目名称:OldLines,代码行数:7,代码来源:lines.c
示例8: drawGraphics
// Draw the cursor and the cube. In a real application,
// this function would be much more complex.
void drawGraphics()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
drawCursor();
glutSolidCube(gCubeEdgeLength);
}
开发者ID:aphill70,项目名称:Capstone-Winter--12,代码行数:9,代码来源:main_opengl.cpp
示例9: drawGame
void drawGame(void)
{
if (state == STATE_LEAVE) return;
if (isInvalid) {
arduboy.clear();
if (state == STATE_ISSUES) {
drawIssues();
} else if (state == STATE_RESULT) {
drawResult();
} else {
drawField();
if (state == STATE_PLAYING) {
drawStrings();
drawCursor();
}
if (blinkFrameFrames > 0 && blinkFlg) arduboy.drawRect(0, 0, WIDTH, HEIGHT, WHITE);
}
isInvalid = false;
}
if (state == STATE_MENU || state == STATE_RESULT) {
drawMenuItems(false);
arduboy.setRGBled(0, 0, 0);
} else {
if (state == STATE_OVER) drawOverAnimation();
arduboy.setRGBled(ledRGB[0] * vanishFlashFrames, ledRGB[1] * vanishFlashFrames,
ledRGB[2] * vanishFlashFrames);
}
}
开发者ID:obono,项目名称:ArduboyWorks,代码行数:28,代码来源:game.cpp
示例10: render
void render()
{
if (NULL != pd3dDevice)
{
pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_XRGB(0, 0, 0),
1.0f, 0);
pd3dDevice->BeginScene();
// create the camera
createCamera(0.1f, 10.0f); // near clip plane, far clip plane
// Position camera so cube is same projected size as in OpenGL version
moveCamera(D3DXVECTOR3(0.0f, 0.0f, -1.6f));
pointCamera(D3DXVECTOR3(0.0f, 0.0f, 0.0f));
// draw the objects
drawCube();
drawCursor();
pd3dDevice->EndScene();
pd3dDevice->Present(NULL, NULL, NULL, NULL);
}
}
开发者ID:Codibri,项目名称:HardrockHoliday,代码行数:25,代码来源:main_dx9.cpp
示例11: drawPuzzle
void drawPuzzle(void)
{
bool isPlaying = (state == STATE_FREE || state == STATE_PICKED);
if (toDrawAll) {
arduboy.clear();
drawBoard(0);
drawPieces();
toDrawAll = false;
} else if (isPlaying && focusPieceIdx >= 0) {
drawPiece(focusPieceIdx);
}
if (state == STATE_FREE) {
drawCursor();
}
if (state == STATE_CLEAR) {
drawClearEffect();
}
if (isHelpVisible && isPlaying) {
HELP_T idx;
if (state == STATE_FREE) {
idx = HELP_FREE;
} else {
idx = (arduboy.buttonPressed(A_BUTTON)) ? HELP_HOLD : HELP_PICK;
}
drawHelp(idx, helpX, helpY);
}
}
开发者ID:obono,项目名称:ArduboyWorks,代码行数:28,代码来源:puzzle.cpp
示例12: gameStep
void gameStep() {
uchar nx1,ny1,nx2,ny2,o;
// Ищем готовые линии
if(!check()) {
// Добавляем три шарика
newBall(newBall1); nx1=nx; ny1=ny;
newBall(newBall2); nx2=nx; ny2=ny;
newBall(newBall3);
// Рисуем анимацию
for(o=0; o<5; o++) {
if(nx1!=-1) drawSpriteNew(nx1, ny1, newBall1, o);
if(nx2!=-1) drawSpriteNew(nx2, ny2, newBall2, o);
if(nx !=-1) drawSpriteNew(nx, ny, newBall3, o);
delay(ANIMATION_SPEED);
}
// Загадываем три новых шарика
randNewBall();
redrawNewBalls1();
if(!gameOver) {
// Ищем готовые линии
check();
// Считаем кол во свободных клеток
if(calcFreeCell()==0) gameOver=1;
}
}
drawCursor();
}
开发者ID:VWarlock,项目名称:OldLines,代码行数:34,代码来源:lines.c
示例13: drawStatusLine
void TextEdit::onExpose(XEvent& /* event */)
{
// Draw a status line
drawStatusLine();
// Erase a window
setForeground(bgColor);
fillRectangle(I2Rectangle(0, topMargin - statusLineMargin, m_IWinRect.width(), m_IWinRect.height()));
// Draw a text in a window
setForeground(fgColor);
int x = leftMargin;
int y = topMargin + ascent;
for (int screenY = 0; screenY < windowHeight; screenY++, y += dy)
{
int textY = windowY + screenY;
const TextLine* currentLine;
if (textY > text.size()) { break; }
else if (textY == text.size()) { currentLine = &(endOfText); }
else { currentLine = &(text.getLine(textY)); }
int len = currentLine->length();
if (len > windowX)
{
int restrictedLen = len - windowX;
if (restrictedLen > windowWidth) restrictedLen = windowWidth;
drawString(x, y, currentLine->getString() + windowX, restrictedLen);
}
}
// Draw cursor
if (!inputDisabled) { drawCursor(cursorX, cursorY, true); }
}
开发者ID:tokar1,项目名称:mech-math,代码行数:32,代码来源:TextEdit.cpp
示例14: while
void BleWindowsCaptureSource::run()
{
// TODO make could select screen
// QGuiApplication::screens();
while (!m_stop) {
QElapsedTimer elapsedTimer;
elapsedTimer.start();
QScreen *screen = QGuiApplication::primaryScreen();
if (screen) {
QPixmap pixmap = screen->grabWindow(m_wid, m_x, m_y, m_width, m_height);
#if 1
// TODO to draw cursor to image
QRect desktopRect = QRect(QPoint(0, 0), screen->size());
if (desktopRect.contains(QCursor::pos())) {
drawCursor(&pixmap);
}
#endif
QImage image = pixmap.toImage();
m_modifyMutex.lock(); // Start lock
BleImage be;
be.width = image.width();
be.height = image.height();
int imageSize = be.width * be.height * 3;
be.data = new char[imageSize];
IplImage *oriImage = cvCreateImageHeader(cvSize(image.width(), image.height()), IPL_DEPTH_8U, 4);
cvSetData(oriImage, image.bits(), image.bytesPerLine());
IplImage *dstImage = cvCreateImageHeader(cvSize(image.width(), image.height()), IPL_DEPTH_8U, 3);
cvSetData(dstImage, be.data, be.width * 3);
cvCvtColor(oriImage, dstImage, CV_BGRA2BGR);
be.dataSize = imageSize;
be.format = BleImage_Format_BGR24;
m_image = be;
cvReleaseImageHeader(&oriImage);
cvReleaseImageHeader(&dstImage);
m_modifyMutex.unlock(); // End unlock
}
int elapsedMs = elapsedTimer.elapsed();
int needSleepMs = m_interval - elapsedMs;
if (needSleepMs < 0) {
needSleepMs = 0;
}
msleep(needSleepMs);
}
log_trace("BleWindowsCaptureSource exit normally.");
}
开发者ID:JaydenChou,项目名称:Bull-Live-Encoder,代码行数:59,代码来源:BleWindowsCaptureSource.cpp
示例15: drawCursor
void eTextInputField::updated()
{
if ( editLabel )
editLabel->setText(convertDVBUTF8((unsigned char*)isotext.c_str(),isotext.length(), table));
else
text=convertDVBUTF8((unsigned char*)isotext.c_str(),isotext.length(), table);
drawCursor();
}
开发者ID:OpenDMM,项目名称:tuxbox-apps,代码行数:8,代码来源:textinput.cpp
示例16: drawCursor
void NYView::guiPaintEvent(const YSelection& drawMap)
{
if(!editor) { // Avoid segfaults and infinite recursion.
return ;
}
YView::guiPaintEvent(drawMap);
drawCursor();
}
开发者ID:sandsmark,项目名称:yzis,代码行数:9,代码来源:nyview.cpp
示例17: setText
void eTextInputField::setState(int enable, int cancel)
{
nextCharTimer.stop();
if (!enable)
{
editLabel->hide();
if (!cancel)
setText(editLabel->getText());
else
setText(oldText);
delete editLabel;
editLabel=0;
setHelpText(oldHelpText);
while ( text.length() && text[text.length()-1] == ' ' )
text.erase( text.length()-1 );
editMode=false;
if (!cancel)
/* emit */ selected();
eRCInput::getInstance()->setKeyboardMode(eRCInput::kmNone);
eWindow::globalCancel(eWindow::ON);
}
else
{
oldText=text;
editMode=true;
/* emit */ selected();
capslock=0;
while(scroll.size())
scroll.pop();
eRect tmp = deco_selected?crect_selected:deco?crect:clientrect;
editLabel=new eLabel(this,0,0);
editLabel->hide();
editLabel->move(tmp.topLeft());
scroll.push( std::pair<int,int>(0,tmp.width()) );
eSize tmpSize=tmp.size();
tmpSize.setWidth( tmp.width()*5 );
editLabel->resize(tmpSize);
editLabel->setText(text.removeChars('\x86').
removeChars('\x87').removeChars('\xC2').
removeChars('\x05'));
oldHelpText=helptext;
setText("");
editLabel->show();
setHelpText(editHelpText);
curPos=0;
drawCursor();
eRCInput::getInstance()->setKeyboardMode(eRCInput::kmAscii);
eWindow::globalCancel(eWindow::OFF);
}
}
开发者ID:OpenDMM,项目名称:tuxbox-apps,代码行数:56,代码来源:textinput.cpp
示例18: setupDisplay
void
UIManager::draw()
{
setupDisplay();
std::list<pp::Widget*>::iterator it;
for(it=widgets.begin();it!=widgets.end();it++){
(*it)->draw();
}
drawCursor();
}
开发者ID:gonium,项目名称:fc-extremetuxracer,代码行数:10,代码来源:ui_mgr.cpp
示例19: drawSceneGraphics
/*******************************************************************************
The main routine for displaying the scene. Gets the latest snapshot of state
from the haptic thread and uses it for displaying a 3D cursor. Draws the
anchor visual if the anchor is presently active.
*******************************************************************************/
void drawSceneGraphics()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
drawCursor();
drawSphere();
drawTorus();
drawTeapot();
}
开发者ID:danepowell,项目名称:openhaptics,代码行数:15,代码来源:Events.cpp
示例20: refleshBuffer
void My3DCursor::cc3dDrawInSP(const CGPoint &minus, const float &scale)
{
refleshBuffer();
for (int n = 0; n < 6; n++)
{
drawBufferPoint[n] -= minus;
drawBufferPoint[n] /= scale;
}
drawCursor();
}
开发者ID:geniikw,项目名称:myFirst2DGame,代码行数:10,代码来源:My3DCursor.cpp
注:本文中的drawCursor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论