Example #1
0
static void draw(void)
{
	drawBackground(background);
	
	drawStars();
	
	blit(earthTexture, earth.x, earth.y, 1);
	
	drawFighters();
	
	drawEffects();
	
	blit(logo, SCREEN_WIDTH / 2, 50, 1);
	
	blit(pandoranWar, SCREEN_WIDTH / 2, 110, 1);
	
	drawText(10, SCREEN_HEIGHT - 25, 14, TA_LEFT, colors.white, "Copyright Parallel Realities, 2015-2016");
	drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 25, 14, TA_RIGHT, colors.white, "Version %.2f.%d", VERSION, REVISION);
	
	switch (show)
	{
		case SHOW_TITLE:
			drawWidgets("title");
			break;
			
		case SHOW_STATS:
			drawStats();
			break;
			
		case SHOW_OPTIONS:
			drawOptions();
			break;
	}
}
Example #2
0
/*******************************************************
* paintGL()
*
* Description: The primary painting function for the
* OpenGL widget.  Everything is drawn here at the
* specified update rate.
*
* Inputs: none
*
* Outputs: none
*
* Return: none
*******************************************************/
void GLWidget::paintGL()
{
    // Handle title screen.
    if (!isBattle)
    {
        updateTitleScreen();
        return;
    }

    // Capture pending status.
    if (!isPending && !isEffect)
    {
        for (int i = 0; i < MAX_MAP_UNITS; i++)
        {
            // Update the action time (unitTest).
            if (unit[i].actionTime >= 100 && unit[i].status==UNIT_OK) //the dead shall not move :o
            {
                if (unit[i].team == USER_UNIT)
                {
                    // Play 'ready' sound.
                    QSound *soundBkgnd = new QSound("sounds/blip.wav");
                    soundBkgnd->play();
                }

                // The unit is ready to go, so pause the game.
                battleMap.gridCell[unit[i].vLocation][unit[i].hLocation].unit->isPending = true;
                isPending = true;

                // Tell mechanics to handle AI.
                mech->handleAI();
                break;
            }
            unit[i].actionTime += 0.005 * unit[i].actionRate;
        }
    }

    // Clear the background.
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    // Draw items.
    drawBackground();
    drawGrid();
    drawUnits();
    drawHeaderInfo();

    if (isEffect)
    {
        drawEffects();
    }
}
Example #3
0
//--------------------------------------------------------------
void ofApp::draw()
{
    //Should be black otherwise the addon grabs the background pixels
    ofBackground(0);
    
    // As it says
    drawEffects(effect);
    
    // Visual Representation of the Grab Area
    grid5x8.drawGrabRegion(hide);
    grid5x8.drawShield(30, 30);
    
    // Report Messages
    ofDrawBitmapStringHighlight("Output", 1,115);
    ofDrawBitmapStringHighlight("Input Area", ofGetWidth()/2-35,ofGetHeight()/2+120);
    ofDrawBitmapStringHighlight("Press Left and Right to Change Effect Mode", 5,ofGetHeight()-15);
    ofDrawBitmapStringHighlight("Is the Client Connected: " + ofToString(opcClient.isConnected()), 5,ofGetHeight()-30);
}