Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Perfect Line Function

Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Jan 2013 21:59
I was going through some old code to get some practice and I'm pleased to say I've greatly improved an old line function I wrote some time back. It now draws with far greater precision, no more odd lengths at certain angles and the code is even simpler and tidier. This function draws smoother and more accurate lines than the default line command, but I haven't tested its speed. This could easily be augmented to draw lines on memblock bitmaps so this would be a useful tool for any serious paint program.

Shh... you're pretty.
Fluffy Rabbit
User Banned
Posted: 8th Jan 2013 23:13
Man, you really are digging under the hood. I thought the point of DarkBASIC was to magically abstract away any and all low level / mathematical functionality.

Anyways, the puff ball on the left looks better than the puff ball on the right. However, I bet DarkBASIC's built-in command will always be faster than any of the same functionality programmed within it. DB has to interpret it with its VM, as opposed to it just being written in C in the first place. Still, the algorithm is what counts. Nice job, I guess.

Login to post a reply

Server time is: 2020-08-05 09:10:45
Your offset time is: 2020-08-05 09:10:45