HDC Rendering in DirectDraw

Started by
-1 comments, last by spat 21 years, 9 months ago
I am using DirectDraw to try to create a side-scrolling flying game in which you can blowup terrain, similar to the DOS game, Chopper Commando. To accomplish this goal, I create an offscreen surface, get its HDC, and use GDI''s LineTo function. Since I only perform this operation once, I don''t expect to take a huge performance hit. When I display this terrain (which is currently a series of about 200 /\''s) at any given place in the terrain, it displays as expected. (I am using the BltFast function of a DirectDrawSurface). However, if I move the blit to the right, it does not continue to draw the hills, it simply draws the first n parts of the hill, where n is the number of pixels that you moved to the right. If I continue to move to the right, it ends up drawing a line of these broken pieces--the last n pixels again and again--until I get to the end of the surface. In my analysis, I have: - Made sure that there were no DirectX errors returned by any of the DirectX functions (of course). - Checked the LineTo function to make sure that it wasn''t failing. - Outputted the points to a log file to determine that these points were actually getting drawn. If there are any game purists out there who would like to assist me with this hair-ripping out problem, I would really appreciate it.

This topic is closed to new replies.

Advertisement