void PlayerCar::draw()
{
	//spriteSheet->Render(CIwFVec2(x,y),1.0f,0.0f,0.0f);
	IwGxFlush();
	skeleton->draw();

}
示例#2
0
void ExampleRender()
{
    int y = 150;
    IwGxPrintString(30, y, g_UseSoundPool ? "Using Sound Pool" : "Using Sound Streaming");
    y += 20;

    for (int i = 0; i < MAX_SAMPLES; i++)
    {
        if (!g_Buttons[i])
            break;

        char buffer[0x100];
        const char* pState;
        switch (g_SampleState[i])
        {
        case 1:
            pState = "Playing";
            break;
        case 2:
            pState = "Paused";
            break;
        default:
            pState = "Stopped";
            break;
        }
        sprintf(buffer, "Sample: %d State: %s", i, pState);

        IwGxPrintString(30, y, buffer);
        y += 20;
    }

    IwGxFlush();
    IwGxSwapBuffers();
}
示例#3
0
void CRenderer::DrawBatch()
{
	if ( GetVBSize() > 0 )
	{
		IwGxLightingOff();
		IwGxSetMaterial( mCurrMtl ); 
		IwGxSetUVStream( mUVB );
		IwGxSetColStream(mCB, mCBSize); 
		IwGxSetVertStreamScreenSpaceSubPixel( mVB, mVBSize );
		if ( mIBSize == 0 )
		{
			IwGxDrawPrims(mBuffType, NULL, mVBSize);
		}
		else
		{
			IwGxDrawPrims(mBuffType, mIB, mIBSize);
		}
		
		
		mCurrMtl = NULL;
		//DefaultMaterial();
	
		IwGxFlush(); 
		IwGxSetColStream(NULL); 
		//IwGxSetUVStream( NULL );
		ResetBuffers();
	}
}
示例#4
0
void endOfGame()
{
	SplashInit();
	SplashUpdate("continue");
	SplashRender();
	IwGxLightingOn();
	gameFinalRender();
	IwGxFlush();
	IwGxSwapBuffers();

	while(!s3eDeviceCheckQuitRequest())
	{
		int64 start = s3eTimerGetMs();
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
		if (g_Input.getTouchCount() != 0)
		{
			s3eResult g_result = s3eOSExecExecute("http://www.facebook.com/Baconbb10", true);
		}
	}
}
示例#5
0
//-----------------------------------------------------------------------------
void HexMapTest::Render()
{
//	if (mouse_mode == MOUSE_MODE_CHECKING) 
	{
//		int32 px = IwGxGetScreenWidth() - s3ePointerGetX();
//		int32 py = IwGxGetScreenHeight() - s3ePointerGetY();
		int32 closestX = -1, closestY = -1;

		CIwVec3 vect = getWorldCoords(s3ePointerGetX(), s3ePointerGetY());
//		hexGrid->findClosestArray(origin, dir, closestX, closestY);
		//WORKING!!!
		hexGrid->findClosestSimple(vect.x, vect.y, closestX, closestY);
		DebugPrint(closestX, closestY);
	}
//		s_PickSurface->MakeCurrent();
    // Clear the screen
    IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);
	// Set the model matrix
    IwGxSetModelMatrix(&s_ModelMatrix);
	hexGrid->render();


    // End drawing
    IwGxFlush();

	IwGxPrintSetScale(2);
	IwGxPrintFrameRate(0, 0); 
	// Swap buffers
	IwGxSwapBuffers();
}
void EggDropGameEngine::Render(CIwRect& bounds)
{
	CIwSVec2 drawGrass(bounds.x + (bounds.w - g_pGrass->GetWidth()) / 2, bounds.y);
	Utils::AlphaRenderImage(g_pGrass, drawGrass, 0xff);

	if (g_bBroken)
	{
		if (g_iCrackIter < 40)
		{
			int yOffset = (g_pSpoon->GetHeight() - g_pEgg->GetHeight()) * g_iCrackIter / 40.0;
			CIwRect bounds2(bounds.x + (bounds.w - g_pEgg->GetWidth()) / 2, bounds.y + yOffset, g_pEgg->GetWidth(), g_pEgg->GetHeight());

			double fallRot = fallingRot + (g_iCrackIter * 2 / 40.0);

			Utils::AlphaRenderAndRotateImage(g_pEgg, bounds2, 0xff, fallRot);

			g_iCrackIter++;
		}
		else
		{
			CIwSVec2 draw(bounds.x + (bounds.w - g_pCrackedEgg->GetWidth()) / 2, bounds.y + (bounds.h - g_pCrackedEgg->GetHeight()));
			Utils::AlphaRenderImage(g_pCrackedEgg, draw, 0xff);
		}
	}
	else
	{
		CIwSVec2 draw(bounds.x + (bounds.w - g_pSpoon->GetWidth()) / 2, bounds.y);
		Utils::AlphaRenderImage(g_pSpoon, draw, 0xff);

		IwGxFlush();

		CIwRect bounds2(bounds.x + (bounds.w - g_pEgg->GetWidth()) / 2, bounds.y, g_pEgg->GetWidth(), g_pEgg->GetHeight());
		Utils::AlphaRenderAndRotateImage(g_pEgg, bounds2, 0xff, rot);
	}
}
TransitionManager::~TransitionManager()
{
    IW_CALLSTACK("TransitionManager::~TransitionManager");
    IwGxClear();
    IwGxFlush();
    Destroy();
}
示例#8
0
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
void ImGui_Marmalade_RenderDrawLists(ImDrawData* draw_data)
{
    // Handle cases of screen coordinates != from framebuffer coordinates (e.g. retina displays)
    ImGuiIO& io = ImGui::GetIO();
    draw_data->ScaleClipRects(io.DisplayFramebufferScale);

    // Render command lists
    for(int n = 0; n < draw_data->CmdListsCount; n++)
    {
        const ImDrawList* cmd_list = draw_data->CmdLists[n];
        const unsigned char* vtx_buffer = (const unsigned char*)&cmd_list->VtxBuffer.front();
        const ImDrawIdx* idx_buffer = &cmd_list->IdxBuffer.front();
        int nVert = cmd_list->VtxBuffer.size();
        CIwFVec2* pVertStream = IW_GX_ALLOC(CIwFVec2, nVert);
        CIwFVec2* pUVStream = IW_GX_ALLOC(CIwFVec2, nVert);
        CIwColour* pColStream = IW_GX_ALLOC(CIwColour, nVert);

        for( int i=0; i < nVert; i++ )
        {
            // TODO: optimize multiplication on gpu using vertex shader
            pVertStream[i].x = cmd_list->VtxBuffer[i].pos.x * g_scale.x;
            pVertStream[i].y = cmd_list->VtxBuffer[i].pos.y * g_scale.y;
            pUVStream[i].x = cmd_list->VtxBuffer[i].uv.x;
            pUVStream[i].y = cmd_list->VtxBuffer[i].uv.y;
            pColStream[i] = cmd_list->VtxBuffer[i].col;
        }

        IwGxSetVertStreamScreenSpace(pVertStream, nVert);
        IwGxSetUVStream(pUVStream);
        IwGxSetColStream(pColStream, nVert);
        IwGxSetNormStream(0);

        for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.size(); cmd_i++)
        {
            const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
            if (pcmd->UserCallback)
            {
                pcmd->UserCallback(cmd_list,pcmd);
            }
            else
            {
                CIwMaterial* pCurrentMaterial = IW_GX_ALLOC_MATERIAL();
                pCurrentMaterial->SetShadeMode(CIwMaterial::SHADE_FLAT);
                pCurrentMaterial->SetCullMode(CIwMaterial::CULL_NONE);
                pCurrentMaterial->SetFiltering(false);
                pCurrentMaterial->SetAlphaMode(CIwMaterial::ALPHA_BLEND);
                pCurrentMaterial->SetDepthWriteMode(CIwMaterial::DEPTH_WRITE_NORMAL);
                pCurrentMaterial->SetAlphaTestMode(CIwMaterial::ALPHATEST_DISABLED);
                pCurrentMaterial->SetTexture((CIwTexture*)pcmd->TextureId);
                IwGxSetMaterial(pCurrentMaterial);
                IwGxDrawPrims(IW_GX_TRI_LIST, (uint16*)idx_buffer, pcmd->ElemCount);
            }
            idx_buffer += pcmd->ElemCount;
        }
        IwGxFlush();
    }

    // TODO: restore modified state (i.e. mvp matrix)
}
示例#9
0
void N2F::Iw3D::Iw2DHelper::EndTick()
{
	IwGxFlush();
	Iw2DSurfaceShow();
	s3eDeviceYield(0);

	return;
}
示例#10
0
void CRenderer::End()
{
	DrawBatch();

	IwGxFlush(); 

	IwGxSwapBuffers(); 
	
	ClearMtlCache();
}
示例#11
0
//-----------------------------------------------------------------------------
void ExampleRender()
{
    //Render the UI
    IwGetUIView()->Render();

    //Flush IwGx
    IwGxFlush();

    //Display the rendered frame
    IwGxSwapBuffers();
}
示例#12
0
void Render()
{
    // Clear the screen
    IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

    gPM->DrawParticles();
    gPM->Flush();

    IwGxFlush();
    IwGxSwapBuffers();
}
int main()
{
	Initialize();

	// --HowTo: Load the tmx map from the json file
	tmxparser::Map_t *map = new tmxparser::Map_t;
	tmxparser::parseTmxFromJSON_file("testLevel.json", map);
	// --HowTo: Create a renderer
	tmxparser::TmxRenderer *renderer = new tmxparser::TmxRenderer(map);
	// an offset to use for scrolling the map
	CIwFVec2 offset(0,0);
	
	IwGxSetColClear(0x2f, 0x3f, 0x3f, 0xff);
    
    // Loop forever, until the user or the OS performs some action to quit the app
    while (!s3eDeviceCheckQuitRequest())
    {
        //Update the input systems
        s3eKeyboardUpdate();
        s3ePointerUpdate();

        // Clear the surface
        IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

		// --HowTo: render all layers, at original pixel size:
		//renderer->Render(offset); 

		// --HowTo: render all layers at reduced/scaled tile size
		renderer->Render(offset, CIwFVec2(64.0f, 64.0f)); 
		
		// --HowTo: render only one layer at original pixel size
		//renderer->RenderLayer(0, offset, CIwFVec2(0.0f, 0.0f));

		// --HowTo: render only one layer at scaled pixel size
		//renderer->RenderLayer(0, offset, CIwFVec2(64.0f, 64.0f));

		// advance offset
		offset.x += 3;
		if (offset.x>1900)
			offset.x =0;

        // Standard EGL-style flush of drawing to the surface
        IwGxFlush();
        IwGxSwapBuffers();
        s3eDeviceYield(0);
    }

	delete renderer;
	delete map;

	Terminate();    
    // Return
    return 0;
}
示例#14
0
// Example showing how to use the s3eWwise extension
int main()
{
    IW_CALLSTACK("main");

    s3eDebugOutputString("Booting s3eWwise example");

    initWwise();

    s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)buttonEvent, NULL);
    s3ePointerRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)motionEvent, NULL);

    IwGxInit();

    IwGxSetColClear(0, 0, 0, 0xff);

    while(!s3eDeviceCheckQuitRequest())
    {
        std::stringstream str;

        s3eWwiseSoundEngineRenderAudio();

        IwGxClear();

        IwGxPrintString(100, 100, "s3eWwise");

        IwGxPrintString(100, 300, "Touch to fire event");

        str << "RPM = " << rpm;
        IwGxPrintString(100, 400, str.str().c_str());
        str.str(std::string());

        str << "TH = " << touchHeight;
        IwGxPrintString(100, 500, str.str().c_str());
        str.str(std::string());

        str << "Height = " << height;
        IwGxPrintString(100, 600, str.str().c_str());
        str.str(std::string());

        IwGxFlush();
        IwGxSwapBuffers();
        s3eDeviceYield(0);
    }

    IwGxTerminate();

    s3ePointerUnRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)buttonEvent);
    s3ePointerUnRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)motionEvent);

    shutdownWwise();

    return 0;
}
示例#15
0
void ciclo()
{
	if (g_Input.getSound())
		g_Input.playSong();
	
    while (!s3eDeviceCheckQuitRequest())
    {
		if (g_Input.getLifes()<1)
		{
			gameOver();
		}
		if (menuB)
			break;
		s3eDeviceBacklightOn();
		g_Input.updateSound();
        s3eDeviceYield(0);

        int64 start = s3eTimerGetMs();

        bool result = BaconUpdate();
		bool result2 = FondoUpdate();

		IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);
		IwGxLightingOff();
		
		FondoRender();
		LifeStatusRender();
		BaconRender();		
		
		insertaObstaculos();
		spriteManager->render();
		chuletas->render();
		tank->render();

		IwGxLightingOn();
		FontLifeRender();
		FontCoinsRender();

		IwGxFlush();
		IwGxSwapBuffers();
		//g_Input.setScore(g_Input.getScore()+1);
        // Attempt frame rate
        /*while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }*/
		
    }
}
示例#16
0
void CRenderer::DrawDirect( IwGxPrimType type, CIwSVec2 * vertex, CIwSVec2 * uv, uint16* indexStream, CIwColour * colour, int32 vertexCount, CIwMaterial * mat )
{
	IwGxLightingOff();
	IwGxSetMaterial( mat ); 
	IwGxSetUVStream( uv );
	IwGxSetColStream(colour, vertexCount); 
	IwGxSetVertStreamScreenSpaceSubPixel( vertex, vertexCount );
	IwGxDrawPrims(type, indexStream, vertexCount);

	IwGxFlush(); 
	IwGxSetColStream(NULL); 
}
void Game::Render()
{
	IwGxClear( IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F );

	m_postProcessing->PreRender();

	GameState::RenderCurrentState();

	m_postProcessing->PostRender();

	IwGxFlush();
	IwGxSwapBuffers();
}
示例#18
0
void myIwGxDoneStars()
{
    IwGxSetScreenSpaceSlot(3);
    IwGxSetVertStreamScreenSpace( svertices, ssend_vertices );
    CIwMaterial *pMat = IW_GX_ALLOC_MATERIAL();
    pMat->SetAlphaMode( CIwMaterial::ALPHA_ADD );
    pMat->SetTexture( star_texture );
    pMat->SetColAmbient( 0xFF, 0xFF, 0xFF, 0xFF );
    IwGxSetMaterial( pMat );
    IwGxSetUVStream( suvdata );
    IwGxSetColStream( scolors, ssend_vertices );
    IwGxDrawPrims( IW_GX_QUAD_LIST, NULL, ssend_vertices );
    IwGxFlush();
}
示例#19
0
void Render()
{
	// Clear the screen to a pale blue
	IwGxSetColClear(128, 224, 255, 0);
	IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

	// Render the UI
	for (uint32 i = 0; i < BUTTON_COUNT; i++)
	{
		gButton[i]->Render();
	}

	// Finish rendering and display on screen
	IwGxFlush();
	IwGxSwapBuffers();
}
示例#20
0
void renderImageWorldSpace(CIwFVec2& position, float angle, float scaleFactor,
                        int textureSize, float worldRot, int frameNumber, int numFrames, float z) {
	
	static CIwSVec3 vertices[4];
	static CIwSVec2 UVs[4];
	
	//set up model space vertices
	
	int vertexDist = scaleFactor*textureSize/2;
	
	vertices[0] = CIwSVec3(-1*vertexDist, -1*vertexDist, z);
	vertices[2] = CIwSVec3(vertexDist, -1*vertexDist,    z);
	vertices[3] = CIwSVec3(vertexDist, vertexDist,       z);
	vertices[1] = CIwSVec3(-1*vertexDist, vertexDist,    z);
	
	CIwMat modelTransform = CIwMat::g_Identity;
	modelTransform.SetRotZ(IW_ANGLE_FROM_RADIANS(angle));
	modelTransform.SetTrans(CIwVec3(position.x, -position.y, 0));
	    
	CIwMat rot = CIwMat::g_Identity;
 	rot.SetRotZ(IW_ANGLE_FROM_RADIANS(worldRot));
	modelTransform = modelTransform*rot;
	
	IwGxSetModelMatrix(&modelTransform, false);
	
	float frameRatio = 1.0/numFrames;
	
	//set up sprite UV's
    
    iwfixed cf = IW_FIXED((float)frameNumber  / numFrames);
    iwfixed nf = IW_FIXED((frameNumber + 1.0) / numFrames);
    
	UVs[0] = CIwSVec2(cf, 0);
	UVs[2] = CIwSVec2(nf, 0);
	UVs[3] = CIwSVec2(nf, IW_GEOM_ONE);
	UVs[1] = CIwSVec2(cf, IW_GEOM_ONE);
		
	//render the unit in model space
	IwGxSetUVStream(UVs);
	
	IwGxSetZDepthFixed(8);	
	
	IwGxSetVertStreamModelSpace(vertices, 4);
	IwGxDrawPrims(IW_GX_QUAD_STRIP, NULL, 4);
	
    IwGxFlush();
}
void render()
{
	IwGxClear();
	for (int index = 0; index < 4; ++index)
	{
		m_controllers[index].Render();
	}

	IwGxPrintString(300, 50, g_debugButtonEvent);
	IwGxPrintString(300, 75, g_debugKeyEvent);
	IwGxPrintString(300, 100, g_debugMotionEvent);
	IwGxPrintString(300, 125, g_debugTouchEvent);
	IwGxPrintString(300, 150, g_debugTouchMotionEvent);

	IwGxFlush();
	IwGxSwapBuffers();
}
示例#22
0
void ExampleRender()
{
    //IW_PROFILE_NEWFRAME();

    CIwProfileIteratorDerived pProfileIterator(CIwProfileManager::Get().GetRoot());

    pProfileIterator.First();
    int iy = 30;
    while (!pProfileIterator.IsDone())
    {
        PrintfProperty(10, iy, pProfileIterator.GetCurrentName(), pProfileIterator.GetCurrentLastTime());
        pProfileIterator.Next();
        iy += 10;
    }

    PrintfProperty(10, 90, "points: ", (float)m_pAnimator->GetCurrentSpline()->GetPointCount());


    IW_PROFILE_START("render");

    CIwMaterial* pMat;

    // Clear the screen
    IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

    //// Allocate and initialise material from the IwGx global cache
    pMat = IW_GX_ALLOC_MATERIAL();

    //// Set this as the active material
    IwGxSetMaterial(pMat);

    m_pSplinePoly2Tri->Render();
    //IwGxSetColStream(s_Cols, 8);
    m_pBall->Render();
    IwGxSetColStream(NULL);

    // End drawing
    IwGxFlush();

    IW_PROFILE_STOP();

    // Swap buffers
    IwGxSwapBuffers();
}
示例#23
0
int main()
{
	IwGxInit();
	IwGxSetColClear(0, 0, 0xff, 0xff);

	while (!s3eDeviceCheckQuitRequest() &&
				 !(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN) &&
				 !(s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN))
	{
		IwGxClear();
		IwGxPrintString(120, 150, "Hello, World!");
		IwGxFlush();
		IwGxSwapBuffers();
		s3eDeviceYield(0);
	}

	IwGxTerminate();
	return 0;
}
示例#24
0
void CEndGameState::Render()
{
    IW_CALLSTACK("CEndGameState::Render");

    IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

    GetWorld().Render();

    IwGxLightingOff();
    IwGxSetScreenSpaceOrg( &CIwSVec2::g_Zero );

    CIwColour* cols = IW_GX_ALLOC(CIwColour, 4);
    memset(cols, 255, sizeof(CIwColour) * 4 );

    if (GetWorld().GetUICar()->GetPosition() == 1 )
    {
        CIwMaterial* mat = (CIwMaterial *)IwGetResManager()->GetGroupNamed("ui")->GetResNamed("youwin", IW_GX_RESTYPE_MATERIAL);
        IwGxSetMaterial(mat);
    }
    else
    {
        CIwMaterial* mat = (CIwMaterial *)IwGetResManager()->GetGroupNamed("ui")->GetResNamed("youlose", IW_GX_RESTYPE_MATERIAL);
        IwGxSetMaterial(mat);
    }


    const uint32 imageWidth  = 128;
    const uint32 imageHeight = 32;

    CIwSVec2 XY( (int16)((IwGxGetScreenWidth()/2) - (imageWidth/2)), (int16)(IwGxGetScreenHeight()/4) ),
            dXY( (int16)imageWidth, (int16)imageHeight );

    IwGxDrawRectScreenSpace(&XY, &dXY, cols);
    IwGxLightingOn();

    IwGxFlush();
    IwGxSwapBuffers();

#ifdef IW_DEBUG
    // Reset metrics for next frame
    IwGxMetricsReset();
#endif
}
bool ExamplesMainUpdate()
{
    s3eDeviceYield(0);
    s3eKeyboardUpdate();
    s3ePointerUpdate();

    int64 start = s3eTimerGetMs();

    if (!ExampleUpdate() || ExampleCheckQuit())
    {
        s3eDebugTracePrintf("ExampleUpdate returned false, exiting..");
        return false;
    }

    // Clear the screen
    if (g_ClearScreen)
        IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

    ButtonsRender();

    if (g_DrawCursor)
        CursorRender();

    SoftkeysRender();

    // User code render
    ExampleRender();

    // Attempt frame rate
    while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
    {
        int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
        if (yield<0)
            break;
        s3eDeviceYield(yield);
    }

    IwGxFlush();
    IwGxSwapBuffers();

    return true;
}
示例#26
0
bool MapViewUpdate() {

	// Clear the screen
    IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

	renderMap();
	renderMapPlayer();
	renderMapXpBar();
	renderMapHealth();

	Player* player = getGameState()->getPlayer();
	IntroState introState = getGameState()->getIntroState();

	if (lastLoses < player->getLoseCount() ||
		lastWins < player->getWinCount()) {
		lastLoses = player->getLoseCount();
		lastWins = player->getWinCount();

		mapGhost2->setCentre(CIwFVec2(IwGxGetScreenWidth()*0.80f, IwGxGetScreenHeight()*0.70f));
		mapGhost2->setNotice(false);

		if (introState == INTRO_DEFEND) {
			mapGhost2->moveGhost(CIwFVec2(IwGxGetScreenWidth()/2, IwGxGetScreenHeight()/2), arrivalCallback);
		}
	}
	if (introState == INTRO_ATTACK) {
		mapGhost->Update();
		mapGhost->Render();
	}

	mapGhost2->Update();
	mapGhost2->Render();

	IwGxFlush();
    IwGxSwapBuffers();

	return true;
}
//-----------------------------------------------------------------------------
void ExampleRender()
{
	// Clear screen
	IwGxClear( IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F );
	// Render text

	int sx = 10;
	int sy = 40;

	std::list<Request *>::const_iterator e = manager.get_queue().end();
	std::list<Request *>::const_iterator i = manager.get_queue().begin();
	int count = 0;
	for( ; i != e; i++ ) {
		char buf[1024];
		const char *name = HTTPStatusName[(*i)->get_state()];
		snprintf(buf, 1023, "%d) %s: %s/%d (%s)",count,(*i)->get_url().c_str(),name,(*i)->get_content_length(),(*i)->get_errmsg().c_str());
	    IwGxPrintString(sx, sy, buf, true);
		sy += 20;
		count++;
	}
	// Swap buffers
	IwGxFlush();
	IwGxSwapBuffers();
}
示例#28
0
bool CameraViewUpdate()
{
	if (viewFightInitRequired())
		initFightView();

	bool ghostAvailable = getGameState()->getGhost() != NULL;

	// Clear the screen
    IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

	if (ghostAvailable && 
		(!gameIsHalt() || getGameState()->getGhost()->isDead())) {
		updateGhost();
	}

	renderCamera();
	setupPlayer();
	if (ghostAvailable)
		renderGhost();
	playerAttackView->Render();

	playerHit->Render();

	manaBar->Render();
	cameraDefend->Update();
	cameraDefend->Render();

	tutorialView->Render();

	IwGxFlush();
    IwGxSwapBuffers();

	IwGxTickUpdate();

	return true;
}
示例#29
0
void gameOver()
{
	initMenu = false;
	if (g_Input.getSound())
		g_Input.stopSong();
	SplashInit();
	SplashUpdate("go");
	SplashRender();
	IwGxLightingOn();
	gameOverRender();
	IwGxFlush();
	IwGxSwapBuffers();

	while(!s3eDeviceCheckQuitRequest())
	{
		int64 start = s3eTimerGetMs();
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
		if (g_Input.getTouchCount() != 0)
		{
			int x = g_Input.getTouch(0)->x;
			int y = g_Input.getTouch(0)->y;

			if (x <= 380 && x >= 70 && y <= 730 && y >= 650)
			{
				g_Input.setCoins(0);
				g_Input.setLifes(5);
				corazon->setX(-400);
				for (int i=0; i<10; i++)
				{
					garras[i]->setX(-400);
				}
				maxiCoin->setX(-400);
				for (int j=0; j<20; j++)
				{
					miniCoins[j]->setX(-400);
				}
				for (int i=0; i<10; i++)
				{
					tnts[i]->setX(-400);
				}
				tank->setX(-600);
				chuletas->setX(-800);
				g_Input.part =1;
				g_Input.velAdvance = 10;
				chuletasStep = 2;
				tankStep = 2;
				g_Input.initTimer();
				g_Input.setTotalTime();
				g_Input.part = 1;
				g_Input.setVelocity(10000);
				//SplashShutDown();
				//SplashInit();
				if (g_Input.getSound())
				g_Input.playSong();
				SplashShutDown();
				break;
			}
			else if (x <= 1215 && x >= 650 && y <= 730 && y >= 650)
			{
				g_Input.setCoins(0);
				g_Input.setLifes(5);
				corazon->setX(-400);
				for (int i=0; i<10; i++)
				{
					garras[i]->setX(-400);
				}
				maxiCoin->setX(-400);
				for (int j=0; j<20; j++)
				{
					miniCoins[j]->setX(-400);
				}
				for (int i=0; i<10; i++)
				{
					tnts[i]->setX(-400);
				}
				tank->setX(-600);
				chuletas->setX(-800);
				g_Input.part =1;
				g_Input.velAdvance = 10;
				chuletasStep = 2;
				tankStep = 2;
				g_Input.initTimer();
				g_Input.setTotalTime();
				g_Input.part = 1;
				g_Input.setVelocity(10000);
				//------------------------------------------
				//------------------------------------------
				/*spriteManager->removeSprite(corazon);
				delete corazon;
				for (int i=0; i<15; i++)
				{
					spriteManager->removeSprite(garras[i]);
					delete garras[i];
					spriteManager->removeSprite(tnts[i]);
					delete tnts[i];
				}
				for (int i=0; i<25; i++)
				{
					spriteManager->removeSprite(miniCoins[i]);
					delete miniCoins[i];
				}
				delete tank;
				spriteManager->removeSprite(maxiCoin);
				delete maxiCoin;
				delete chuletas;*/
				menuB = true;
				SplashShutDown();
				break;
			}
		}
	}
}
示例#30
0
void Desktop::refresh() {
    IwGxFlush();
    IwGxSwapBuffers();
    s3eDeviceYield(duration);   
}