Page 1 of 1

OpenScreen() for multiple monitors

Posted: Tue Dec 13, 2016 5:58 am
by coco2
It would be good for building games such as simulations etc.

Re: OpenScreen() for multiple monitors

Posted: Sat Jan 14, 2017 12:03 am
by coco2
The solution is to use "Windowed Full Screen"

Re: OpenScreen() for multiple monitors

Posted: Sat Jan 14, 2017 12:50 am
by falsam
I hope I am not mistaken in your request. I am referring to this post.
http://www.purebasic.fr/english/viewtop ... 16&t=67437

This is my solution. With this code, a sprite moves from one screen to another screen.

Code: Select all

EnableExplicit

Define.i CountDesktops, Width, Height, n, x 
CountDesktops = ExamineDesktops()
For n=0 To CountDesktops-1
  Width + DesktopWidth(n)
  Height + DesktopHeight(n)
Next

InitSprite()
InitKeyboard()
InitMouse()

OpenWindow(0, 0, 0, Width, Height, "Windowed FullScreen", #PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0))

LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasicLogo.bmp")

Repeat   
  Repeat : Until WindowEvent() = 0
  
  ClearScreen(RGB(75, 0, 130))
  DisplaySprite(0, x, 200)
  RotateSprite(0, 2, #PB_Relative)
  
  x+3
  If x > Width : x = 0 : EndIf  
    
  ExamineKeyboard()
  FlipBuffers()  
Until KeyboardReleased(#PB_Key_Escape)

Re: OpenScreen() for multiple monitors

Posted: Mon Jan 16, 2017 8:02 am
by coco2
Yes that is the solution thank you Falsam :)