Dim ddsd1 As DDSURFACEDESC2 [B]'this describes the primary surface[/B]
Dim ddsd2 As DDSURFACEDESC2 [B]'this describes the bitmap that we load[/B]
Dim ddsd3 As DDSURFACEDESC2 [B]'this describes the size of the screen[/B]
[B]'load the bitmap into a surface - backdrop.bmp[/B]
ddsd2.lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH [B]'default flags[/B]
ddsd2.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
[B]'An offscreenplain means that
'the user never actually gets to see the surface - it is just an are in memory.[/B]
ddsd2.lWidth = ddsd3.lWidth [B]'the ddsd3 structure already holds the size
'of the screen. We could replace it with 640 and 480 - it would have the same effect[/B]
ddsd2.lHeight = ddsd3.lHeight
[B]'this is where the surface is created. You use the DDraw object to create a
'surface from the specified file name using the above description.[/B]
[B]'get the screen surface and create a back buffer too[/B]
ddsd1.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
ddsd1.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_FLIP Or DDSCAPS_COMPLEX
ddsd1.lBackBufferCount = 1
Set primary = dd.CreateSurface(ddsd1)
[B]'Get the backbuffer[/B]
Dim caps As DDSCAPS2
caps.lCaps = DDSCAPS_BACKBUFFER
Set backbuffer = primary.GetAttachedSurface(caps)
[I]backbuffer.GetSurfaceDesc ddsd3[/I]
Ecrofirt said:www.directx4vb.com article
the only other spot where I see ddsd3 before what I pasted is here:
Code:[I]backbuffer.GetSurfaceDesc ddsd3[/I]
Maybe that's it, and I just don't understand it enough. It lookes to me like it's getting the surface description from ddsd3, but ddsd3 hasn't had anything done to it yet.
this is at the beginning of the initialization of the program.
DirectDraw 7.0
DirectDrawSurface7.GetSurfaceDesc
The DirectDrawSurface7.GetSurfaceDesc method retrieves a description of the surface in its current condition.
object.GetSurfaceDesc(surface As DDSURFACEDESC2)
Parameters
object - Object expression that resolves to a DirectDrawSurface7 object.
surface - DDSURFACEDESC2 type to be filled with the current description of this surface.
Error Codes
If the method fails, it raises an error, and Err.Number can be set to one of the following values:
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DaMan121 said:Havent followed it much, but I dont think DirectDraw stuff has changed since 7, so if he is only screwin around with that, theres not much use for 9... until he starts on shaders that is![]()
maharg said:DirectDraw has always been a bit lame. All it gives you, reliably, is a framebuffer. If the card could do any more high level processing (polygon drawing, certain kinds of hardware blting), it was pretty unlikely you'd ever get to use it.
aaaaa0 said:Ya, it was (more or less) conceived of when all a video card could reliably do, was give you a framebuffer.
![]()
Diffense said:If you need direct, unimpeded access to the frame buffer directdraw (of which 7 is the last version) is all you've got so I'd hardly call it obsolete.