Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Tier 1] My game goes black randomly

Author
Message
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 30th Nov 2017 19:17
When I compile and run the game, it sometimes just shows a black screen. Its about every ten times or so. Does anyone have a clue why?


PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 30th Nov 2017 19:58
Ran the code for 60 times in a row, no black screen


PSY LABS Games
Coders don't die, they just gosub without return
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 30th Nov 2017 20:39
The thing should run in full screen:

SetWindowSize( 1024, 1024, 1 )
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th Nov 2017 21:32
That's for a window that's full screen, not actual full screen (windowless)

Create a file called setup.agc and put this in it:


basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 30th Nov 2017 23:03 Edited at: 30th Nov 2017 23:17
I have never tried setup.agc before, so I'm pretty clueless here. But still, the "1" in the command below sets the game to fullscreen, by which I mean that from a totally non-techy user perspective, it looks to me as being "fullscreen" instead of being inside a window:

SetWindowSize( 1024, 1024, 1 )

So I don't really understand ... Or maybe you are saying that fullscreen by setup.agc is a "better" fullscreen?
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 1st Dec 2017 00:12
A "full screen window" isn't the same as full screen without a window.

I personally don't like full screen windows so don't use them at all. I am certain that windowless fullscreen is faster in AppGameKit in most (all?) cases.

SetWindowSize( 1024, 1024, 1 ) creates a window which is goes full screen and borderless, but a window still.

Using the fullscreen switch in setup.agc makes your app use windowless full screen. I just think it's more elegant and removes some ambiguity or potential problems with various cards and drivers.

I found a video which covers the difference and explains a bit more detail, although not particularly conclusive. Different engines have different results.



Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 1st Dec 2017 00:37
Does AGKv2 still use setup.agc ?
The coffee is lovely dark and deep,and I have code to write before I sleep.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 1st Dec 2017 09:44
Quote: "Does AGKv2 still use setup.agc ?"

No. Not any more.
Click here for VR Legend of Zelda stuff
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 1st Dec 2017 14:47
That is what I thought. nZ0 what version of agk are you using?
The coffee is lovely dark and deep,and I have code to write before I sleep.
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 1st Dec 2017 17:08
My version also uses setup.agc -- Couldn't find the version number, though
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 1st Dec 2017 23:07
Still works, always worked.
Just tested it both ways current version.
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 4th Dec 2017 10:33
This sounds strange. It seems like setup.agc is outdated, and should no longer be used. Yet, it's the only way to get windowless fullscreen?
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 4th Dec 2017 11:12
Quote: "SetWindowSize( 1024, 1024, 1 ) creates a window which is goes full screen and borderless, but a window still.

Using the fullscreen switch in setup.agc makes your app use windowless full screen. I just think it's more elegant and removes some ambiguity or potential problems with various cards and drivers."


As far as I'm aware based on Paul's past comments, both versions are technically identical and will create a borderless fullscreen window. setup.agc has long been deprecated.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 4th Dec 2017 14:11 Edited at: 4th Dec 2017 14:15
Before everyone starts yelling at me, I am only guessing here...

Maybe your monitors refresh rate is causing it since it happens to you and not everyone.

Try using SetSyncRate instead of SetVSync, so it doesn't link to the monitor's refresh rate.

Again, only guessing, but it won't hurt to try it.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 4th Dec 2017 15:00
Thanks, might be it. I was using a Surface tablet pc. I'm on a different rig now, will see if it persists.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 4th Dec 2017 19:46
Quote: "As far as I'm aware based on Paul's past comments, both versions are technically identical and will create a borderless fullscreen window. setup.agc has long been deprecated."


There a two distinct behaviors with either mode for me.

I can see the window draw them maximise using SetWindowSize( 1024, 1024, 1 ) and is a borderless fullscreen window.

The setup.agc method goes directly to fullscreen (not a borderless window). They aren't the same thing either.

Hopefully, Paul can elaborate.

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 5th Dec 2017 09:05 Edited at: 5th Dec 2017 09:07
Quote: "The setup.agc method goes directly to fullscreen (not a borderless window). They aren't the same thing either."

Actually they're both the same thing. A borderless window.
The setup.agc file just sets the window style in the initial stages before a window is created, whilst doing it in code changes the autogenerated window.

The easy way to see if its fullscreen or windowed fullscreen is to see if your desktop resolution changes when the AppGameKit app is ran. (Or if you still have an older CRT monitor, you'll actually hear the resolution change. Yes, you'll hear it change.) To be honest, native fullscreen apps have died out it seems, everything is just a fullscreen borderless window now as the performance benefits to running natively fullscreen have been offset by greater graphics/cpu hardware.
Click here for VR Legend of Zelda stuff
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 5th Dec 2017 12:05
Mobiius wrote: " (Or if you still have an older CRT monitor, you'll actually hear the resolution change. Yes, you'll hear it change.) "


Man, this one sucked me straight into the dark realm of nostalgia!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 5th Dec 2017 12:40
Glad i'm not the only one old enough to remember! lol
Click here for VR Legend of Zelda stuff
mayduavongts
6
Years of Service
User Offline
Joined: 6th Dec 2017
Location:
Posted: 6th Dec 2017 03:55
Thanks for sharing, nice post!

Login to post a reply

Server time is: 2024-03-29 14:27:49
Your offset time is: 2024-03-29 14:27:49