display caps

Blitz3D Forums/Blitz3D Programming/display caps

Here's the user32.DECLS:
api_ChangeDisplaySettings% (lpDevMode*, dwflags%) :"ChangeDisplaySettingsA"
api_EnumDisplaySettings% (lpszDeviceName%, iModeNum%, lpDevMode*) : "EnumDisplaySettingsA"


And here's the previous code with CDS_TEST used on ChangeDisplaySettings. All resolutions with an asterisk should be the compatible ones. But it makes no sense as they all appear to be compatible! I may have coded this wrong?
Graphics 1024,768,32,2
devmode% = CreateBank (200)
mode% = 0
rc% = 1
modes_in_page% = 0
entries_per_line% = 0
While rc
   PokeShort(devmode,36, 200)
   rc% = api_EnumDisplaySettings (0, mode%, devmode%)
   BitsPerPel% = PeekShort (devmode, 104)
   PelsWidth% = PeekInt (devmode, 108)
   PelsHeight% = PeekInt (devmode, 112)
   DisplayFrequency% = PeekShort (devmode, 120)
   If BitsPerPel >= 4 And DisplayFrequency > 1 Then
      Select BitsPerPel
         Case 4  :    bppType$ = "16  "
         Case 8  :    bppType$ = "256 "
         Case 16 :    bppType$ = "65K "
         Case 24, 32: bppType$ = "16M "
         Default :    bppType$ = ""
      End Select
      If DisplayFrequency = 60 And bpptype$ = "16M " Then
         If api_ChangeDisplaySettings(devmode, 2) = 0 Then compatible$ = "*" Else compatible$ = " "
         entry$ = LSet$(Str$(mode),4) + bppType$ + compatible$ + Str$(PelsWidth) + "x" + Str$(PelsHeight) + " " + Str$(DisplayFrequency) + "hz"
         Write LSet$(entry$, 25)
         entries_per_line = entries_per_line + 1 : If entries_per_line = 5 Then entries_per_line = 0 : Print ""
      EndIf
   EndIf
   mode = mode + 1
Wend
WaitKey()
End


This doesn't seem to be what I wanted in the first place. I suspect this doesn't test for monitor compatibility, but more for graphics adapter compatibility.

Also I'm trying to call DirectDraw from Blitz3D and am wondering if a DECLS like this would make proper calls to what I need:
ddraw.DECLS
.lib "ddraw.dll" 

api_DirectDrawCreateEx(lpGUID*, lplpDD*, iid%, pUnkOuter*) : "DirectDrawCreateEx"
api_EnumVideoCallback(lpDDVideoPortCaps*, lpContext*) : "EnumVideoCallback"

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_0zp3.asp

or maybe I should use DirectDrawEnumerate:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_2yif.asp

It's hard to make sense out of all this! Are all the DirectDraw functions accessible only through what MSDN calls Interfaces?
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_3647.asp
* IDDVideoPortContainer
* IDirectDraw7
* IDirectDrawClipper
* IDirectDrawColorControl
* IDirectDrawGammaControl
* IDirectDrawPalette
* IDirectDrawSurface7
* IDirectDrawVideoPort