bool CocoRoomTodayCandy::ccTouchBegan(CCTouch* pTouch, CCEvent* pEvent)
{
    if (isTouched)
        return false;
    isTouched = true;
    isScrolling = false;
    isScrollViewTouched = false;

    CCPoint point = pTouch->getLocation();

    if (scrollView->boundingBox().containsPoint(point))
        isScrollViewTouched = true;

    for (int i = 0 ; i < spriteClass->spriteObj.size() ; i++)
    {
        if (spriteClass->spriteObj[i]->name == "button/btn_x_brown.png")
        {
            if (spriteClass->spriteObj[i]->sprite->boundingBox().containsPoint(point))
            {
                EndScene();
                break;
            }
        }
        else if(spriteClass->spriteObj[i]->name == "button/btn_red_mini.png")
        {
            if (spriteClass->spriteObj[i]->sprite->boundingBox().containsPoint(point))
            {
                // todayCandyKakaoId 리스트 갱신
                todayCandyKakaoId.clear();
                todayCandyKakaoId.push_back(myInfo->GetKakaoId()); // 본인 kakao id부터 넣자.

                for (int i = 0 ; i < selected.size() ; i++)
                {
                    if (selected[i])
                        todayCandyKakaoId.push_back( friendList[i]->GetKakaoId() );
                }
                for (int i = todayCandyKakaoId.size(); i < 5; i++)
                    todayCandyKakaoId.push_back("");

                // User Default 값 갱신
                char name[15];
                for (int i = 1 ; i < todayCandyKakaoId.size() ; i++)
                {
                    //CCLog("%s", todayCandyKakaoId[i].c_str());
                    sprintf(name, "todayCandy_%d", i);
                    CCUserDefault::sharedUserDefault()->setStringForKey(name, todayCandyKakaoId[i].c_str());
                }

                EndScene();
                break;
            }
        }
    }

    return true;
}
Esempio n. 2
0
void RenderSystem::v_Render()
{
	BeginScene();

	UpdateScene();
	XMMATRIX Model = XMMatrixIdentity();
	XMStoreFloat4x4(&m_Matrix.model, XMMatrixTranspose(Model));

    m_Matrix.view = m_Camera.GetViewMatrix();
	m_Cube.Render(m_pD3D11DeviceContext.Get(), m_Matrix.model, m_Matrix.view, m_Matrix.proj);

	XMFLOAT3 camPos = m_Camera.GetPos();
	XMFLOAT3 modelPos;
	modelPos.x = 0.0f;
	modelPos.y = 1.5f;
	modelPos.z = 0.0f;
	// Calculate the rotation that needs to be applied to the billboard model to face the current camera position using the arc tangent function.
	float angle = atan2(modelPos.x - camPos.x, modelPos.z - camPos.z) * (180.0 / XM_PI);
	// Convert rotation into radians.
	float rotation = (float)angle * 0.0174532925f;
	// Setup the rotation the billboard at the origin using the world matrix.
	XMMATRIX world = XMMatrixRotationY(rotation);
	// Setup the translation matrix from the billboard model.
	XMMATRIX trans = XMMatrixTranslation(modelPos.x, modelPos.y, modelPos.z);
	world *= trans;
	XMStoreFloat4x4(&m_Matrix.model, XMMatrixTranspose(world));

	m_Square.Render(m_pD3D11DeviceContext.Get(), m_Matrix.model, m_Matrix.view, m_Matrix.proj);

	DrawInfo();

	EndScene();
}
Esempio n. 3
0
void RsImplWinGL::Render()
{
	BeginScene();

    GLint defaultFBO;
    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO);
    
	// Clear the render target so we don't use it in the deferred rendering pass
	m_pCurrentRenderTarget = BtNull;
    
	// Cache the number of render targets
	BtU32 numRenderTargets = m_renderTargets.GetNumItems();

	for( BtU32 i=0; i<numRenderTargets; i++ )
	{
		// Cache each render target
		RsRenderTargetWinGL &renderTarget = m_renderTargets[i];

        // Always restore the default frame buffer at the start before changing it
        glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO );
        
		// render each render target
		renderTarget.Render();
	}

	EndScene();

	ResetRenderables();
}
Esempio n. 4
0
// Virtual event handlers, overide them in your derived class
void project1::OnDrawImage(wxPaintEvent& event) 
{ 
  BeginScene(&m_device, opengl::colorf(0.0f, 0.0f, 0.0f, 0.0f)); 
  EndScene(&m_device); 
  
  //event.Skip(); 
}
bool RequestTopaz::ccTouchBegan(CCTouch* pTouch, CCEvent* pEvent)
{
    if (isTouched)
        return false;
    isTouched = true;
    isScrolling = false;
    isScrollViewTouched = false;
    
    CCPoint point = pTouch->getLocation();
    
    if (scrollView->boundingBox().containsPoint(point))
        isScrollViewTouched = true;
    
    for (int i = 0 ; i < spriteClass->spriteObj.size() ; i++)
    {
        if (spriteClass->spriteObj[i]->name == "button/btn_x_yellow.png")
        {
            if (spriteClass->spriteObj[i]->sprite->boundingBox().containsPoint(point))
            {
                EndScene();
                break;
            }
        }
    }
    
    return true;
}
Esempio n. 6
0
//==============================================================================
// Brief  : 更新処理
// Return : void							: なし
// Arg    : void							: なし
//==============================================================================
void CSceneRanking::Update( void )
{
	// デバッグ表示
	PrintDebug( _T( "ランキング\n" ) );

	// カメラの更新
	D3DXMATRIX	mtxView;			// ビュー行列
	D3DXMATRIX	mtxOrtho;			// 正射影行列
	for( int cntCamera = 0; cntCamera < MAX_CAMERA; ++cntCamera )
	{
		m_ppCamera[ cntCamera ]->Update();
	}
	mtxView = m_ppCamera[ 0 ]->GetView();
	mtxOrtho = m_ppCamera[ 0 ]->GetOrtho();

	// 描画用変換行列の更新
	m_pArgument->m_pRenderMatrix2D->SetProjection( &mtxOrtho );
	m_pArgument->m_pRenderMatrix3D->SetView( &mtxView );

	// シーン遷移
	if( m_pArgument->m_pFade->GetState() == CObjectFade::STATE_OUT_END )
	{
		SetSceneNext( CManagerScene::SCENE_TITLE );
		EndScene();
	}
	if( m_pArgument->m_pInput->IsTrigger( CManagerInput::KEY_DECISION ) )
	{
		if( m_pArgument->m_pFade->GetState() != CObjectFade::STATE_OUT_WHILE )
		{
			m_pArgument->m_pFade->FadeOut( 20 );
		}
	}
}
Esempio n. 7
0
void RenderSystem::v_Render()
{
	BeginScene();

	static float t = 0.0f;
	static ULONGLONG timeStart = 0;
	ULONGLONG timeCur = GetTickCount64();
	if (timeStart==0)
		timeStart = timeCur;

	t = (timeCur-timeStart)/1000.0f;

	// Light
	XMMATRIX mSpin = XMMatrixRotationZ(-t);
	XMMATRIX mOrbit = XMMatrixRotationY(-t * 2.0f);
	XMMATRIX mTranslate = XMMatrixTranslation(-3.0f, 0.0f, 0.0f);
	XMMATRIX mScale = XMMatrixScaling(0.3f, 0.3f, 0.3f);
	XMMATRIX worldCube = mScale * mSpin * mTranslate * mOrbit;
	XMStoreFloat4x4(&m_Matrix.model, XMMatrixTranspose(worldCube));
	m_Cube.Render(m_pD3D11DeviceContext, m_Matrix, XMFLOAT4(0.0f, 0.0f, 1.0f, 1.0f) );

	XMFLOAT4 lightPos = XMFLOAT4(m_Matrix.model._14, m_Matrix.model._24, m_Matrix.model._34, 0.0f);

	//Object
	XMMATRIX rotMat = XMMatrixRotationY(t/10.0f);
	XMStoreFloat4x4(&m_Matrix.model, XMMatrixTranspose(rotMat));
	m_Cube.Render(m_pD3D11DeviceContext, m_Matrix, lightPos);

	EndScene();
}
Esempio n. 8
0
void RenderSystem::v_Render()
{

	BeginScene();

	m_Matrix.view = m_Camera.GetViewMatrix();

	DisableZbuffer();
	DisableCulling();

	m_Matrix.view._14 = 0.0f;
	m_Matrix.view._24 = 0.0f;
	m_Matrix.view._34 = 0.0f;
	m_Matrix.view._41 = 0.0f;
	m_Matrix.view._42 = 0.0f;
	m_Matrix.view._43 = 0.0f;
	XMMATRIX sphereWorld = XMMatrixIdentity();
	XMStoreFloat4x4(&m_Matrix.model, XMMatrixTranspose(sphereWorld));
	m_Skymap.Render(m_pD3D11DeviceContext, m_Matrix);

	EnableCulling();
	EnableZbuffer();


	m_Matrix.view = m_Camera.GetViewMatrix();
	XMMATRIX gridModel = XMMatrixIdentity();
	XMStoreFloat4x4(&m_Matrix.model, XMMatrixTranspose(gridModel));
	m_Terrain.Render(m_pD3D11DeviceContext, m_Matrix);

	DrawInfo();

	EndScene();

}
Esempio n. 9
0
void DrawScene()
{
	BeginScene(1);
	RenderQuad(p_logo,0,0,0,0,(480-p_logo->w)/2,(272-p_logo->h)/2,1,1,0,MAKE_RGBA_8888(255,255,255,40));
	mParticleSys->Render();
	EndScene();
}
	static HRESULT STDMETHODCALLTYPE MyEndScene(IDirect3DDeviceN* pThis)
	{
		d3ddebugprintf(__FUNCTION__ "(0x%X) called.\n", pThis);
		HRESULT rv = EndScene(pThis);

		return rv;
	}
