示例#1
0
void drawStimuli(void) {
	//The CX_SlidePresenter is an abstraction that is responsible for displaying visual stimuli for specified durations.
	//One called SlidePresenter is instanstiated for you, but you can create more if you want.
	SlidePresenter.clearSlides(); //Start by clearing all slides (from the last trial).

	//To draw to a slide, call beginDrawingNextSlide() with the name of the slide and the duration
	//that you want the contents of the slide to be presented for.
	SlidePresenter.beginDrawingNextSlide(1000, "fixation");
	//After calling beginDrawingNextSlide(), all drawing commands will be directed to the current
	//slide until beginDrawingNextSlide() is called again or endDrawingCurrentSlide() is called.
	drawFixation(); //See the definition of this function below for some examples of how to draw stuff.

	//Add some more slides.
	SlidePresenter.beginDrawingNextSlide(250, "blank");
	drawBlank();

	SlidePresenter.beginDrawingNextSlide(500, "sample");
	drawSampleArray(trials.at(trialIndex));

	SlidePresenter.beginDrawingNextSlide(1000, "maintenance");
	drawBlank();

	//The duration given for the last slide must be > 0, but is otherwise ignored.
	//The last slide has an infinite duration: Once it is presented, it will stay
	//on screen until something else is drawn (i.e. the slide presenter does not
	//remove it from the screen after its duration is complete).
	SlidePresenter.beginDrawingNextSlide(1, "test");
	drawTestArray(trials.at(trialIndex));
	SlidePresenter.endDrawingCurrentSlide(); //After drawing the last slide, it is good form to call endDrawingCurrentSlide().
}
/* moves backwards one character, erasing the last one put down */
void
backspace(void)
{
    int x, y;
    if (numChars > 0) {
        getPositionForCharNumber(numChars, &x, &y);
        drawBlank(x, y);
        numChars--;
        getPositionForCharNumber(numChars, &x, &y);
        drawBlank(x, y);
        drawCursor();
    }
}
void
drawIndex(int index)
{
    int x, y;
    getPositionForCharNumber(numChars, &x, &y);
    SDL_Rect srcRect =
        { GLYPH_SIZE_IMAGE * index, 0, GLYPH_SIZE_IMAGE, GLYPH_SIZE_IMAGE };
    SDL_Rect dstRect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
    drawBlank(x, y);
    SDL_RenderCopy(texture, &srcRect, &dstRect);
}
示例#4
0
void drawStimuliToFramebuffers(CX_SlidePresenter& sp, int trialIndex) {
	CX_Millis startTime = Clock.now();

	sp.beginDrawingNextSlide(stimulusPresentationDuration, "stimulus");
	string letter = df(trialIndex, "letter").toString();
	drawStimulus(letter, (trialIndex >= nBack));
	sp.endDrawingCurrentSlide();

	sp.beginDrawingNextSlide(interStimulusInterval, "blank");
	drawBlank();
	sp.endDrawingCurrentSlide();

	CX_Millis renderingDuration = Clock.now() - startTime;
	Log.notice() << "framebuffer rendering duration: " << renderingDuration;
}
示例#5
0
void ofxGuiImage::draw() 
{
	glPushMatrix();
	glTranslatef( mObjX, mObjY, 0.0f );
	ofFill();
	if (bImageSet) 
		drawImage();
	else 
		drawBlank();
	if ( mParamName != "" ) 
		drawHighlightParamString( PARAM_TEXT_OFFSET_X, .0f, mParamName, false );
	if ( bDrawInfo && bCanDrawInfo && pCam != NULL )
		drawInfo();
	if (bCamSelected)
		drawSelectedText();
	glPopMatrix();
}
示例#6
0
文件: Cell.cpp 项目: pmslavin/miner
void Cell::drawMinerals(Uint32 *pixels)
{
	int fog = 1;

	if(!isVisible())
		fog = 4;
	
	if(!minerals.isEmpty())
		drawBlank(pixels);
	else if(drilling)
		drawDrillProgress(pixels);
	else if(!isDrilled())
		drawDepthShade(pixels, fog);	
	else if(isDrilled())
		drawDrilled(pixels);

	for(auto& m: minerals)
		m->draw(pixels, fog);

	if(miner)
		miner->draw(pixels);
}
示例#7
0
GraphView::GraphView(QWidget* parent) :	QWidget(parent)
{
	drawBlank();
}