Advertisement

BCB for a tile editor...

Started by August 17, 2001 10:35 PM
3 comments, last by Fuge 23 years, 6 months ago
I''ve been using Borland C++ Builder to create my game-building tools (wonderful program for many things like that btw), but I seemed to have hit a small snag, and I was wondering if anyone with BCB experience has ever tinkered with this before: In my map editor, I have my tiles blitted to my DDraw surface and then I use the get the DC and bitblit it to a CCanvas component on my game window. Seems to work ok, since BCB doesnt incorporate DDraw very well in a windowed component. Well, when it comes to wanting to animate some of the tiles, the only way to update the screen would be to call Repaint() some-odd times per second...and as everyone knows using a DC to do something like that flickers badly. Now, Im not sure of any other way to blit something to a component like that. Anyone have and windowed BCB experiences with DirectDraw they could share?
quote:
Original post by Fuge
In my map editor, I have my tiles blitted to my DDraw surface and then I use the get the DC and bitblit it to a CCanvas component on my game window.


Shouldn''t you be using BltFast or DDraw''s Blt function instead of a GDI (DC) BitBlit?



"All you need to do to learn circular logic is learn circular logic"
"All you need to do to learn circular logic is learn circular logic"
Advertisement
In this particular case, using DDraw''s Blitter is apparently not possible when dealing with a VCL component. The VCL window only has a DC handle, and therefore limits alot of the faster surface-to-surface blitting.
Now, bitblitting to the DC seems to work ok, but its the flicker from having to repaint the component every frame that is the most annoying.

This is one of the main reasons why BCB is wonderful for tools, but not neccessarily for the actual game (unless you''re going full-screen of course)
hi there,

depends on the control but most window controls in
the vcl support a property doublebuffered if your
grid has this property set it to true, it defaults to
false in the form create event.

hope it helps

Mark.
No matter which tool you are using to develope a program, you should be able to get a valid HWND to pass off to Direct Draw, allowing you to establish a windowed mode drawing area. Can''t you just use native DDraw HWND creation instead of trying to blit to a DC?

This topic is closed to new replies.

Advertisement