Direct3D10 & Color Problem

Started by
1 comment, last by Cosmy 13 years, 5 months ago
Hi all,

I have this
// CColorf classreal *GetARGB() const{	real fColor[4] = { 0.0f };	fColor[0] = this->GetA();	fColor[1] = this->GetR();	fColor[2] = this->GetG();	fColor[3] = this->GetB();	return fColor;}// CD3D10Render classvoid CRenderD3D10::Clear(const CColorf &Colorf){	if (m_pDevice)	{		m_pDevice->ClearRenderTargetView(m_pRenderTargetView, Colorf.GetARGB());		m_pDevice->ClearDepthStencilView(m_pDepthStencilView, D3D10_CLEAR_DEPTH | D3D10_CLEAR_STENCIL, 1, 0);	}	// move it in another function	if (m_pDXGISwapChain) m_pDXGISwapChain->Present(0, 0);}//--------------if (m_pRenderD3D10) m_pRenderD3D10->Clear(CColorf(1.0f, 0.125f, 0.3f, 1.0f));


I'm using Visual C++ 2010. When i run the release exe the clear color is red-pink
when i run the debug exe the clear color is black why this???

i checked the any single color and this is my log:

//debug(a)1.000000,(r)0.125000,(g)0.300000,(b)1.000000//release(a)1.000000,(r)0.125000,(g)0.300000,(b)1.000000


Please help me :(
Advertisement
You're returning a pointer to a temporary variable (fColor). Either make it a member of your CColorf class, or make it static member of that class, or have that GetARGB function take an array as a parameter that it will fill with the values.
Quote:Original post by MJP
You're returning a pointer to a temporary variable (fColor). Either make it a member of your CColorf class, or make it static member of that class, or have that GetARGB function take an array as a parameter that it will fill with the values.


Ok thanks now it work :)

This topic is closed to new replies.

Advertisement