Initial pixel resolution.

Blitz3D Forums/Blitz3D Beginners Area/Initial pixel resolution.

Santiworld(Posted 2016) [#1]
I would like to ask you for advice.

When I compile a game, I usually read from a conf.txt file the resolution that the game will have.

The few people who download a game of mine have to modify that file to put the resolution they want.

How can I ensure that I will not have resolution incompatibilities, and how can I make users choose a resolution from a menu?

I am afraid to use an initial resolution in a menu that on some screens is not compatible.

regards!


Flanker(Posted 2016) [#2]
Search for the command CountGfxModes3D() in the documentation wich provides a little example to select a compatible screen size.


RemiD(Posted 2016) [#3]
You can choose to not show some resolutions which are not compatible with your camera view and gui.

Here is a way to do it :
http://www.blitzbasic.com/codearcs/codearcs.php?code=3229
(you will have to modify it to only show the resolutions which are compatible with your camera view and gui)

Note than you can have a camera view which use only a part of the graphics window... So, you could have your camera view at the center of the graphics window and add borders at left/right (when the screen has too much width and not enough height (= a weird ratio))




Matty(Posted 2016) [#4]
Use a windowed mode launcher that allows them to test the resolution.

Exe for launcher - calls count graphics modes command and displays a list (along with any other set up options and config options) run it in windowed mode.

When user selects 'launch' it launches with the selected graphics mode based on the one chosen or a default which is the smallest one by area that you deem acceptable from the count graphics modes list.


Santiworld(Posted 2016) [#5]
oka! thanks for the answers!!!


Yue(Posted 2016) [#6]
Local   nR% = CountGfxModes()

Dim anchoPantalla(nR%)
Dim altoPantalla( nR%)





For t% = 1 To CountGfxModes()
	
	anchoPantalla(t%)  = GfxModeWidth(t)
	altoPantalla(t%) =  GfxModeHeight(t)
	
	

	If anchoPantalla(t%) = 800 And altoPantalla(t%) = 600 Then 
		
		Graphics3D 800, 600,32, 2 
		SetBuffer BackBuffer()
		
	Else If anchoPantalla(t%) = 1024 And altoPantalla(t%) = 768 Then 
		
		Graphics3D 1024, 768,32, 2 
		SetBuffer BackBuffer()
		
	End If 
	
	
	
Next

WaitKey()



jfk EO-11110(Posted 2016) [#7]
Remid said something important about screen ratio.

When the physical screen has eg. 1920*1080 pixels and you run it with fullscreen 640*480, it will be very distorted, due to the 16:9 physical and 4:3 rendered ratio.

This can be corrected with Cameraviewport, eg:

let's say, for simplicity, the monitor has 1440*960 pixel. Half would be 720*480, in correct aspect ratio. So you simply set cameraviewport to that size, since 720-640 is 80, you say
cameraviewport camera, -40,0,720,480

In order to do this automaticly, check the users desktop resolution for a fairly save reference of the physical aspect ratio, by a userlib call of GetSystemMetrics, that you may find explained around here.