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

Debug assert with wrong resolution. #278

Open
emelrad12 opened this issue Jul 12, 2023 · 3 comments
Open

Debug assert with wrong resolution. #278

emelrad12 opened this issue Jul 12, 2023 · 3 comments

Comments

@emelrad12
Copy link

emelrad12 commented Jul 12, 2023

image

Freshly cloned repo, on 4k display. I am running the demo project. I am using windows 125% scaling, so perhaps something breaks there? This error was not present in previous versions.

Removing the debug asserts, makes it work again, with no noticable issues, like screen clipping, or anything else broken.

@RossNordby
Copy link
Member

Presumably there was a reason for that assert at some point, but I no longer know what it was. It does indeed seem to work fine. I've removed the assert in 91f724e.

Thanks for the report!

@emelrad12
Copy link
Author

Okay so after playing around a little bit, your resizing when the dpi changes is broken, as the new window is the wrong size.
Afterwards it seems you are covering a bug by doing
Resolution = resolution;
which overrides the resolution provided by OpenTK, which seems to "fix" the bug, as open tk returns a window that is well n times larger(n being the scaling) that it should be. So if you are setting as right now 75% of screen with, it returns n * 75%, n > 1, which might cause n * 75% > 1. Which is clearly bug.

No idea how to correctly fix that, just reporting.

@damian-666
Copy link

I had to comment the assert first day i tried this on a MS surface.. wiht 150% scaling and default hires. This i just tried and it might fix the problem.

maybe look at this in the app manifest.. uncomment that. dpi awareness.

first you need to create an app manifest.. i use an external one. I think that will fix your issues. If you are using 150% or its hard to read.

If you use two monitors to debug, which is often needed unless there is a super nice tooling IDE wiht docking setup specific for you app,level editor,
you will need dpi awareness you drag a window across the two desktops.

i found the file
its gets called. app.Manifest i find it in the demo folder

-->
	<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
	<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
  <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>

I dont know if its compatible with the OpenTK , seems to be.

image

on and aside..

if anyone knows any tooling that does boilerplate or UI stuff , with openTK save current window state, or scripting, or general UI, like buttons and property sheets. if not exiting users of Bepu we should put that somewhere and share the effort.
or multiplatform hosting..

Avalonia UI is getting good.

its painful.. and its common use for anyone.

Also there is a thing called Avalonia.Inside that lets you use avalonia UI, scripting, Avalonia Edit, that as a tooling and embed a Monogame window in that.. its not great but gives some real time parameter tooling and scripting ability. via avalonia so you dont have to use two apps, yours and a hard debugger that blocks, just to tune some levels..

It can work with Avalonia and Docking , REact or WPF, either way

ideally a rigging with an editor like stride has and a with a soft debugger like CS-Script has made, that does not block threads but lets you adjust and inspect and not run a big debugger AND an game UI.. , and you make your own rigging IDE..

for debu in avalonia this might be a good rig.. then put your scripts in a dll and build with your game after.. your host in avalonia if tis fast enough an shares a backbuffer, not using a buffer unless you are doing lockless producer / consumer and have one anywasys.

https://wieslawsoltes.github.io/Dock/
https://github.com/SamboyCoding/OpenTKAvalonia

I use 150 scaling resolution and had to debug the assert. The real fix i think it this, i justed tested that it makes a difference in hi rest and 150 scaling, the default.

@emelrad12 emelrad12 changed the title Debug assert with rong resolution. Debug assert with wrong resolution. Jul 15, 2023
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