ForNeVeR / O21

FOSS remake of U95, an old submarine arcade game from 1995.
MIT License
22 stars 9 forks source link

Screen width and height config #139

Closed Fantoom closed 1 year ago

Fantoom commented 1 year ago

I think that we need a way to set screen width and height. We can do it as command line argument (--width and --height)

ForNeVeR commented 1 year ago

I am not against that, but why would we need that, provided the game window is resizeable?

Fantoom commented 1 year ago

By default it is 1200x800 and when I start it, the window edges are out of my screen. I can not resize :)

ForNeVeR commented 1 year ago
  1. I imagine you still can use hotkeys to control the window size. In Windows, Win+Arrows should make it manageable.
  2. Maybe we should better choose a default instead of (or together with) adding a command-line option.
Fantoom commented 1 year ago

1) I will try it, but I think, that many people do not know about it 2) What default value do you suggest?

ForNeVeR commented 1 year ago
  1. max theSizeWeWant userScreenSize
Fantoom commented 1 year ago

Ok, Win+Arrows helped me, but I still think, that we should provide some way for that

Fantoom commented 1 year ago
  1. max theSizeWeWant userScreenSize

What these values are? Is userScreenSize the acutal size of user's screen or the size user provided (as argument or whatever)? And what value for theSizeWeWant do we want? A predefined constant?

ForNeVeR commented 1 year ago

theSizeWeWant is the default, 1200×1600 or whatever. userScreenSize is the actual size of the screen we'll show our window on, we should investigate how to get that on Raylib's windowing system.

ForNeVeR commented 1 year ago

For userScreenSize, see Raylib's GetMonitorWidth(int) and such.

Fantoom commented 1 year ago

max theSizeWeWant userScreenSize

are you sure that we want the max? If the user has a lower resolution, the window will go out of the screen bounds

ForNeVeR commented 1 year ago

Ah, yeah, we want min actually, sorry for the confusion.

Fantoom commented 1 year ago

and what about GetScreenWidth(void) and GetScreenHeight(void)?

ForNeVeR commented 1 year ago

This is dubious: which screen do they use? Will it be the screen the game window is on?

Fantoom commented 1 year ago

https://www.raylib.com/cheatsheet/cheatsheet.html //Get current screen width

ForNeVeR commented 1 year ago

"The current screen" is not a very definitive term, is it?

Fantoom commented 1 year ago

Is int GetCurrentMonitor(void); // Get current connected monitor more definitive? I don't think so :)

ForNeVeR commented 1 year ago

Of course it is! It literally gives a definition for what is "the current monitor". It is the one returned by GetCurrentMonitor. Which we can read the sources to know more 😅

Fantoom commented 1 year ago

I have read sources and found out that GetScreenWidth returns CORE.Window.screen.width which is the width of used render area. So we need GetCurrentMonitor