Trond wrote:It's probably possible to make a workaround for the DX9 issue. Can you post a sample?
Would be great, I already gave up
My program source reaches the 10.000 line border now and uses some threads also, so I'm not sure, if the following small example will include all the given issues. Anyhow it has been extracted (and simplified) directly from the original source and produces wrong results, when DirectX9 will be used:
Code: Select all
Global ScreenX=GetSystemMetrics_(#SM_CXSCREEN)
Global ScreenY=GetSystemMetrics_(#SM_CYSCREEN)
#PIHalbe=#PI/2
#PiRadiant=#PI/180
#PiGrad=180/#PI
#GoogleMapSprite=1
Global Dim Polygon(8); Eckpunkte für die Bodenplatte (2D)
Macro Radiant(x)
(x*#PiRadiant)
;Procedure.d Radiant(x.d)
; ProcedureReturn x*#PiRadiant
;EndProcedure
EndMacro
Procedure.d Distanz(l1.d,b1.d,l2.d,b2.d)
; Rechenungenauigkeit ist bei Float zu groß, somit alle Variablen in Double!
;Debug "D:"+StrD(l1,10)+" | "+StrD(b1,10)+" | "+StrD(l2,10)+" | "+StrD(b2,10)+" | "+StrD(ACos(Cos(#PIHalbe-b2)*Cos(#PIHalbe-b1)+Sin(#PIHalbe-b2)*Sin(#PIHalbe-b1)*Cos(Radiant(l2)-Radiant(l1)))*6368.0,10)
Debug StrD(ACos(Cos(#PIHalbe-b2)*Cos(#PIHalbe-b1)+Sin(#PIHalbe-b2)*Sin(#PIHalbe-b1)*Cos(Radiant(l2)-Radiant(l1)))*6368.0,10)
b1=Radiant(b1)
b2=Radiant(b2)
ProcedureReturn ACos(Cos(#PIHalbe-b2)*Cos(#PIHalbe-b1)+Sin(#PIHalbe-b2)*Sin(#PIHalbe-b1)*Cos(Radiant(l2)-Radiant(l1)))*6368.0
EndProcedure
InitSprite()
#winID=1
win=OpenWindow(#winID,0,0,ScreenX,ScreenY,"*",#PB_Window_ScreenCentered | #PB_Window_BorderLess)
OpenWindowedScreen(win,0,0,ScreenX,ScreenY,0,0,0)
CorrectGraphicCard=#True
#TransparentColor=$FF00FF; Farbe, die hoffentlich nie in einer Google-Karte auftaucht
;***Google Maps***
If CorrectGraphicCard
!FSTCW word[v_fpu_bug]
If InitSprite3D()
; Testen, ob 3D-Sprite erstellt werden kann...
Sprite3DQuality(#PB_Sprite3D_BilinearFiltering)
;CatchSprite(#GoogleMapSprite,?Splash,#PB_Sprite_Texture)
CreateSprite(#GoogleMapSprite,256,256,#PB_Sprite_Texture)
TransparentSpriteColor(#GoogleMapSprite,#TransparentColor)
If CreateSprite3D(#GoogleMapSprite,#GoogleMapSprite)
GoogleMapFlag=#True
EndIf
!FLDCW word[v_fpu_bug]
EndIf
EndIf
For OptGoogleMap =0 To 1
If OptGoogleMap
Debug "ON"
If CorrectGraphicCard
Global fpu_bug.w
!FSTCW word[v_fpu_bug]
If Start3D()
TransformSprite3D(#GoogleMapSprite,Polygon(0),Polygon(1),4,Polygon(6),Polygon(7),2,Polygon(4),Polygon(5),1,Polygon(2),Polygon(3),3)
DisplaySprite3D(#GoogleMapSprite,0,0,OptGoogleGlas<<5+63)
Stop3D()
!FLDCW word[v_fpu_bug]
EndIf
EndIf
EndIf
Distanz(0.0000000000000000, 48.4540170000000000, 1.0000000000000000, 48.4540170000000000)
Distanz(15.9881449999999990, 48.4506650000000010, 15.9882010000000000, 48.4505649999999970)
Debug "---"
Next OptGoogleMap
The (correct) output using DirectX7 is:
Code: Select all
26.4907943097
0.6368017799
---
ON
26.4907943097
0.6368017799
---