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 / proper window rescaling?

Author
Message
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 5th Jul 2010 18:03 Edited at: 6th Jul 2010 12:37
Is there anyway to prevent the stretching caused by rescaling the window?
It's kind of the only thing holding back my project and I would really appreciate it if someone would help me get past it.

desired result:
1: unscaled window
2: scaled window, no pixel stretching.


Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Jul 2010 12:38
I'm bumping this because it has been overlooked.

TyJBr2
AGK Backer
16
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 6th Jul 2010 12:50 Edited at: 6th Jul 2010 13:25
I have been using this assorted.dll to stop window resizing with

I cant find the link so I'll just attach a zip with it in it.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jul 2010 13:17
You could get the window size, then set the resolution to that, but it usually means reloading all your images again, or keep them as memblocks if possible, then convert back to images when they get lost.


Health, Ammo, and bacon and eggs!
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Jul 2010 14:17
@ TyJBr2
I don't want to stop the resizing, I want to stop the pixel stretching.

@ Van B
I tried that, it worked, but is there a way that doesn't require a full media reload?

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jul 2010 14:56
Just thoughts from me, I don't know how to code this. You could set the camera view according to the window size. So if the window has been resized 2 times bigger, set the camera view 2 times smaller.

TheComet

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jul 2010 15:15
I'm not too sure Link, something rings a bell about the display mode, maybe there's a display mode that retains the media, but I wouldn't bank on it.

I had this issue with my Netbook game, as that has to be able to minimise etc, so I just did a check before the sync to see if the image still exists, if it's gone, then I re-setup the media. It's something that people should just do anyway, because I've forgotten the number of times a virus warning or whatever has killed a DBPro executable. The only true way to avoid loading media, is to have it in another format, ie, a memblock image, just sitting waiting to be converted to a proper image. That would be the fastest method. But, in my game I load up a good few megs of data, probably 5 or 6 screens worth, and it's pretty much un-noticable. It makes your application that much more stable and reliable. I plan to do that with every project from now on, even if it is a pain in the neck.


Health, Ammo, and bacon and eggs!
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Jul 2010 15:31 Edited at: 6th Jul 2010 16:22
@TheComet

like this?
It's stil stretching.


@ van B
I'll try it.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jul 2010 15:46
Hmm, why doesn't DBP compile the command "get window width()"?

TheComet

TyJBr2
AGK Backer
16
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 6th Jul 2010 15:47
Quote: "
desired result:
1: unscaled window
2: scaled window, no pixel stretching.
"


I thought you meant 1 an unscaled window ,a window that could not be scaled.
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Jul 2010 16:00 Edited at: 9th Jul 2010 16:59
@ TheComet
It's a matrix1 command, a plugin.
Get it here, it's very useful

@ TyJBr2
That's supposed to be a before/after picture, but I can see where you're coming from.

@ Van B
It's actually quite smooth.


DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 6th Jul 2010 20:14 Edited at: 6th Jul 2010 20:28
Don't think it is possible Without a dll of some sort.

http://s6.bitefight.org/c.php?uid=103081
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Jul 2010 20:41 Edited at: 6th Jul 2010 20:41
That's good news to me. I'd like to get my hands on such a dll.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 6th Jul 2010 20:50 Edited at: 6th Jul 2010 21:17
Can I ask why you want such an effect? It seems an odd way to scale a window to me. Normally you would want your screen layout to be locked in position.

I have had a go not sure if this is what you want. Bit of a bodge though.


Obviously it doesn't work with resizing the screen manually using the mouse, you would have to lock the window size to stop people doing that. Then use your own options. If IanM's matrix utils can give you the current window size rather than the screen size then you could use that to scale the sprite or object. I'm not sure if it has that function or not. Not used any dlls for a while.

http://s6.bitefight.org/c.php?uid=103081
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 7th Jul 2010 03:07
after the resizing of the window you have to delete the backbuffer and create a new one with the desired size and you'll have the no streching effect. That's maybe be possible by calling some of the directx plugins and functions in them, i don't know but it's probably possible with a plugin which doesn't exist - you'll have to create it by yourself or ask someone to do it for you.

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 9th Jul 2010 15:54
Well it sounds logical enough\, But I don't know anything about about dll's let alone how to get one working with the darkbasic window.

Does anyone know anyone that could create such a dll?

@DVader

It's for a level editor, I wish to make it windowed.

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Jul 2010 15:58 Edited at: 9th Jul 2010 15:58
Even with a dll it involves resetting the device, which requires reloading all media. It's a feature/limitation of directx.

[b]
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Jul 2010 16:12
There is a way to use image libraries now, so say you have all your GUI images as a big file, then that's just 1 file to load in to fix up your interface. Then, you'll probably have access to the textures and models the editor is using 'live', so maybe it'll be more straightforward than you think.

In my last project I was aware of this issue, so coded with it in mind, made a function to load and setup the media and keep it going when things go pear shaped. It's really an issue that we all have to deal with, if there was an easy fix then someone would have found it by now.

What concerns me, is that with editors you often have to switch to other applications, source images, design documents, online guides, spreadsheets - they have to be able to live through any sort of minimising, I don't think you can avoid the work involved in making it robust. You'll be glad you did in the future - all it takes is for an hour or 5's work to be lost due to your virus software throwing a fit or something.


Health, Ammo, and bacon and eggs!
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 9th Jul 2010 16:38 Edited at: 9th Jul 2010 23:43
I've lost count of how many times Hammer (half life level editor) crashed on me.

Well for the editor I'm planning on making, I'll have to keep track of all the loaded textures anyway, since they have to be saved in the map file.
But if you have a game with any object that hasn't got it's coordinates stored, it's going to be reset to 0 upon reload.

Login to post a reply

Server time is: 2026-07-25 08:11:56
Your offset time is: 2026-07-25 08:11:56