Page 1 of 1

[resolved] A problem with openscreen() in fullscreen

Posted: Fri Jun 08, 2012 5:31 pm
by [blendman]
Hi

I don't know why my screen is all black, when I use the fullscreen mode (#fullscreen = 1)

Does someone know why and how I can have a good result ?

Thanks

Code: Select all

#MainWindow =0
#fullscreen = 1
InitSprite()
InitKeyboard()

If OpenWindow(#MainWindow,0,0,800,600,"3Arks",#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
  If OpenWindowedScreen(WindowID(#MainWindow),0,0,800,800,0,0,0,#PB_Screen_SmartSynchronization)
  EndIf
EndIf

Repeat
  delay +1
  Delay(10)
  ClearScreen(RGB(125,125,125))
  StartDrawing(ScreenOutput())
  DrawText(100,100,"1er écran : "+Str(delay))
  StopDrawing()
  FlipBuffers()
  ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape) Or e =#PB_Event_CloseWindow Or delay >=150

CloseWindow(#MainWindow)
Delay(1000)

If #fullscreen = 0
  flag = #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget
  If OpenWindow(#MainWindow,150,150,800,600,"3arks",flag);
    If OpenWindowedScreen(WindowID(#MainWindow),0,0,800,600,0,0,0,#PB_Screen_SmartSynchronization)
    EndIf
  EndIf
Else
  If OpenScreen(800,600,32,"3arks",#PB_Screen_SmartSynchronization)
  EndIf
EndIf

Repeat
  If #fullscreen = 0
    e=WaitWindowEvent()
  EndIf
  Delay(2)
  ClearScreen(RGB(125,125,125))
  StartDrawing(ScreenOutput())
  DrawText(100,100,"Ecran jeu")
  StopDrawing()
  FlipBuffers()
  ExamineKeyboard()
  delay+1
Until KeyboardPushed(#PB_Key_Escape) Or e =#PB_Event_CloseWindow Or delay >= 1200
End

Re: A problem with openscreen() in fullscreen

Posted: Fri Jun 08, 2012 5:53 pm
by jesperbrannmark
Screen is grey on Mac anyhow. Is this a screen resolution your gfx card can handle?

Re: A problem with openscreen() in fullscreen

Posted: Fri Jun 08, 2012 5:59 pm
by [blendman]
jesperbrannmark wrote:Screen is grey on Mac anyhow. Is this a screen resolution your gfx card can handle?
and have you the text in the screen ?

yes, it's a resolution my screen can handle ;)

Re: A problem with openscreen() in fullscreen

Posted: Fri Jun 08, 2012 6:18 pm
by Sirius-2337
For me, adding a CloseScreen() before the CloseWindow() makes it work.

Re: A problem with openscreen() in fullscreen

Posted: Sat Jun 09, 2012 2:13 pm
by [blendman]
Yes, I have forget the CloseScreen(), Sorry...

Thanks ;)