Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualDbowler92

Posted 10 September 2012 - 02:06 AM


So I have done some testing...

Where I clear my back buffer, I changed the code to:

[source lang="cpp"] d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(100,100,100), 1.0f, 0);[/source]

Which gives a nice grey background. However, in full screen... I still see a black background - this must be where my issues lie?


Do you call  device->Present() after drawing the scene. Your main Drawing method should look like this:
dd3dDevice->BeginScene();
//Here you draws all your textures
dd3dDevice->EndScene();
dd3dDevice->Present(0, 0, 0, 0);

When you're drawing in D3D you're drawing into something called back buffer. If you want to show the back buffer content on your screen you have to call the Present() method so that the buffer that is currently displaying swaps with the backbuffer.

As you point out, if you clear the backbuffer that way you shoud see a Grey Screen, not a black one, so the problem has probably nothing to do with your textures.


Hi,

Yeah I call present() Posted Image

My rendering code is like so:

Device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0)
Device->BeginScene()

SpriteObject->Begin(D3DXSPRITE_ALPHABLEND)
//Rendering Textures
SpriteObject -> End()

Device->EndScene()
Device->Present(NULL,NULL,NULL,NULL)

Still no luck :(

#1Dbowler92

Posted 10 September 2012 - 02:06 AM


So I have done some testing...

Where I clear my back buffer, I changed the code to:

[source lang="cpp"] d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(100,100,100), 1.0f, 0);[/source]

Which gives a nice grey background. However, in full screen... I still see a black background - this must be where my issues lie?


Do you call  device->Present() after drawing the scene. Your main Drawing method should look like this:
dd3dDevice->BeginScene();
//Here you draws all your textures
dd3dDevice->EndScene();
dd3dDevice->Present(0, 0, 0, 0);

When you're drawing in D3D you're drawing into something called back buffer. If you want to show the back buffer content on your screen you have to call the Present() method so that the buffer that is currently displaying swaps with the backbuffer.

As you point out, if you clear the backbuffer that way you shoud see a Grey Screen, not a black one, so the problem has probably nothing to do with your textures.


Hi,

Yeah I call present() Posted Image

My rendering code is like so:

Device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0)
Device->BeginScene()

SpriteObject->Begin(D3DXSPRITE_ALPHABLEND)
//Rendering Textures
SpriteObject -> End()

Device->EndScene()
Device->Present(NULL,NULL,NULL,NULL)

PARTNERS