It is currently Mon Dec 11, 2017 1:26 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 10:30 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 25, 2013 5:38 am
Posts: 189
Location: Australia
How do you create a windowed full screen? I've been searching but can't find much.

Edit, I found some code on the forum and this is what I came up with. Am I doing it right?

Code:
InitSprite()
InitKeyboard()
InitMouse()

#Flags=#PB_Window_Invisible|#PB_Window_Maximize|#PB_Window_BorderLess
OpenWindow(0,0,0,320,240,"screen",#Flags)
HideWindow(0,#False)
;SmartWindowRefresh(0,#True)

OpenWindowedScreen(WindowID(0),0,0,WindowWidth(0),WindowHeight(0),0,0,0,#PB_Screen_NoSynchronization)

Repeat
  ClearScreen(8723235)
  FlipBuffers()
  Repeat
    Event = WindowEvent()
    If Event = #PB_Event_CloseWindow : Quit = 1 : EndIf
  Until Event = 0
  ExamineKeyboard()
  ExamineMouse()
  If KeyboardReleased(#PB_Key_Escape) : Quit = 1 : EndIf
Until Quit


Last edited by coco2 on Mon Jan 09, 2017 11:16 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 11:03 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 21, 2011 9:11 am
Posts: 580
Location: France
Code:
InitSprite()
InitKeyboard()

OpenScreen(1024, 768, 32, "")

Repeat     
  ClearScreen(RGB(75, 0, 130))
  ExamineKeyboard()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)

_________________

➽ Windows 10 - PB 5.45 LTS & PB 5.60

http://falsam.com & EasySprite.js
http://purebasic.chat - Code PureBasic
Image Pure Basic Francophone Community

Sorry for my bad english and the Dunning–Kruger effect.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 11:20 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 25, 2013 5:38 am
Posts: 189
Location: Australia
That's a "classic" full screen, I am trying to do "windowed" full screen. Have a look at my code.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 11:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 21, 2011 9:11 am
Posts: 580
Location: France
Ooops sorry. I read too quickly.

Without hide OpenWindow()
Code:
InitSprite()
InitKeyboard()
InitMouse()

OpenWindow(0, 0, 0, 0, 0, "FullScreen", #PB_Window_BorderLess | #PB_Window_Maximize)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0))

Repeat   
  Repeat
    Event = WindowEvent()
    If Event = #PB_Event_CloseWindow : Quit = 1 : EndIf
  Until Event=0
 
  ClearScreen(RGB(75, 0, 130))
  ExamineKeyboard()
  If KeyboardReleased(#PB_Key_Escape) : Quit = 1 : EndIf
  FlipBuffers() 
Until Quit

_________________

➽ Windows 10 - PB 5.45 LTS & PB 5.60

http://falsam.com & EasySprite.js
http://purebasic.chat - Code PureBasic
Image Pure Basic Francophone Community

Sorry for my bad english and the Dunning–Kruger effect.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 11:51 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 25, 2013 5:38 am
Posts: 189
Location: Australia
Thank you very nice example


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 12:08 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 25, 2013 5:38 am
Posts: 189
Location: Australia
Is there a way to disable Alt+F4 in windowed full screen mode? :?:


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 12:13 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 21, 2011 9:11 am
Posts: 580
Location: France
coco2 wrote:
Is there a way to disable Alt+F4 in windowed full screen mode? :?:
Code:
InitSprite()
InitKeyboard()
InitMouse()

OpenWindow(0, 0, 0, 0, 0, "FullScreen", #PB_Window_BorderLess | #PB_Window_Maximize)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0))

Repeat   
  Repeat : Until WindowEvent() = 0
 
  ClearScreen(RGB(75, 0, 130))
  ExamineKeyboard()
  FlipBuffers() 
 
Until KeyboardReleased(#PB_Key_Escape)

_________________

➽ Windows 10 - PB 5.45 LTS & PB 5.60

http://falsam.com & EasySprite.js
http://purebasic.chat - Code PureBasic
Image Pure Basic Francophone Community

Sorry for my bad english and the Dunning–Kruger effect.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 1:19 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 25, 2013 5:38 am
Posts: 189
Location: Australia
Thank you, yes my bad I forgot I was quitting with #PB_Event_CloseWindow

I just need to code it in to my game.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Mon Jan 09, 2017 11:57 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 1963
Location: USA
I'm curious. Why a full screen window?

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.9.5 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: XP SP3 / AMD 64 4000+ / 1GB DDR / ATI 9250


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Tue Jan 10, 2017 3:01 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 25, 2013 5:38 am
Posts: 189
Location: Australia
Keep in mind I'm a beginner at this and I'm just stating my opinion. The classic full screen is old school. You need to code in a special way of handling alt+tab. It can only output to one screen (desktop 0 in Purebasic). I want my game engine to have the ability to output to 3 screens.


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Tue Jan 10, 2017 4:12 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3108
https://msdn.microsoft.com/en-us/librar ... 58(v=vs.85).aspx

Quote:
Because an application running in full-screen mode takes over the screen, debugging the application requires either a separate monitor or the use of a remote debugger. Use the DirectX Control Panel Tool to enable multiple-monitor debugging. One advantage of a windowed-mode application is that you can step through the code in a debugger without multiple monitors or a remote debugger.


https://www.thurrott.com/windows/window ... windows-10

Quote:
Full screen exclusive mode was created back in the original release of DirectDraw to provide games with enhanced performance when using the entire screen,” Mr,. Langley says. “The downside of full screen exclusive mode is that it makes the experience for gamers who wish to do other things on their system, such as alt-tab to another application or run the Windows GameDVR, more clunky with excessive flicker and transition time. We thought it would be cool if gamers could have the versatility of gaming in a window with the performance of full screen exclusive. So, with Windows 10, DirectX 12 games which take up the entire screen perform just as well as the old full screen exclusive mode without any of the full screen exclusive mode disadvantages.


Etc..

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Tue Jan 10, 2017 4:13 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3108
https://msdn.microsoft.com/en-us/librar ... 58(v=vs.85).aspx

Quote:
Because an application running in full-screen mode takes over the screen, debugging the application requires either a separate monitor or the use of a remote debugger. Use the DirectX Control Panel Tool to enable multiple-monitor debugging. One advantage of a windowed-mode application is that you can step through the code in a debugger without multiple monitors or a remote debugger.


https://www.thurrott.com/windows/window ... windows-10

Quote:
Full screen exclusive mode was created back in the original release of DirectDraw to provide games with enhanced performance when using the entire screen,” Mr,. Langley says. “The downside of full screen exclusive mode is that it makes the experience for gamers who wish to do other things on their system, such as alt-tab to another application or run the Windows GameDVR, more clunky with excessive flicker and transition time.


Etc..

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Windowed Full Screen
PostPosted: Fri Dec 01, 2017 4:33 pm 
Offline
User
User

Joined: Wed Dec 31, 2014 1:01 pm
Posts: 58
Just wanted to add a reason to use a real Fullscreen.
If you have a monitor that has a very high resolution a fullscreen window will always be that high resolution, which could cause slow performance.
With a real fullscreen you can set it to any allowed resolution. The lower resolution the faster performance.

Otherwise I also like the OS friendly way of the fullscreen window. Especially when you have multiple monitors. But its not always the best.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye