ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > Help and Support > Force a resolution in OpenGL mode on Linux? (GIT Version)
Force a resolution in OpenGL mode on Linux? (GIT Version)
  Author    Thread Reply to topic
aubade



Joined: 14 Feb 2011
Posts: 3
Force a resolution in OpenGL mode on Linux? (GIT Version) 

Hi! I'm trying to get ScummVM to play a game fullscreen in a particular resolution (640x400), using the new OpenGL scalers in the Git version (current snapshot as of Feb 13 2011). This is on Ubuntu Maverick, Nvidia proprietary drivers.

It seems to always want to run at 1680x1050, my monitor's native resolution, even when i use xrandr to set my desktop to 640x400

Is there any way of getting past this, or just plain forcing ScummVM to use a particular resolution when it OpenGL mode?

 Reply with quote  
Post Mon Feb 14, 2011 6:55 am 
 View user's profile Send private message
Mr_Nutz



Joined: 23 Jun 2007
Posts: 32
 

You've to fiddle with the sources for that, but you CAN force any resolution you want for the SDL-OpenGL filters.

Take a look at the ::setupFullScreenMode method in backends/graphics/openglsdl/openglsdl_graphics.cpp

Leave the SDL_Rect* declaration (first line in the moethod's code), and you can delete the rest of it.
Now just add:

_videoMode.hardwareWidth = <your resolution width>
_videoMode.hardwareHeight = <your resolution height>
return true;

rebuild and there you go! Smile

 Reply with quote  
Post Mon Feb 14, 2011 3:33 pm 
 View user's profile Send private message
aubade



Joined: 14 Feb 2011
Posts: 3
 

While i hope some time in the future, there's a more elegant way of accomplishing this, that worked perfectly for my current needs Very Happy Thanks!

 Reply with quote  
Post Mon Feb 14, 2011 10:34 pm 
 View user's profile Send private message
LordHoto
ScummVM Developer


Joined: 30 Oct 2005
Posts: 1030
Location: Germany
 

quote:
Originally posted by aubade
While i hope some time in the future, there's a more elegant way of accomplishing this, that worked perfectly for my current needs :D Thanks!


You can press Ctrl+Alt+Plus or Ctrl+Alt+Minus to change the display resolution when using an OpenGL mode.
 Reply with quote  
Post Mon Feb 14, 2011 11:10 pm 
 View user's profile Send private message
aubade



Joined: 14 Feb 2011
Posts: 3
 

....then it will be there in the future, and is there in the present. Sweet! Sorry to bother all of you. Smile

 Reply with quote  
Post Tue Feb 15, 2011 2:02 am 
 View user's profile Send private message
LordHoto
ScummVM Developer


Joined: 30 Oct 2005
Posts: 1030
Location: Germany
 

I checked again and it seems they real hotkeys for that are:

Ctrl+Shift+Enter and Ctrl+Shift+Backspace

 Reply with quote  
Post Wed Feb 16, 2011 3:58 pm 
 View user's profile Send private message
efen3001



Joined: 09 Jul 2006
Posts: 9
 

Worked like a charm, thanks!!!

 Reply with quote  
Post Thu Nov 19, 2015 12:12 am 
 View user's profile Send private message
hexaae



Joined: 25 Jun 2010
Posts: 37
 

Great, exactly what I wanted! 1080p was very blurred, better 640x480.
'CTRL ALT -' and 'CTRL ALT +' work fine on Windows 10!

P.S.:
ScummVM in OpenGL (Options > Mode: OpenGL (no filter)) can also be streamed through Steam Broadcast Smile

 Reply with quote  
Post Tue Feb 21, 2017 1:51 pm 
 View user's profile Send private message
almeath



Joined: 14 Mar 2008
Posts: 34
 

I am trying to produce a forced fullscreen resolution of 1920x1440 (4:3) in a MacOS build of ScummVM when using OpenGL graphics. However, I cannot find the same references in the openflsdl-graphics.cpp that Mr_Nutz mentions above.

Can anyone advise me on what edits I will need to make to achieve my desired resolution? I am using Xcode 8.2.1.

The background to this is that I cannot get a particular game (King's Quest V - Macintosh version) to adhere to a 4:3 ratio in fullscreen mode. The forced aspect ratio correction feature appears to be broken for this game only, despite other SCI games of the period working properly.

I know this is an obscure problem for a rarely used port of the game, but any suggestions would be welcome.

Original post:

http://forums.scummvm.org/viewtopic.php?t=14303

 Reply with quote  
Post Sat Mar 25, 2017 5:16 am 
 View user's profile Send private message
envisaged0ne



Joined: 01 Nov 2010
Posts: 143
Location: United States
 

It's probably not broken. Some games intentionally won't allow you to change aspect ratios because it can mess up the graphics. For example, the Windows CD version of KQ6 won't allow you to change resolutions either because it will mess up the high res character graphics So the ability to change resolutions is locked out

 Reply with quote  
Post Sat Mar 25, 2017 6:46 am 
 View user's profile Send private message
almeath



Joined: 14 Mar 2008
Posts: 34
 

I guess that is possible, but I found that when the game is run natively in MacOS 7 at 640x480, the "expand window" setting compresses the graphics into a 4:3 ratio, as I detailed with comparative screen shots in my post linked above.

I suppose that proves the graphics are capable of being displayed in 4:3 mode without breaking anything, but it seems to be an ability specific to the original Mac application only.

This issue aside, I would still be interested if anyone knows about how to successfully edit the openflsdl-graphics.cpp in MacOS X to force a custom full screen resolution?

 Reply with quote  
Post Sat Mar 25, 2017 11:31 am 
 View user's profile Send private message
criezy
ScummVM Developer


Joined: 23 Sep 2006
Posts: 455
Location: West Sussex, UK
 

Without changing the source code and recompiling, you can set the preferred resolution in your config file (on MacOS X the file is "~/Library/Preferences/ScummVM Preferences"):

code:

[scummvm]
last_fullscreen_mode_height=900
last_fullscreen_mode_width=1600



When ScummVM switches to fullscreen it tries to reuse the last resolution used if possible (i.e. if the OS, graphics card and driver allow it). So if the resolution you want can be used, it will be.

As mentionner above by LordHoto, you can also cycle between the available resolutions in fullscreen mode by using the following keyboard shortcuts: Ctrl+Alt+Plus or Ctrl+Alt+Minus

If you really want to change the source code, the relevant code is in OpenGLSdlGraphicsManager::setupMode(uint width, uint height). You could for example change the lines 467 and 468.


Note: All this is only valid if you use the OpenGL graphics mode in the ScummVM graphics option. For all the other modes (e.g. normal, 2x, HQ2x...) it works in a different way and the source code is in a different place (in surfacesdl-graphics.cpp)
 Reply with quote  
Post Sat Mar 25, 2017 12:21 pm 
 View user's profile Send private message
almeath



Joined: 14 Mar 2008
Posts: 34
 

Thanks. The config file settings work well, and I have been able to force various resolutions in fullscreen mode.

With that I can confirm that the issue I am experiencing with King's Quest V has nothing to do with the resolution or graphics settings. It is simply that the 'aspect ratio' command has no effect on the Mac port of this game, and is therefore something that cannot be resolved with any settings.

 Reply with quote  
Post Sat Mar 25, 2017 4:27 pm 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 



Forum Rules:
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
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge