Click to See Complete Forum and Search --> : (Resolved) DirectDraw Surfaces
Jdo300
Dec 8th, 2002, 08:10 PM
Hi, I'm sorta new to DirectX and I'm trying to figure out how to create an empty DirectDraw Surface. I've found examples that show you how to make a main screen surface and a backbuffer to blt images on, but how do you make other blank surfaces of a defined height/width using the CreateSurface function? All the examples i've seen only show how to set up a surface with the CreateSurfaceFromFile function, but I just want an empty one. Could someone give me a quick example?
BodwadUK
Dec 9th, 2002, 03:17 AM
Private Sub CreateSurface()
Dim ddsd as DirectDrawSurfaceDesc
ddsd.lcaps = ddsd_Height + ddsd_Width + ddsd_lcaps
ddsd.ddCaps.lcaps = ddsd_offscreenplain
ddsd.lheight = 100
ddsd.lWidth = 100
Set background = dDraw.createsurface(ddsd)
Some Adjustments are probably needed for the correct fromats but they pop up anyway
In simple terms to create an empty surface use the DirectDrawSurfaceDesc object define a height a width and a surface type which if opscreenplain for a normal surface.
Hope it helps i cant test the code here but i think there are a few simple mistakes you can fix
Jdo300
Dec 9th, 2002, 02:18 PM
Thanks! It works great! Just what I'm looking for :)
BodwadUK
Dec 10th, 2002, 02:24 AM
Oh my god it Worked :eek: :eek: :eek: :eek:
Yipeee i have finally helped someone yippee
:D :D :D :D :D :D :D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.