Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Seems simple, but I am having problem blitting to back buffer.

This topic is 5553 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

I am setting the pixels directly on a surface, and copying that to the back buffer. But I can't get anything to come out correct. I tried just doing a straight horizontal line 400 pixels long, and it comes out as a line about 50 pixels long and 10 high. I took a screen shot to show what I mean. I verified that it is indeed writing 400 white 32 bit pixels every 4 bytes. Note I am running in 640x480. Thanks, CP [edited by - CptanPanic on May 9, 2003 1:07:21 AM]

Share this post

Link to post
Share on other sites
Rather difficult to say what the problem is without seeing the source or getting a lot more information.

2 obvious questions though:

1) Are you sure the backbuffer surface is 32 bit?

2) Do you know about framebuffer pitch and why it is important?

Share this post

Link to post
Share on other sites
Yes I understand that the pitch is the width of a row in bytes. I looked up the pitch and it is 2560, which divided by 32bits, comes out to 640. Below is what I am doing.

DWORD *m_pFinalVideoData =
(DWORD *)VirtualAlloc(NULL,
4 * m_iWidth * m_iHeight,

m_pd3dDevice->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO,

// Draw a Test Line.

for(int i = 0; i < m_iWidth; i++)
m_pFinalVideoData[i + 240 * m_iWidth] = 0xFFFFFFFF;

OutputDebugString("Unable to Lock Back Buffer\n");

m_SurfaceRect.Pitch* m_iHeight);


[edited by - CptanPanic on May 8, 2003 11:07:37 AM]

[edited by - CptanPanic on May 8, 2003 11:08:48 AM]

Share this post

Link to post
Share on other sites
I think I found out what is going on, seems my video card is doing something called tiling with the back buffer.

[edited by - CptanPanic on May 9, 2003 12:15:08 PM]

Share this post

Link to post
Share on other sites

  • 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!