Sorry if this belongs elsewhere, kinda a few sections it could fit into, so I posted it here cause of the description of the forum. Anyway..

Im using DIB and Bitblt to draw to a created surface within a program. Currently, I have a few working things with this, drawing a new form background instead of a standard dialog box, using a transparent color and such. As well as using a bitmap picture as a font ect.

Im looking for some examples of making a starfield, (yes I know theres examples already on the forums), within this created surface. All the examples I found here are for COM / dos or OpenGL / DirectX. Im trying to do this within a window on a surface created using CreateDIBSurface. Any other examples that would have been on these forums are MIA. Im guessing you guys converted the forums from a diffrent version / type and it lost some of the attachments in the process.

Any help on this would be greatly appricated. Thanks in advance. :)
Posted on 2006-08-14 11:25:44 by wiccaan
Quickly coded an example starfield app, which uses my "sDraw" drawing library (based on DIBs and custom drawing on DIBs).
Rip the code from TestDraw() and replace sdSetPixel() with your own proc.

"sub CurTime,20"  - modify this value to change the speed (and direction) of travelling :)
Attachments:
Posted on 2006-08-14 14:40:06 by Ultrano
Woah, when I replaced the simple point with a texture (sprite), the particle-effects are worth seeing ;)
Attachments:
Posted on 2006-08-14 14:53:40 by Ultrano
Wow, thanks for the examples :D

The plasma one looks sweet too.

I'll see what I can make out of this and post my results when I do (if I can lol.)

Anyone else that has something feel free to contribute too :D
Posted on 2006-08-14 17:21:09 by wiccaan
Ok I added this to my project, took some work to get it to add correctly with the way my project is setup.

But, the issue is its causing the rest of the things being blited to the screen to flicker like crazy. Ill try to explain my program without posting it, (Id rather not post it right now, since its not done, and really messy right now :P)

Ok, anyway, Im using a rc file to make a res file for the dialogbox instead of using CreateWindowEx. Which works fine with your lib. I tested that and it worked fine. Ok, when my program starts up, the first thing it does is creates a dib section as the whole form. Next, it takes a BMP and creates a new "skin" for the form using that. My procs rip out the center pink section as the transparent color while bliting this to the screen.

Next it blits a set of text to the screen using a bmp font. So, in theory, my program looks like a rectangle, with a border. The middle is transpanrent. With another blitted text in the middle of that.

The order is Text > Border for an effect I was testing and trying to accomplish. Which did work.

Now, I want to try to get the starfield behind both of these "layers". When I attempted this with your lib, it just caused the border and text blits to flicker constantly.

Any clue on how to fix this? :D Thanks again.
Posted on 2006-08-14 21:35:10 by wiccaan
"with your lib" - you mean actually using sDraw.lib to draw behind the things you've already drawn on your DIB? sDraw's API shouldn't be used in cooperation with another DIB.

And, the starfield should be drawn first (painter's algorithm), if the border and text are above it.
Posted on 2006-08-15 05:27:31 by Ultrano
Does anyone have a simple masm example of using the sdLoadFont/sTextOut from the sDraw library?
Posted on 2006-11-24 09:58:09 by mango


font1_data db 1,2,3,4,4,5,......

...
.data
font1 dd ?
.code
invoke sdLoadFont,addr font1_data
mov font1,eax
....
m2m SD_CurFont,font1
invoke sTextOut,10,10,T("hello world!"),0FFFFFFh


Posted on 2006-11-24 12:26:28 by Ultrano
Thanks that works fine
Posted on 2006-11-26 00:22:28 by mango