Page 1 of 1

Shouldn't OpenWindowedScreen() open inside a given window?

Posted: Thu Mar 04, 2004 9:04 pm
by Derlidio
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: Select all

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

Posted: Fri Mar 05, 2004 4:04 pm
by Christian
Same problem in my case ...

regards,
christian

Posted: Sat Mar 06, 2004 6:32 pm
by Fred
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).