Epo
02-19-2002, 09:14 PM
I know nothing is more of a pain than looking through someone's code and telling them where their mistake is.....so I'm going to try and make this as easy as possible for you :)
'In general
Dim DX As New DirectX7
Dim DD As DirectDraw7
Dim DDPS As DirectDrawSurface7
Dim DDBS As DirectDrawSurface7
Dim DDPSD As DDSURFACEDESC2
Dim DDBSD As DDSURFACEDESC2
Dim DDCaps As DDSCAPS2
Dim Running As Boolean
Private Sub Form_Load()
Set DD = DX.DirectDrawCreate("")
frmMain.Show
Call DD.SetCooperativeLevel(frmMain.hWnd, DDSCL_EXCLUSIVE Or DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX)
Call DD.SetDisplayMode(1280, 1024, 32, 0, DDSDM_DEFAULT)
With DDPSD
.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_FLIP Or DDSCAPS_COMPLEX
.lBackBufferCount = 1
End With
Set Primary = DD.CreateSurface(DDPSD)
DDCaps.lCaps = DDSCAPS_BACKBUFFER
Set Backbuffer = Primary.GetAttachedSurface(DDCaps)**
Backbuffer.GetSurfaceDesc ddsd3
frmMain.Show
Running = True
Do Until Running = False
DoEvents
Loop
End Sub
I get an error where the double stars are (they are not a part of the code) :) ....and the error says "Only user defined types in public modules can be coerced to or from a variant or passed to late bound functions"
And i really don't know what I'm doing wrong....andy ideas, suggestions or questions are welcome :)
Thanks
'In general
Dim DX As New DirectX7
Dim DD As DirectDraw7
Dim DDPS As DirectDrawSurface7
Dim DDBS As DirectDrawSurface7
Dim DDPSD As DDSURFACEDESC2
Dim DDBSD As DDSURFACEDESC2
Dim DDCaps As DDSCAPS2
Dim Running As Boolean
Private Sub Form_Load()
Set DD = DX.DirectDrawCreate("")
frmMain.Show
Call DD.SetCooperativeLevel(frmMain.hWnd, DDSCL_EXCLUSIVE Or DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX)
Call DD.SetDisplayMode(1280, 1024, 32, 0, DDSDM_DEFAULT)
With DDPSD
.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_FLIP Or DDSCAPS_COMPLEX
.lBackBufferCount = 1
End With
Set Primary = DD.CreateSurface(DDPSD)
DDCaps.lCaps = DDSCAPS_BACKBUFFER
Set Backbuffer = Primary.GetAttachedSurface(DDCaps)**
Backbuffer.GetSurfaceDesc ddsd3
frmMain.Show
Running = True
Do Until Running = False
DoEvents
Loop
End Sub
I get an error where the double stars are (they are not a part of the code) :) ....and the error says "Only user defined types in public modules can be coerced to or from a variant or passed to late bound functions"
And i really don't know what I'm doing wrong....andy ideas, suggestions or questions are welcome :)
Thanks