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.

DarkBASIC Professional Discussion / image doesn't load in fullscreen mode?

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Mar 2011 22:12
I set the display mode to 1280x720x32 and all works fine running in Window mode. But when I set the properties for fullscreen, I get an error when trying to paste the image, not when loading it with the "load image" command. Same thing for any sprites that were created, I can't paste them either in fullscreen mode. If I try to use the "sprite" command in my main loop, it'll tell me the image number is illegal which must mean that the images aren't being loaded and yet I receive no errors when loading them. But as I've said, all images work fine in window mode. I am running dual monitors if that's an issue.

The Internet: Where men are men, women are men, and children are federal agents
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Mar 2011 01:27
Simple sample project and code? From your description it only needs to be a few lines.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Mar 2011 07:44


I've also noticed that when I move the window over to the other monitor (my tv) the framerates drop to an unusable low amount.

The Internet: Where men are men, women are men, and children are federal agents
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 11th Mar 2011 13:15
It suggests that yr graphics card is unsuitable for that resolution.
Check the screen resolution options from the control panel to see which resolutions you can safely use at full screen and re-design yr layout to suit.
Alternatively, continue to run in windows mode but use "Set Window Layout" in yr program to hide the window border title bar & minimize buttons.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Mar 2011 21:24
I know I can support that resolution, I've use 1280x720 in COD all the time.

The Internet: Where men are men, women are men, and children are federal agents
Westmere
16
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 17th Mar 2011 22:23
Do you load the images AFTER or BEFORE you set the screen resolution?

If it jumps to another screen resolution all graphics data currently loaded will be gone, causing just this error message. If you stay in a windowed mode all the time it will also keep all graphics data.

Same is true if you tab out and back into a running up, something that needs to be worked around.

So if you load the images and then change to fullscreen mode you might want to turn this around.

BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 18th Mar 2011 08:22 Edited at: 18th Mar 2011 08:24
Hmmm....I tested a large image, bigger than the screen resolution thinking that might be it, still worked,
don't know what is not happy with your system.

If is has worked in the past, what has changed with your system?
New Monitor
New Video Card Driver
Different Computer
What is different than before, when it used to work?
GantZ_yaka
15
Years of Service
User Offline
Joined: 22nd Feb 2011
Location:
Posted: 18th Mar 2011 08:40
I have a similar problem.
i am creating menu for my game and when player chande in game options resolution or fullscreen mode - game always crashing.
try this simple code and you will understand what I mean.
is it real to change screen resolution or windowed mode in real time you have to reload all objects ang images in scene??
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Mar 2011 10:08
I'm not sure that Phaelax's issue is because of loosing media. Have you tried moving the window with code - so position the window in the other display and see if the frame rate still sucks. Maybe DBPro just doesn't like running anywhere but the primary display.

Whenever the window state changes, looses focus etc, it can loose your media. I tend to have an image exist check before the sync, and if a loaded image has disappeared, I load the media back in again. Maybe make your media loading part a function that you can re-call safely, something like:

load_media()
Do
paste image 1,0,0
if image exist(1)=0 then load_media()
sync
Loop

function load_media()
safeloadimage("background.png",1)
endfunction

function safeloadimage(fn$,img)
if image exist(img)=1 then exitfunction
load image fn$,img
endfunction

So it will check to see if the image is loaded and load it up accordingly. Programs can exist in the background, minimised, alt-tabbed etc a lot more reliably with that sort of thing.

Health, Ammo, and bacon and eggs!
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Mar 2011 02:58
Never in my system has changed, but I've never tried setting the resolution anywhere in code before except for the very top. The only thing above the display call is some UDTs and variables, all images are loaded after the display change.

As far as the speed goes with my TV, I noticed it speeds up significantly if I use 720 in the app instead of 1080. Maybe it's just my video card. My monitor uses hdmi but I'm using vga to the tv. I'm gonna buy a dvi to hdmi cable so i can have both on HDMI.

Right now, my work around is to use the user32 dll to get the desktop width and position the window to the right by that amount, then change the window decoration to show no title or frame. But it's not the same as being in exclusive fullscreen mode.

That's a good idea Van, I'll implement a function and see how it goes.

The Internet: Where men are men, women are men, and children are federal agents

Login to post a reply

Server time is: 2026-07-16 23:18:50
Your offset time is: 2026-07-16 23:18:50