Sign in to follow this  

weird problem,---need some help

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

This topic is 4820 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this