Esempio n. 11
0
void GSDevice10::StretchRect(Texture& st, const GSVector4& sr, Texture& dt, const GSVector4& dr, ID3D10PixelShader* ps, ID3D10Buffer* ps_cb, ID3D10BlendState* bs, bool linear)
{
	BeginScene();

	// om

	OMSetDepthStencilState(m_convert.dss, 0);
	OMSetBlendState(bs, 0);
	OMSetRenderTargets(dt, NULL);

	// ia

	float left = dr.x * 2 / dt.GetWidth() - 1.0f;
	float top = 1.0f - dr.y * 2 / dt.GetHeight();
	float right = dr.z * 2 / dt.GetWidth() - 1.0f;
	float bottom = 1.0f - dr.w * 2 / dt.GetHeight();

	GSVertexPT1 vertices[] =
	{
		{GSVector4(left, top, 0.5f, 1.0f), GSVector2(sr.x, sr.y)},
		{GSVector4(right, top, 0.5f, 1.0f), GSVector2(sr.z, sr.y)},
		{GSVector4(left, bottom, 0.5f, 1.0f), GSVector2(sr.x, sr.w)},
		{GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sr.z, sr.w)},
	};

	D3D10_BOX box = {0, 0, 0, sizeof(vertices), 1, 1};

	m_dev->UpdateSubresource(m_convert.vb, 0, &box, vertices, 0, 0);

	IASetVertexBuffer(m_convert.vb, sizeof(vertices[0]));
	IASetInputLayout(m_convert.il);
	IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);

	// vs

	VSSetShader(m_convert.vs, NULL);

	// gs

	GSSetShader(NULL);

	// ps

	PSSetShader(ps, ps_cb);
	PSSetSamplerState(linear ? m_convert.ln : m_convert.pt, NULL);
	PSSetShaderResources(st, NULL);

	// rs

	RSSet(dt.GetWidth(), dt.GetHeight());

	//

	DrawPrimitive(countof(vertices));

	//

	EndScene();
}
Esempio n. 12
0
void RenderSystem::v_Render()
{
	BeginScene();

	m_Triangle.Render(m_pD3D11DeviceContext.Get(), m_Matrix);

	EndScene();
}
Esempio n. 13
0
void DeviceManDX12::Present()
{
	if (!swapChain) {
		return;
	}
	EndScene();
	swapChain->Present(0, 0);
	BeginScene();
}
Esempio n. 14
0
void RenderSystem::v_Render()
{
	BeginScene();

	m_Triangle.Render(m_pD3D11DeviceContext, m_Matrix);

	EndScene();
	m_Sound.Play();
}
void CocoRoomTodayCandy::keyBackClicked()
{
    if (isKeybackTouched || isTouched)
        return;
    isKeybackTouched = true;

    //sound->playClick();
    EndScene();
}
Esempio n. 16
0
void RequestTopaz::keyBackClicked()
{
    if (isKeybackTouched || isTouched)
        return;
    isKeybackTouched = true;
    
    sound->playClick();
    EndScene();
}
Esempio n. 17
0
GraphicsCaptureSource::~GraphicsCaptureSource()
{
    if(warningID)
    {
        API->RemoveStreamInfo(warningID);
        warningID = 0;
    }

    EndScene(); //should never actually need to be called, but doing it anyway just to be safe
}
Esempio n. 18
0
void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear)
{
	BeginScene();

	GSVector2i ds = dt->GetSize();

	// om

	OMSetDepthStencilState(m_convert.dss, 0);
	OMSetBlendState(bs, 0);
	OMSetRenderTargets(dt, NULL);

	// ia

	float left = dr.x * 2 / ds.x - 1.0f;
	float top = 1.0f - dr.y * 2 / ds.y;
	float right = dr.z * 2 / ds.x - 1.0f;
	float bottom = 1.0f - dr.w * 2 / ds.y;

	GSVertexPT1 vertices[] =
	{
		{GSVector4(left, top, 0.5f, 1.0f), GSVector2(sr.x, sr.y)},
		{GSVector4(right, top, 0.5f, 1.0f), GSVector2(sr.z, sr.y)},
		{GSVector4(left, bottom, 0.5f, 1.0f), GSVector2(sr.x, sr.w)},
		{GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sr.z, sr.w)},
	};

	IASetVertexBuffer(vertices, sizeof(vertices[0]), countof(vertices));
	IASetInputLayout(m_convert.il);
	IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);

	// vs

	VSSetShader(m_convert.vs, NULL);

	// gs

	GSSetShader(NULL);

	// ps

	PSSetShaderResources(st, NULL);
	PSSetSamplerState(linear ? m_convert.ln : m_convert.pt, NULL);
	PSSetShader(ps, ps_cb);

	//

	DrawPrimitive();

	//

	EndScene();

	PSSetShaderResources(NULL, NULL);
}
Esempio n. 19
0
		// Renders All objects
		void xSceneManager::RenderAll()
		{
			Clear();
			BeginScene();
			std::for_each(m_SceneNodes.begin(), m_SceneNodes.end(), 
				std::mem_fun(&Impulse::Scene::xSceneNode::Render));
			EndScene();
			Present();
			m_FrameCount++;
			m_TempFrameCount++;
		}
