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

NullReferenceException when creating GraphicsDevice #5089

Closed
WardBenjamin opened this issue Aug 7, 2016 · 2 comments
Closed

NullReferenceException when creating GraphicsDevice #5089

WardBenjamin opened this issue Aug 7, 2016 · 2 comments

Comments

@WardBenjamin
Copy link
Contributor

When creating a GraphicsDevice as so:

        GraphicsAdapter adapter = GraphicsAdapter.DefaultAdapter;
        GraphicsProfile profile = GraphicsProfile.Reach;
        PresentationParameters pp = new PresentationParameters() {
            DeviceWindowHandle = windowHandle,
            BackBufferWidth = Math.Max(width, 1),
            BackBufferHeight = Math.Max(height, 1),
        };

        _device = new GraphicsDevice(adapter, profile, pp);

MonoGame fails internally with a NullReferenceException at Microsoft.Xna.Framework.Graphics.GraphicsAdapter.CurrentDisplayMode.get().

Here's a few images of the locals and the call stack.

capture

capture

capture

@lynFerns
Copy link

Did you ever find a solution to this? I've run into the same issue.

@Jjagg
Copy link
Contributor

Jjagg commented Dec 8, 2018

Consequence of #2586. Closing this since it's easier to track the cause and this will be fixed when #2586 is fixed.

@Jjagg Jjagg closed this as completed Dec 8, 2018
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