PureBasic Forum
https://www.purebasic.fr/english/

PB 5.11 - WindowedScreen larger then Window
https://www.purebasic.fr/english/viewtopic.php?f=24&t=54107
Page 1 of 1

Author:  J. Baker [ Wed Mar 27, 2013 4:39 am ]
Post subject:  PB 5.11 - WindowedScreen larger then Window

If the windowed screen is larger then the window, sprite coords are off. This was fine in PB 4.61 but not anything after that.

Code:
#WinWidth = 640
#WinHeight = 480

InitSprite()
InitKeyboard()
InitMouse()

UsePNGImageDecoder()

OpenWindow(0, 0, 0,#WinWidth, #WinHeight, "Screen Size", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, #WinWidth * 2, #WinHeight * 2, 0, 0, 0)
     
  LoadSprite(1, #PB_Compiler_Home + "Examples/Sources/Data/PureBasic.bmp", 0)
  LoadSprite(2, #PB_Compiler_Home + "Examples/Sources/Data/world.png", #PB_Sprite_Texture | #PB_Sprite_AlphaBlending)
       
    Quit = #False
   
Repeat
 
      Event = WaitWindowEvent()
      If Event = #PB_Event_CloseWindow
        Quit = #True
      EndIf
 
    FlipBuffers()
     
    ClearScreen(0)
   
    ;ExamineMouse() 
 
    ExamineKeyboard()
   
    DisplaySprite(1, 10, 10)
   
    DisplayTransparentSprite(2, 200, 10)
       
Until Quit Or KeyboardPushed(#PB_Key_Escape)

End

Author:  Fred [ Sun Feb 09, 2020 1:47 pm ]
Post subject:  Re: PB 5.11 - WindowedScreen larger then Window

Seems to work as expected here, can anybody else confirm ?

Author:  deseven [ Fri Feb 14, 2020 3:43 pm ]
Post subject:  Re: PB 5.11 - WindowedScreen larger then Window

Doesn't work as expected for me, i altered original code a little to be 100% sure:
Code:
OpenWindowedScreen(WindowID(0), 0, 0, 400, 300, 0, 0, 0)
...
LoadSprite(1, #PB_Compiler_Home + "Examples/Sources/Data/PureBasic.bmp", 0)
...
DisplaySprite(1, 0, 0)

This shows the sprite at completely wrong coordinates. It works fine with OpenScreen() though.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/