Beispiel #1
0
            static SdlScreens()
            {
                int displays = GetNumVideoDisplays();
                devices = new IScreen[displays];
                for (int d = 0; d < displays; d++)
                {
                    IRectangle bounds;
                    SdlFactory.GetDisplayBounds(d, out Rect rc);
                    bounds = Factory.newRectangle(rc.X, rc.Y, rc.Width, rc.Height);

                    SdlFactory.GetCurrentDisplayMode(d, out DisplayMode dm);

                    int total = GetNumDisplayModes(d);
                    var list = new IResolution[total];

                    for (int m = 0; m < total; m++)
                    {
                        GetDisplayMode(d, m, out DisplayMode sdm);
                        list[m] = new SdlResolution(bounds.X, bounds.Y, sdm.Width, sdm.Height, sdm.Format, sdm.RefreshRate);
                    }

                    var current_resolution = new SdlResolution(bounds.X, bounds.Y, dm.Width, dm.Height, dm.Format, dm.RefreshRate);
                    var device = new SdlScreen(current_resolution, d == 0, list, bounds, d);

                    devices[d] = (device);
                    if (d == 0)
                        primary = device;
                }
            }
Beispiel #2
0
                /// <summary>Determines whether the specified resolutions are equal.</summary>
                /// <param name="obj">The System.Object to check against.</param>
                /// <returns>True if the System.Object is an equal DisplayResolution; false otherwise.</returns>
                public override bool Equals(object obj)
                {
                    if (obj == null)
                    {
                        return false;
                    }
                    if (this.GetType() == obj.GetType())
                    {
                        SdlResolution res = (SdlResolution)obj;
                        return
                            Width == res.Width &&
                            Height == res.Height &&
                            BitsPerPixel == res.BitsPerPixel &&
                            RefreshRate == res.RefreshRate;
                    }

                    return false;
                }