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

Implemented GraphicsAdapter for DirectX platforms #5024

Merged
merged 1 commit into from Jul 23, 2016

Conversation

Projects
None yet
2 participants
@tomspilman
Copy link
Member

commented Jul 23, 2016

This PR cleans up GraphicsAdapter into a partial class allowing for other platforms to cleanly extend it.

Added unit tests to verify the DirectX implementation matches XNA behavior.

Left old implementation of GraphicsAdapter in legacy file that is used on the other public platforms. We should start replacing these with correct partial implementations.

@tomspilman tomspilman added this to the 3.6 Release milestone Jul 23, 2016

@tomspilman tomspilman force-pushed the SickheadGames:graphics_adapter branch from 9c9fe5c to 702f113 Jul 23, 2016

bool displayChanged = false;
#if DESKTOPGL
var displayIndex = Sdl.Display.GetWindowDisplayIndex (SdlGameWindow.Instance.Handle);
displayChanged = displayIndex != _displayIndex;

This comment has been minimized.

Copy link
@tomspilman

tomspilman Jul 23, 2016

Author Member

@dellis1972 - I tested on XNA and it doesn't seem to work this way at all.

The problem is you need to be creating one GraphicsAdapter per-monitor per-graphics device like the new DirectX implementation does. Then you just gather the modes for that one adapter which only covers one monitor.

Still how do you get the right adapter for the monitor the game window is in? Well XNA didn't seem to have a built in way to do that. It seems the idea was to somehow match the GraphicsAdapter.MonitorHandle with some GDI function.

What i suggest we instead add a DesktopBounds to each GraphicsAdapter allowing users to use their window bounds to pick an appropriate graphics adapter.

@tomspilman tomspilman force-pushed the SickheadGames:graphics_adapter branch 6 times, most recently from 64043fe to b726245 Jul 23, 2016

Refactor of GraphicsAdapter into partial class.
Implemented GraphicsAdapter for DirectX platforms.
Added unit tests for GraphicsAdapter.

@tomspilman tomspilman force-pushed the SickheadGames:graphics_adapter branch from b726245 to 60c6599 Jul 23, 2016

@tomspilman

This comment has been minimized.

Copy link
Member Author

commented Jul 23, 2016

This should be good to merge now.

@KonajuGames

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2016

Merging.

@KonajuGames KonajuGames merged commit 64973e3 into MonoGame:develop Jul 23, 2016

5 checks passed

Build Mac, iOS, and Linux Finished TeamCity Build MonoGame :: Build Mac : Running
Details
Build Windows, Web, Android, and OUYA Finished TeamCity Build MonoGame :: Build Windows : Running
Details
Package Mac and Linux Finished TeamCity Build MonoGame :: Package Mac and Linux : Running
Details
Package Windows SDK Finished TeamCity Build MonoGame :: Package Windows : Running
Details
Test Windows Finished TeamCity Build MonoGame :: Test Windows : Tests passed: 400
Details

@tomspilman tomspilman deleted the SickheadGames:graphics_adapter branch Jan 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.