|
dabooda.org - official forum
|
 |
|
| View previous topic :: View next topic |
| Author |
Message |
Lurker
Joined: 01 Mar 2010 Posts: 1
|
Posted: Mon Mar 01, 2010 3:17 am Post subject: Drawing Basic Lines |
|
|
Hi Everyone,
I've been using the DB engine for a while now, developing a 2d tank-like game where the user does not interact by pressing keys but instead uses a script that he/she has written as a 'brain' for the tank. Everyting is going fine with the engine, but a problem occured recently.
I need to know how to draw Lines in DB (these will be used to enclose the radar polygon of the tank), either with the engine itself, or the alternative option to use DX or GDI to blit to a DB object.
Anyway, any Line Function that has no flickering combined with the DB engine will do...
I'm using the line function of the picturebox now and it is blitted to the primary without backbuffer use. this causes flickering, wich i will be glad to get rid off.
Anyone who can help please do.
Greetings Lurker |
|
| Back to top |
|
 |
crysstaafur Site Admin

Joined: 01 Jan 1970 Posts: 75
|
Posted: Thu Mar 04, 2010 6:20 am Post subject: |
|
|
for the best possible performance use just str8 dabooda turbo.. no gdi or
vb form elements.. they are not hardware accelerated and can cause goofy stuff to happen in the message pump(which in vb5/6 is invisible to the coder btw, it's only tweakable in visual c,powerbasic,freebasic,etc)
so what to do, what to do.. hope the following helps...
make a line in windows paint. save it as a bmp, then you can use
add odd in the texture class. Then simply use a sprite reference on it to attach the 'line texture' to a sprite. now you can shrink or stretch it, change it's color, rotate it, and even test for sprite collision for certain effects..
hope this helps...
You can do the same for the radar background, it's overlay, and any objects that represent items in the game world. The background and it's overlay you may want to use the overlay class. For the 'radar objects' use a sprite class and have an offset system setup that behaves like a ratio to the actual items in your game map(and offscreen maps depending on how much range of radar you want)..
that should allow you to have all of the radar in the dbt system and using
hardware acceleration as a result. The bonus of course since it isn't using
any windows from elements the flicker will be gone as well.  _________________ There are 10 kinds of people, those who can read binary and those who can't.. ^_^ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|