bool Visualizer::onDisplay() { glViewport(0, 0, mWidth, mHeight); glClearColor(1, 1, 1, 1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); glEnable(GL_POINT_SMOOTH); glEnable(GL_POLYGON_SMOOTH); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-mWidth*1.0/mHeight, mWidth*1.0/mHeight, -1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); if (mRepeater->getState() != Repeater::S_STARTUP) { drawHistory(); } drawBanner(); glutSwapBuffers(); return mRepeater->getState() == Repeater::S_GONE; }
// // MAIN: Keyboard check example // void main(void) { // 32 bits counter, to let it count passed 65536 (up to 4 Billions) u32 i; // Disable firmware to prevent it from interfering with setVideoMode cpct_disableFirmware(); // Convert palettes from firmware colour values to // hardware colours (which are used by cpct_setPalette) cpct_fw2hw(G_banner_palette, 16); cpct_fw2hw(G_logo_palette, 4); // Set the border white, using colour 0 from G_banner_palette // after converting the colours to hardware values cpct_setBorder(G_banner_palette[0]); // Infinite main loop while (1) { // Draw CPCtelera's Logo and wait for a while drawLogo(); for(i=0; i < WAITLOOPS; ++i); // Draw CPCtelera's Banner and wait for a while drawBanner(); for(i=0; i < WAITLOOPS; ++i); } }
//-------------------------------------------------------------- void testApp::draw(){ //ofSetHexColor(0x000000); //ofRect(40,40,192,157); ofSetHexColor(0x000000); ofRect(40+36+36,40,48,16); ofSetHexColor(0x000000); ofRect(40+36,40+16,48+36+36,16); ofSetHexColor(0xFFFFFF); if(myStatus.CITY=="hsk") { if(movieLoaded) currentMovie.draw(0,0); } else if(myStatus.CITY=="lvp") { if(movieLoaded) currentMovie.draw(0,0,1360,768); } else if(myStatus.CITY=="mad") { if(movieLoaded) currentMovie.draw(20,72,222,125); } if((currentMovie.getDuration()-currentMovie.getPositionInSeconds())<5){ myStatus.transitionMode=true; //ofLog()<< "transition "<< circlesize; } if(ofGetFrameNum()%25==0){ //ofLog() << ofGetFrameRate() << "\n"; //ofLog() << myStatus.bikeSpeed << "\n"; //ofLog() << currentMovie.getPositionInSeconds() << " of " << currentMovie.getDuration() << " \n "; } if(ofGetFrameNum()%1800 < 400){ drawBanner(ofGetFrameNum()%1800); } if(myStatus.transitionMode==true){ drawTransition(); } ofSetColor(255,255,255,200); if(myStatus.currentCity==MADRID) verdana_small.drawString("madrid", 112,70); else if(myStatus.currentCity==LIVERPOOL) verdana_small.drawString("liverpool", 111,70); else if(myStatus.currentCity==HELSINKI) verdana_small.drawString("helsinki", 109,70); }