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 / Drawing dll

Author
Message
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Oct 2009 00:33
Just messing around today with dll's. it has box, dot, and bitmap drawing functions. the bitmap(soon to be bitmap and image) support transparency. and i had a 200x100 square and a about 100x100 image being drawn and it took less then 1 millisecond to work(printed 0) this is how it's working.

at the beginning you call InitDrawing() and it will get the backbuffer pointer then you can call AddPoint(), AddBox(), or AddBitmap() and specify position and colors. then when you call Draw() it locks the backbuffer and draws everything then unlocks it.

I am about to test it with the fps unlocked(i have to put some mp3's on this computer ) but i was having about 65 fps(the max lol) with the things stated above in a loop.

some might say this isn't very useful but i was bored so I decided to do it. lol

here's the functions and the dll is attached. just wanted to see what fps other people got.



New Site! Check it out \/

Attachments

Login to view attachments
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Oct 2009 00:56
I'll test this tomorrow, but from what I hear, it sounds cool! #) Maybe this will get my 2D game maker working faster...

TheComet


Make the paths of your enemies easier with WaypointPro!
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 3rd Oct 2009 01:28
It froze on me when I tried it out, would you post the codes you used for testing the fps along with the functions as well?
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 3rd Oct 2009 02:29
Quote: " the bitmap(soon to be bitmap and image) support transparency"


what do you mean by that...? just wondring.....

(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Oct 2009 02:30 Edited at: 3rd Oct 2009 03:49
I posted the functions, and here's the code i used.



Wait! i forgot! i havn't put 16 bit support in yet! you have to use Set display mode width,height,32

Display mode support, line function and support for multiple bitmap editing(other then just the backbuffer) are my next tasks.


Oh and test.bmp was just random boxes i drew in paint haha

Edit:

Dark Dragon:

Lets say you have a image that has a person on it with a pink background. well you only want to display that person not the pink background so you set the transparency to pink and all pixels with that color aren't shown. as simple as that! haha


Edit2:

Question! How does db store all three color values in a word????? thats only 2 bytes! i know ashinga has done it

New Site! Check it out \/
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Oct 2009 07:31 Edited at: 3rd Oct 2009 20:52
Now supports pasting bitmaps and images, plus you can use partial transparency. so you can see through the image. you can specify a float number from 0.0 to 1.0(0.01,0.1,0.05...) will post a updated dll and functions tomorrow.

hey by the way, if anyone here is interested please tell me otherwise i'm wasting my time posting it here


Edit:

I know this is the db board but, i have a question and it's pretty simple. here is my color transition code:



if that doesn't make sense. r1, r2, g1, g2, b1, b2 are just the r g and b values for c1 and c2. nr, ng, and nb are new red new green, new blue. but it is messing up my colores(red is coming out pink and yellow is coming out whitish gray. although it is transparent it is just changing my colors.

double = a float
unsigned long = dword
unsigned char = byte


the reason i'm using double is because the compiler was complaining with warnings about assigning a double to a unsigned char so i just changed it. had the same effect when it was a unsigned char.


Edit2:

Nevermind. it was the LOWORD, LOBYTE stuff. i don't know how i was doing it wrong but i found the GetRValue macros that i didn't know windows had so it's solved

New Site! Check it out \/

Login to post a reply

Server time is: 2024-05-03 22:47:52
Your offset time is: 2024-05-03 22:47:52