Jump to content
  • Advertisement
Sign in to follow this  
mishal153

weird problem,---need some help

This topic is 5016 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 have made a program where there are 2 cubes which constantly rotate. I have used a bitmap as a frame buffer to which i am always painting and then presenting it . Now suppose that my window is initiated at the centre of my screen. It is a 400 by 400 window. The cubes are perfectly being displayed inside the window and are rotating fine. But after around 6-7 seconds the whole picture shifts to the top-left corner of the screen. The window remains at the centre but the cubes now rotate at the top left corner and there is a static image inside the window. The code for presenting the frame buffer is : HDC hdc=GetDC(m_Hwnd); BitBlt(hdc,0,0,400,400,m_hdcFrameBuffer,0,0,SRCCOPY); ReleaseDC(m_Hwnd,hdc); Somehow the frame buffer is being painted on the top-left of the screen. I am confused coz this happens after the program has run for few seconds. thanx bye

Share this post


Link to post
Share on other sites
Advertisement
What about debugging? Open a file and write all interesting data to it every time it changes. For example the coordinates of the cubes or whatever.

I'd say there is some error in your code...

Oxyd

Share this post


Link to post
Share on other sites
You may be having a memory issue. The memory allocated for your varaiables may be getting over written by some other values.

I would try debugging our program by stepping through it. If you are using Visual Studio or some other IDE use the debug mode and step through your code and give particular attention to what is stored in your variables.

If you need more help try posting more of your code.

Good Luck

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!