Esempio n. 20
0
void DrawScene()
{
	BeginScene(1);
	ImageToScreen(p_bg,0,0);
	DrawImage(p_logo,0,0,0,0,128,0,256,256);
	DrawImageMask(p_logo,0,0,0,0,0/*dx*/,0/*dy*/,128/*dw*/,128/*dh*/,logomask1);
	DrawImageMask(p_logo,0,0,0,0,480-128/*dx*/,272-128/*dy*/,128/*dw*/,128/*dh*/,0x7fffffff);
	DrawImageMask(p_logo,0,0,0,0,0/*dx*/,272-128/*dy*/,128/*dw*/,128/*dh*/,logomask2);
	DrawImageMask(p_logo,0,0,0,0,480-128/*dx*/,0/*dy*/,128/*dw*/,128/*dh*/,logomask2);
	EndScene();
}
Esempio n. 21
0
bool DX11Render::Frame()
{
	bool result = true;
	
	//Clear buffer
	BeginScene(0.5f, 0.5f, 0.5f, 1.0f);

	//present back buffer
	EndScene();

	return result;
}
Esempio n. 22
0
void RenderSystem::v_Render()
{
	BeginScene();

	m_Camera.DetectInput(m_Timer.GetDeltaTime(), GetHwnd());
	m_Matrix.View  =   m_Camera.GetViewMatrix();
	m_Matrix.Proj  =  m_Proj;

	//////////////////////////////////////////////////////////////////
	XMMATRIX objectModel = XMMatrixTranslation(0.0f, -1.0f, 0.0f);
	XMStoreFloat4x4(&m_Matrix.Model, XMMatrixTranspose(objectModel));
	ObjModel.Render(m_pD3D11DeviceContext, m_Matrix.Model, m_Matrix.View, m_Matrix.Proj);

	m_pD3D11DeviceContext->OMSetBlendState(0, 0, 0xffffffff);


	if (m_Camera.GetRightMouseClicked())
		CheckPick();

	for (int i = 0; i != 20; ++i)
	{
		if (!bottleHit[i])
		{
			XMFLOAT4X4 tempModel;
			XMMATRIX  model = XMMatrixTranspose(bottleModel[i]);
			XMStoreFloat4x4(&tempModel, model);
			BottomModel.Render(m_pD3D11DeviceContext, tempModel, m_View, m_Proj);
		}
	}

	WCHAR scoreInfo[255];
	swprintf(scoreInfo, L"Score: %d ", score);
	m_Font.drawText(m_pD3D11DeviceContext.Get(), scoreInfo, 22.0f, 10.0f, 100.0f, 0xff0099ff);

	////////////////////////////////////////////////////////

	XMMATRIX sphereWorld = XMMatrixIdentity();
	m_Matrix.View._14 = 0.0f;
	m_Matrix.View._24 = 0.0f;
	m_Matrix.View._34 = 0.0f;
	m_Matrix.View._41 = 0.0f;
	m_Matrix.View._42 = 0.0f;
	m_Matrix.View._43 = 0.0f;
	XMStoreFloat4x4(&m_Matrix.Model, XMMatrixTranspose(sphereWorld));

	m_Skymap.Render(m_pD3D11DeviceContext.Get(), m_Matrix);

	///////////////////////////////////////////////////////

	DrawFps();

	EndScene();
}
Esempio n. 23
0
void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1 (&iaVertices)[4], bool datm)
{
	const GSVector2i& size = rt->GetSize();

	if(GSTexture* t = CreateRenderTarget(size.x, size.y, rt->IsMSAA()))
	{
		// sfex3 (after the capcom logo), vf4 (first menu fading in), ffxii shadows, rumble roses shadows, persona4 shadows

		BeginScene();

		ClearStencil(ds, 0);

		// om

		OMSetDepthStencilState(m_date.dss, 1);
		OMSetBlendState(m_date.bs, 0);
		OMSetRenderTargets(t, ds);

		// ia

		IASetVertexBuffer(iaVertices, sizeof(iaVertices[0]), countof(iaVertices));
		IASetInputLayout(m_convert.il);
		IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);

		// vs

		VSSetShader(m_convert.vs, NULL);

		// gs

		GSSetShader(NULL);

		// ps

		GSTexture* rt2 = rt->IsMSAA() ? Resolve(rt) : rt;

		PSSetShaderResources(rt2, NULL);
		PSSetSamplerState(m_convert.pt, NULL);
		PSSetShader(m_convert.ps[datm ? 2 : 3], NULL);

		//

		DrawPrimitive();

		//

		EndScene();

		Recycle(t);

		if(rt2 != rt) Recycle(rt2);
	}
}
Esempio n. 24
0
void RenderSystem::v_Render()
{

	BeginScene();

	m_Matrix.view = m_Camera.GetViewMatrix();
	m_Grid.Render(m_pD3D11DeviceContext, m_Matrix);

	DrawInfo();

	EndScene();

}
Esempio n. 25
0
GraphicsCaptureSource::~GraphicsCaptureSource()
{
    if (injectHelperProcess)
        CloseHandle(injectHelperProcess);

    if (warningID)
    {
        //API->RemoveStreamInfo(warningID);
        warningID = 0;
    }

    EndScene(); //should never actually need to be called, but doing it anyway just to be safe
}
Esempio n. 26
0
void StartNewScene(SCNHANDLE scene, int entry) {
	EndScene();	// Wrap up the last scene.

	if (TinselV2) {
		TouchMoverReels();

		LockMem(scene);	// Do CD change before PrimeScene
	}

	PrimeScene();	// Start up the standard stuff for the next scene.

	LoadScene(scene, entry);
}
Esempio n. 27
0
void DrawScene()
{

	BeginScene(1);
	ImageToScreen(pimage_bg,0,0);

	RenderQuad(pimage_box,0,0,0,0,70,185,1,1,0,maskbox);
	RenderQuad(pimage_box,0,0,0,0,70,5,1,1,0,maskbox);
	DrawImage(pimage_icon[0],0,0,0,0,-20,-37,128,128);
	DrawImage(pimage_icon[1],0,0,0,0,-20,143,128,128);
	ImageToScreen(pimage_text,0,0);

	EndScene();
}
Esempio n. 28
0
void RankUp::ccTouchEnded(CCTouch* pTouch, CCEvent* pEvent)
{
    if (!isTouched)
        return;

    CCPoint point = pTouch->getLocation();

    if (idx > -1)
    {
        spriteClass->spriteObj[idx]->sprite->setColor(ccc3(255,255,255));
        ((CCSprite*)spriteClass->FindSpriteByName("letter/letter_confirm_mini.png"))->setColor(ccc3(255,255,255));
        if (!isBoasted)
            ((CCSprite*)spriteClass->FindSpriteByName("letter/letter_boast.png"))->setColor(ccc3(255,255,255));
    }
    if (rect.containsPoint(point))
    {
        if (kind == BTN_MENU_CONFIRM)
        {
            EndScene();
        }
        else if (kind == BTN_MENU_BOAST)
        {
            int idx;
            for (int i = 0 ; i < friendList.size() ; i++)
            {
                if (friendList[i]->GetKakaoId() == myInfo->GetKakaoId())
                {
                    idx = i+1; // 추월한 사람의 idx
                    break;
                }
            }

            if (friendList[idx]->GetPotionMsgStatus() > 0 && !friendList[idx]->IsMessageBlocked())
            {
                std::vector<int> data;
                data.push_back(idx);
                Common::ShowPopup(this, "RankUp", "NoImage", false, RANKUP_BOAST, BTN_1, data);
            }
            else
            {
                // 카카오톡 안에서 수신거부 or 환경설정 내 거부 <- 둘 중 하나라도 하면 수신거부를 시켜야 한다.
                std::vector<int> nullData;
                Common::ShowPopup(this, "RankUp", "NoImage", false, RANKUP_BOAST_REJECTED, BTN_1, nullData);
            }
        }
    }

    isTouched = false;
}
Esempio n. 29
0
void CGSH_Direct3D9::PresentBackbuffer()
{
	if(!m_device.IsEmpty())
	{
		HRESULT result = S_OK;

		EndScene();
		if(TestDevice())
		{
			result = m_device->Present(NULL, NULL, NULL, NULL);
			assert(SUCCEEDED(result));
		}
		BeginScene();
	}
}
Esempio n. 30
0
void DrawScene()
{

	BeginScene(1);
	ImageToScreen(pimage_bg,0,0);

	//RenderQuad(pimage_box,0,0,0,0,70,185,1,1,0,maskbox);
	//RenderQuad(pimage_box,0,0,0,0,70,5,1,1,0,maskbox);
	//DrawImage(pimage_icon[0],0,0,0,0,-20,-37,128,128);
	//DrawImage(pimage_icon[1],0,0,0,0,-20,143,128,128);
	ImageToScreen(pimage_text,0,0);
	//DrawEllipse(50,50,11,21,0xff0000ff,DISPLAY_PIXEL_FORMAT_8888);
	DrawEllipse(50,50,10,20,0xff0000ff,DISPLAY_PIXEL_FORMAT_8888);
	DrawEllipse(50,50,9,19,0x3f0000ff,DISPLAY_PIXEL_FORMAT_8888);
	EndScene();
}