[resolved] A problem with openscreen() in fullscreen

Advanced game related topics
User avatar
[blendman]
Enthusiast
Enthusiast
Posts: 297
Joined: Thu Apr 07, 2011 1:14 pm
Location: 3 arks
Contact:

[resolved] A problem with openscreen() in fullscreen

Post 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
Last edited by [blendman] on Sat Jun 09, 2012 2:13 pm, edited 1 time in total.
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: A problem with openscreen() in fullscreen

Post by jesperbrannmark »

Screen is grey on Mac anyhow. Is this a screen resolution your gfx card can handle?
User avatar
[blendman]
Enthusiast
Enthusiast
Posts: 297
Joined: Thu Apr 07, 2011 1:14 pm
Location: 3 arks
Contact:

Re: A problem with openscreen() in fullscreen

Post 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 ;)
Sirius-2337
User
User
Posts: 53
Joined: Sat May 14, 2011 10:39 am

Re: A problem with openscreen() in fullscreen

Post by Sirius-2337 »

For me, adding a CloseScreen() before the CloseWindow() makes it work.
User avatar
[blendman]
Enthusiast
Enthusiast
Posts: 297
Joined: Thu Apr 07, 2011 1:14 pm
Location: 3 arks
Contact:

Re: A problem with openscreen() in fullscreen

Post by [blendman] »

Yes, I have forget the CloseScreen(), Sorry...

Thanks ;)
Post Reply