Jump to content
  • Advertisement
Sign in to follow this  
ProgrammingNerd

green flashes

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When, I was making my game engine, I forgot to set debug mode in the control panel under DirectX. Anyway, when I run my program, all I get are these green flashes. I suspect that it is the debug runtimes way of telling me that I did something wrong. Man, do I feel stupid right now. Anybody programming in directx should be able to tell me what I'm doing wrong. Except me. Thanks, ProgrammmingNerd

Share this post


Link to post
Share on other sites
Advertisement
No, I was clearing, except it is failing with error code -858993460. Error lookup doesn't help me at all. Here's the call:


HRESULT hr;
hr = m_pD3DDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0);



Thanks,
ProgrammingNerd

Share this post


Link to post
Share on other sites
I don't think the error lookup tool takes signed values. You might want to try printing it out as an unsigned value.

But more importantly, what does the debug output say?

Share this post


Link to post
Share on other sites
That didn't work; there isn't anything coming out of the debug output. I set full debug level in the control panel and all I get in the debug output are some unallocated object errors and those come after I exit.

Thanks for your help, DrunkenHyena
ProgrammingNerd

Share this post


Link to post
Share on other sites
Yes, I have. For you information, here is my initialization code:


HRESULT CSWGBasic::CreateBasicDevice(IDirect3DDevice9 **c_pD3DDevice, HWND hWnd)
{
//Check for valid parameters
if( !hWnd )
return E_FAIL;

IDirect3D9* c_pD3D;
//Create Direct3D
if( NULL == ( c_pD3D = Direct3DCreate9 ( D3D_SDK_VERSION ) ) )
return E_FAIL;

//Setup presentation parameters
D3DPRESENT_PARAMETERS D3DPP;
ZeroMemory( &D3DPP, sizeof(D3DPP) );

D3DPP.BackBufferWidth = 800;
D3DPP.BackBufferHeight = 600;
D3DPP.BackBufferFormat = D3DFMT_X8R8G8B8;
D3DPP.BackBufferCount = 1;
D3DPP.SwapEffect = D3DSWAPEFFECT_DISCARD;
D3DPP.MultiSampleType = D3DMULTISAMPLE_NONE;
D3DPP.MultiSampleQuality = 0;
D3DPP.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
//D3DPP.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
D3DPP.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
D3DPP.Windowed = true;
D3DPP.EnableAutoDepthStencil = true;
D3DPP.AutoDepthStencilFormat = D3DFMT_D24S8;

//Create the device
if( FAILED( c_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING, &D3DPP, c_pD3DDevice ) ) )
{
c_pD3D->Release();
return E_FAIL;
}

m_pD3DDevice = *c_pD3DDevice;
c_pD3D->Release();
return S_OK;
}

Share this post


Link to post
Share on other sites
Green areas are Direct3Ds way of telling you that a given surface has not been initlized. If you say that it flashes and it ain't the backbuffer, could it be some texture you have not initlized properably?

If it was the backbuffer it should not flash, it should be a constant green color in the background of your objects.

Do you render some sort of UI infront of all your 3D objects that could be a invalid surface?

Share this post


Link to post
Share on other sites
Finally! I figured it out! Deep in my code, I was rendering the same backbuffer twice(m_pD3DDevice->Present(0, 0, 0, 0)). I don't know how I could have made that mistake, but finally. it's done!

Thanks to all of you who helped me out; without this website I would be so jammed up that I wouldn't know what to do.

PS I just rated all of you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!