Sign in to follow this  
mishal153

weird problem,---need some help

Recommended Posts

mishal153    116
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
Oxyd    1157
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
Carnage_frank    122
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

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