The
'Init()' Function...
This function detects the current desktop resolution and aspect and uses this along with the input values to find a suitable mode, this is to compensate for the different displays out there standard/wide etc.
Function Init(W as Dword,H as Dword,D as Dword)
bRet as boolean = 0
Load Dll "User32.dll",1
DW=Call Dll (1,"GetSystemMetrics",0)
DH=Call Dll (1,"GetSystemMetrics",1)
Delete Dll 1
`Find nearest supported resolution to requirements
Empty Checklist : Perform Checklist For Display Modes
P=(DW*DH)^2 : Q=0
For I=1 to Checklist Quantity()
If ((Checklist Value B(I)*1.0)/(Checklist Value A(I)*1.0)) = ((DH*1.0)/(DW*1.0)) and Checklist Value C(I) = D
If ABS((Checklist Value A(I)*Checklist Value B(I))-(W*H))<= P Then P = ABS((Checklist Value A(I)*Checklist Value B(I))-(W*H)): Q=I
EndIf
Next
If Q>0 Then W = Checklist Value A(Q) : H = Checklist Value B(Q)
` Check resolution
If Check Display Mode(W,H,D)
Set Display Mode W,H,D
Sync Rate 0 : Sync On : FastSync : Color Backdrop RGB(192,192,255)
Hide Mouse : Position Mouse Screen Width()/2, Screen Height()/2
AutoCam Off : Position Camera 0,20,0 : Set Camera Aspect ((Screen Width()*1.0)/(Screen Height()*1.0))
Center Text Screen Width()/2,(Screen Height()-Text Height("|"))/2,"Loading Data..."
bRet = 1
EndIf
EndFunction bRet
*note: These code segments do work, there may however be better ways of acheiving the same results. feel free to comment.
Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.