void Renderer::drawAll() { calcTime(); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Clear The Screen And The Depth Buffer glColor4f (1,1,1,1); glLoadIdentity(); glTranslatef(-game->ships[0]->position[0],-game->ships[0]->position[1],-30); // glTranslatef(0,0,-30); drawAxis(0,0,0); glColor3f( 0.0, 1.0, 1.0 ); wMesh->drawPolygon(-width*0.023,-height*0.023,0); drawShip(); drawModules(); drawMissles(); drawAsteroids(); // DrawQuadTexture(obiekty[0]->position[0],obiekty[0]->position[1],3,3,obiekty[0]->fOrientation, statek.imageID); // DrawQuadTexture(2.0f,2.0f,5.0f,5.0f,a[0]->myId); // drawAxis(0,0,0); //glPushMatrix(); // wMesh->drawPolygon(-width*0.023,-height*0.023,0); glPopMatrix(); glColor3f( 0.0, 1.0, 1.0 ); glLoadIdentity(); freetype::print(a, 77, 77, "Siemanko...."); CEGUI::System::getSingleton().renderAllGUIContexts(); glPushMatrix(); glTranslatef(0.0f, 0.0f, -15.0f); //obiekty.drawAll(); //DrawQuadTexture(1, 1, 10, 10, statek.imageID); SDL_GL_SwapWindow(window); }
void draw() { switch (currentMode) { case 1: drawArray(); break; case 2: drawArray2D(); break; case 3: drawModules(); break; } }
void ofApp::draw() { ofBackground(BACKGROUND_COLOR); if (appState == SPLASH_SCREEN) { imgSplashScreen.draw(0, 0, ofGetWidth(), ofGetHeight()); if (ofGetElapsedTimeMillis() > 1500) appState = SPLASH_FADE; return; } else if (appState == SPLASH_FADE) { ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(255, 255, 255, 255); if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, 0.0f, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, 0, ofGetWidth(), ofGetHeight()); } splashAlpha -= 2; ofSetColor(255, 255, 255, splashAlpha); imgSplashScreen.draw(0, 0, ofGetWidth(), ofGetHeight()); ofDisableAlphaBlending(); ofPopStyle(); if (splashAlpha <= 0) appState = ABOUT; return; } else if (appState == ABOUT) { if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, 0.0f, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, 0, ofGetWidth(), ofGetHeight()); } setLanguageBBoxes(); drawBouncingArrow(); return; } drawModules(); drawLines(); drawParticles(); drawTouches(); if (showSwipeInfo) { ofPushStyle(); if (isTablet()) ofSetColor(47); // NOTE: previous white font color wasn't readable on iPad; else ofSetHexColor(CONSOLE_COLOR); int swipeSize = 150; int padding = 80; imgSwipeInfo.draw(ofGetWidth()/2-swipeSize/2, ofGetHeight()/2, swipeSize, swipeSize); string s1 = ofApp::translations["SWIPE_INFO_TOP_LINE"]; int s1w = swipeFont.getStringBoundingBox(s1, 0, 0).width; int s1x = (ofGetWidth() - s1w) / 2; int s1y = ofGetHeight()/2 - padding; swipeFont.drawString(s1, s1x, s1y); string s2; if (ofApp::isPhone()) s2 = ofApp::translations["SWIPE_INFO_BOTTOM_LINE_PHONE"]; else s2 = ofApp::translations["SWIPE_INFO_BOTTOM_LINE_TABLET"]; int s2w = swipeFont.getStringBoundingBox(s2, 0, 0).width; int s2x = (ofGetWidth() - s2w)/2; int s2y = ofGetHeight()/2 + swipeSize + padding; swipeFont.drawString(s2, s2x, s2y); ofPopStyle(); } if (appState == BAR) { ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(255, 255, 255, DEFAULT_ALPHA); if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, aboutY, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, aboutY, ofGetWidth(), ofGetHeight()); } ofDisableAlphaBlending(); drawArrow(false); ofPopStyle(); } else if (appState == ABOUT_ASCENDING) { if (aboutY < 15) { aboutY = 0; appState = ABOUT; } else { aboutY -= 15; } if (currentAlpha < 255) currentAlpha += 3; ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(255, 255, 255, currentAlpha); if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, aboutY, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, aboutY, ofGetWidth(), ofGetHeight()); } ofDisableAlphaBlending(); ofPopStyle(); } else if (appState == ABOUT_DESCENDING) { aboutY += 20; if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, aboutY, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, aboutY, ofGetWidth(), ofGetHeight()); } } else if (appState == BAR_ASCENDING) { ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(255, 255, 255, DEFAULT_ALPHA); aboutY -= 5; if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, aboutY, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, aboutY, ofGetWidth(), ofGetHeight()); } drawArrow(false); ofDisableAlphaBlending(); ofPopStyle(); } else if (appState == BAR_DESCENDING) { ofPushStyle(); ofEnableAlphaBlending(); ofSetColor(255, 255, 255, DEFAULT_ALPHA); aboutY += 5; if(ofApp::isPhone()){ imgAbout.drawSubsection(0.0f, aboutY, (float)ofGetWidth(), (float)ofGetHeight(), 0.0f, (float)crop); } else { imgAbout.draw(0, aboutY, ofGetWidth(), ofGetHeight()); } drawArrow(true); ofDisableAlphaBlending(); ofPopStyle(); } else if (appState == APP) { if (isOsx()) { currentAlpha = DEFAULT_ALPHA; drawArrow(true); ofPushStyle(); ofSetColor(IMAGE_COLOR, DEFAULT_ALPHA); ofEnableAlphaBlending(); ofDrawRectangle(barRect); ofDisableAlphaBlending(); ofPopStyle(); } } }