dabooda.org - official forum

dabooda.org Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Drawing Basic Lines

 
Post new topic   Reply to topic    dabooda.org Forum Index :: Using DBT in VB5/VB6/VB NET
View previous topic :: View next topic  
Author Message
Lurker



Joined: 01 Mar 2010
Posts: 1

PostPosted: Mon Mar 01, 2010 3:17 am    Post subject: Drawing Basic Lines Reply with quote

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
View user's profile Send private message
crysstaafur
Site Admin


Joined: 01 Jan 1970
Posts: 75

PostPosted: Thu Mar 04, 2010 6:20 am    Post subject: Reply with quote

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. Smile
_________________
There are 10 kinds of people, those who can read binary and those who can't.. ^_^
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    dabooda.org Forum Index :: Using DBT in VB5/VB6/VB NET All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group - Glass Template Created by DoubleJ(Jan Jaap)