Page 1 of 1

Window 10 (1903) and PB-v5.7x / Floating-Registers failure

Posted: Fri Apr 10, 2020 3:22 pm
by mk-soft
With Windows 10 and PB-v5.7x (x86) the VectorDrawing destroy the Floating-Point Registers (Floating-Point-Stack?)

Windows 7 and PB-v5.7x (x86) not problem
PB v5.7x (x64) no problem

Windows 10 bug :?:

Test-Code

Code: Select all

EnableExplicit

LoadFont(0, "Segoe UI", 12)

Procedure.d GetLineHeight(Font)
  Protected r1.d
  
  If StartVectorDrawing(WindowVectorOutput(0))
    VectorFont(FontID(Font))
    r1 = VectorTextHeight("a")
    StopVectorDrawing()
  EndIf
  
  ProcedureReturn r1
EndProcedure

Procedure.d GetLineHeight2(Font)
  Protected r1.d
  
  If StartDrawing(WindowOutput(0))
    DrawingFont(FontID(Font))
    r1 = TextHeight("a")
    StopDrawing()
  EndIf
  
  ProcedureReturn r1
EndProcedure


Procedure.d GetWholeHeight()
   Protected Result.d
   
   Debug "VectorDrawing"
   Result = 0.0
   Debug "Ok: " + GetLineHeight(0)
   Result + GetLineHeight(0)
   Debug "Faild: " + Result
   
   Debug "2dDrawing"
   Result = 0.0
   Debug "Ok: " + GetLineHeight2(0)
   Result + GetLineHeight2(0)
   Debug "Ok: " + Result

  ProcedureReturn Result
EndProcedure

OpenWindow(0, 0, 0, 500, 300, "Test")
Debug "Result: " + GetWholeHeight()
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
German Link: https://www.purebasic.fr/german/viewtop ... 16&t=31950