PureBasic Forum
http://forums.purebasic.com/english/

Shouldn't OpenWindowedScreen() open inside a given window?
http://forums.purebasic.com/english/viewtopic.php?f=15&t=9733
Page 1 of 1

Author:  Derlidio [ Thu Mar 04, 2004 9:04 pm ]
Post subject:  Shouldn't OpenWindowedScreen() open inside a given window?

Yeepy...

Shouldn't OpenWindowedScreen() open inside a given window?
The piece of code that follows shows strange behavior when compiled under Linux OS. The Screen appears windowed, but outside the main window (stated at the OpenWindowedScreen() function). As usual, I tested the code under WinXP and it behaves OK (Screen opens inside the given window).

Code:
If InitSprite() = 0
  MessageRequester("Error", "Can't initialize Sprites...", 0)
  End
EndIf

OpenWindow(0, 10, 10, 640, 480, #PB_Window_SystemMenu, "Test")
OpenWindowedScreen(WindowID(0), 0, 0, 320, 240, 0,0,0)

LoadSprite(0, "Whatever.bmp", 0)

Repeat

  E = WindowEvent()

  If E = #PB_Event_CloseWindow: Break: EndIf

  FlipBuffers()                        ; Flip for DoubleBuffering
  ClearScreen(0,0,0)                   ; CleanScreen, black

  x = WindowMouseX()                   ; Returns actual x pos of our mouse
  y = WindowMouseY()                   ; Returns actual y pos of our mouse

  DisplaySprite(0, x-SpriteWidth(0)/2, y-SpriteHeight(0)/2)

ForEver

CloseScreen()

End

Author:  Christian [ Fri Mar 05, 2004 4:04 pm ]
Post subject: 

Same problem in my case ...

regards,
christian

Author:  Fred [ Sat Mar 06, 2004 6:32 pm ]
Post subject: 

Yes, this is an SDL limitation and I don't know yet how workaround it. It should of course be precised in the docs (I will add it).

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