I want to create a DirectDraw Surface which is an overlay, but it gives me a NoOverlayHardwareException. I don't get why it does this, because a watch on the Device shows that it does support Overlays.
The code is like:
Dim desc As SurfaceDescription = New SurfaceDescription()
Dim caps As SurfaceCaps = New SurfaceCaps()
Dim dev as Device = New Device()
Dim overlay as Surface
desc.Width = 100
desc.Height = 100
desc.SurfaceCaps.Overlay = True
desc.SurfaceCaps.VideoMemory = True
overlay = New Surface(desc, dev)
The last line throws the exception. I put the .VideoMemory = True line in because a DirectX 7 article said you should to create an overlay surface. Despite the exception, dev.HardwareCaps.overlay returns true (which seems to say to me that Overlays ARE supported.
The code is like:
Dim desc As SurfaceDescription = New SurfaceDescription()
Dim caps As SurfaceCaps = New SurfaceCaps()
Dim dev as Device = New Device()
Dim overlay as Surface
desc.Width = 100
desc.Height = 100
desc.SurfaceCaps.Overlay = True
desc.SurfaceCaps.VideoMemory = True
overlay = New Surface(desc, dev)
The last line throws the exception. I put the .VideoMemory = True line in because a DirectX 7 article said you should to create an overlay surface. Despite the exception, dev.HardwareCaps.overlay returns true (which seems to say to me that Overlays ARE supported.