print sprite from a DLL
print sprite from a DLL
Is it posible to make a DLL that will place a sprite on the screen?
Pointers it will have to be then 8O . Any hint on how I should use this. I now what pointers are more or less, but I'm not sure how I would use them. I imagine that I would need to pass the screen to the dll and tell it to use that screen's buffer, but have no idea how I would do this.Othervise you shoud use pointers.
well, I was just playing around trying to make dll's for practice, and I have a procedure that does that. Being a lazy typist, I prefer to write pinta() to DisplayTransparentSprite() :roll:
I get the idea of passing the screenID, but then I don't see a way of using that information in the DLL, could it be UseBuffer(ScreenID) ?
I get the idea of passing the screenID, but then I don't see a way of using that information in the DLL, could it be UseBuffer(ScreenID) ?
Hm not exactly.
Well first of all you need to know a screen structure.
I dont know because i never had a need to do that.
But i ve done some graphics DLL for "darkbasic" (know that one ?)
Anyway the screen type might match but i cant tell you for sure.
Once you got a screen pointe (screen id ar screen memory adress)
you have to know the resolution and depth.
Theh you can calculate the memory lenght of screen using this formula.
width*height*depth/8 the result is in bytes.-
Now you can poke your pixels on the screen.
And its different for any screen depth.
The easier one is for 24 bit depth.I think you inderstand why.
Anyway the complete process is not simple.
You need to know how to work with memory and pointers.
And be carefull because wrong use might crash your PC.
Well first of all you need to know a screen structure.
I dont know because i never had a need to do that.
But i ve done some graphics DLL for "darkbasic" (know that one ?)
Anyway the screen type might match but i cant tell you for sure.
Once you got a screen pointe (screen id ar screen memory adress)
you have to know the resolution and depth.
Theh you can calculate the memory lenght of screen using this formula.
width*height*depth/8 the result is in bytes.-
Now you can poke your pixels on the screen.
And its different for any screen depth.
The easier one is for 24 bit depth.I think you inderstand why.
Anyway the complete process is not simple.
You need to know how to work with memory and pointers.
And be carefull because wrong use might crash your PC.
PIII450 128RAM TNT2
Well, I' ve been playing around with the memory buffer(), after much pain and searching around, I've more or less sussed out how this works
. Getting the colours right, specialy in 16bit mode is a bit troublesome, but fine once you realize how this works. Of course as you say 24bit is much more straight forward.
Haven't tryied it out in a DLL yet, I've got a bit side tracked playing around with this way of plotting, could prove very usefull for real time effects in 2D.
Haven't tryied it out in a DLL yet, I've got a bit side tracked playing around with this way of plotting, could prove very usefull for real time effects in 2D.

