Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Window/View Size Before Game Start #123

Open
11clock opened this issue Sep 18, 2021 · 2 comments
Open

Set Window/View Size Before Game Start #123

11clock opened this issue Sep 18, 2021 · 2 comments

Comments

@11clock
Copy link

11clock commented Sep 18, 2021

If your game’s virtual resolution (display width and display height) is different from what you want your initial window size to be, you need to call set_view_size on your game’s init. While this works, this function isn’t called until after the game has booted up, leaving your game at the actual display resolution for a few frames.

See the below game that was designed to be in 1080p, but has the view size being set to 720p on init (since a 1080p sized window is unreasonable on most displays).

https://i.gyazo.com/03a91663b2ce441fe80caebeb869af24.mp4

A means to set a starting window/view size separate from the display width and height would be nice.

@subsoap
Copy link
Owner

subsoap commented Sep 18, 2021

I'm not sure if this is possible to do with a native extension. Unless somehow we are able to override the default GLFW 2.5 window view size on extension init, and if that is soon enough to prevent the appearance of a larger initial window view size. If that was possible then maybe we could access a game.project setting within native extension init to force an actual extension init window view size that's different from the one set in game.project and used by the engine to determine various view related sizings/orientations.

@11clock I recommend you forking DefOS and just testing to see if hard coding a smaller initial window size within the extension init function works to to solve your issue or not.

@AGulev
Copy link
Collaborator

AGulev commented Sep 19, 2021

Issue will be fixed after merging this PR #124 (Pls pay attention that this fix can't be applied before a fix in the engine, read PR description)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants