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 Discussion / Window Mode and Background Images

Author
Message
Kronos 001
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 23rd Feb 2010 05:09
I'm not sure if this is breaking a rule or not. I have another thread regarding a similar issue, and I asked this in my last comment there, but it's been a few days, and I feel like the thread has been forgotten since the main issue has been resolved.

Anywho, if it's not breaking a rule: I have my game running all nice and shiny, with it's background and all, but when I hit 'w' to go into Window Mode the background image goes away. The game still works, but it doesn't look as shiny. How do I fix this?

I'm using the Paste Image command [paste image 1, 0 , 0]

Umm...I'm just going to copy / paste the main bit of code, just in case.



-Teh Nub-
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Feb 2010 10:38
If you put this on the shelf and then look at it in 3 months, you're gonna kick yourself because it will probably be too hard to decipher because of how you've laid out your code.



But anyway, you should be aware that chaining if thens on the same line can disqualify code further down. As soon as an if condition isn't true, it stops reading the line. So if you have stuff on the line that you intended to test, it mau never get to that if the first condition is false.

For example:



"c=3" will never print even though it is separated by a : because if b=5 is false. The if c=3 clause will never be reached.

Quote: "it's background and all, but when I hit 'w' to go into Window Mode the background image goes away."

For your question, if you change from Fullscreen mode to windowed mode, the video display is changed and that will wipe out your textures and mess up your images. If you switch modes, you'll have to reload your images and reset your 3d. This example shows how stuff is getting wiped out:



Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Feb 2010 10:59
Quote: "if a=1 then print "a=1" : if b=5 then print "b=5" : if c=3 then print "c=3""


Exactly as Latch says. Another way of writing that would be:



If you run your application in fullscreen and use alt+tab to go out and back in, the same result will occur. You can use the command screen invalid() to check if the screen has been switched. If so, reload all of your stuff.

TheComet

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Feb 2010 12:09
Quote: "If you put this on the shelf and then look at it in 3 months, you're gonna kick yourself because it will probably be too hard to decipher because of how you've laid out your code."


Precisely!

This is annoying because in the other post I as much as told you this and pointed you to the solution... which you decided to completely ignore and instead start another thread with the same question.

So although not technically 'breaking the rules', you aren't helping yourself. Once users on here see that you ignore their advice, they simply won't help you any more.

TDK

Kronos 001
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 23rd Feb 2010 13:43
TDK, it is honestly better than it was before. I can find where I need to be a lot easier than I used to. I realize it\'s still sloppy, but please don\'t think I completely ignored you. I read those tutorials.

As for the question I asked, and you guys answered; Thanks. And I feel retarded, because I figured it out literally within 5 minutes of posting this thread, and I thought, "oh crap. That was a waste of a post." It wasn\'t me getting confused and posting for help either, I ran into the problem a few days ago and was confused.

....

thanks, and sorry.

-Teh Nub-
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 23rd Feb 2010 20:48 Edited at: 23rd Feb 2010 20:49
Quote: "If you run your application in fullscreen and use alt+tab to go out and back in, the same result will occur. You can use the command screen invalid() to check if the screen has been switched. If so, reload all of your stuff."


An easier way is to create the illusion of fullscreen - call this at the top of your code:



These include calls to the winAPI (Windows core elements), so you can access data DBC can't get normally. It allows you to set the window to be the same size as the desktop - it looks like its running in fullscreen, but it allows you to switch program using Alt+Tab without damaging the textures!

For other tips and tricks, try here. The download in the first post is quite handy!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Feb 2010 20:50
@Robert

That is of course also an option, but the display mode will be at it's maximum and therefor slow down the game by a small amount.

TheComet

Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 23rd Feb 2010 20:53
Ah, but couldn't you just try:


Window is the desktop size, but display mode is 640x480. I think it should be low-resolution enlarged to fill the screen - or would that just create a tiny image in the middle of a large black screen?
(Can't test right now, can't get to DBC)

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Feb 2010 00:10
Quote: "or would that just create a tiny image in the middle of a large black screen?"


I'm pretty sure that is what it does

TheComet

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 24th Feb 2010 01:11
I think dbc centers it in the middle of the window. Sadly. I have used that method of 'fake' fullscreen in dbpro before.

New Site! Check it out \/

Login to post a reply

Server time is: 2024-04-27 02:11:23
Your offset time is: 2024-04-27 02:11:23