diff --git a/ANX.Framework/GraphicsDeviceManager.cs b/ANX.Framework/GraphicsDeviceManager.cs index 08b05cd7..62d4df74 100644 --- a/ANX.Framework/GraphicsDeviceManager.cs +++ b/ANX.Framework/GraphicsDeviceManager.cs @@ -204,7 +204,7 @@ namespace ANX.Framework //TODO: validate graphics device - this.graphicsDevice = new GraphicsDevice(deviceInformation.Adapter, deviceInformation.GraphicsProfile,deviceInformation.PresentationParameters); + this.graphicsDevice = new GraphicsDevice(deviceInformation.Adapter, deviceInformation.GraphicsProfile, deviceInformation.PresentationParameters); GraphicsResourceTracker.Instance.UpdateGraphicsDeviceReference(this.graphicsDevice); //TODO: hookup events diff --git a/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs b/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs index 1270dadb..e040c345 100644 --- a/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs +++ b/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs @@ -6,6 +6,7 @@ using ANX.RenderSystem.GL3.Helpers; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Platform; +using OpenTK.Platform.X11; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. @@ -375,9 +376,12 @@ namespace ANX.RenderSystem.GL3 } else { - LinuxInterop.ResizeWindow(presentationParameters.DeviceWindowHandle, - presentationParameters.BackBufferWidth, - presentationParameters.BackBufferHeight); + if (nativeWindowInfo != null) + { + LinuxInterop.ResizeWindow(IntPtr.Zero, presentationParameters.DeviceWindowHandle, + presentationParameters.BackBufferWidth, + presentationParameters.BackBufferHeight); + } } } #endregion diff --git a/RenderSystems/ANX.Framework.GL3/Helpers/LinuxInterop.cs b/RenderSystems/ANX.Framework.GL3/Helpers/LinuxInterop.cs index 6d221ceb..08c3cdd5 100644 --- a/RenderSystems/ANX.Framework.GL3/Helpers/LinuxInterop.cs +++ b/RenderSystems/ANX.Framework.GL3/Helpers/LinuxInterop.cs @@ -2,6 +2,7 @@ using System; using System.Reflection; using System.Runtime.InteropServices; using OpenTK.Platform; +using ANX.Framework.NonXNA; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. @@ -46,9 +47,8 @@ namespace ANX.RenderSystem.GL3.Helpers [DllImport("libX11")] private static extern int XPending(IntPtr diplay); - [DllImport("libX11")] - private static extern void XResizeWindow(IntPtr display, IntPtr window, - int width, int height); + [DllImport("libX11", EntryPoint = "XResizeWindow")] + private static extern void XResizeWindow(IntPtr display, IntPtr window, int width, int height); #endregion #region GetStaticFieldValue @@ -108,10 +108,17 @@ namespace ANX.RenderSystem.GL3.Helpers #endregion #region ResizeWindow - public static void ResizeWindow(IntPtr windowHandle, int backBufferWidth, + public static void ResizeWindow(IntPtr display, IntPtr windowHandle, int backBufferWidth, int backBufferHeight) { - XResizeWindow(IntPtr.Zero, windowHandle, backBufferWidth, backBufferHeight); + try + { + XResizeWindow(display, windowHandle, backBufferWidth, backBufferHeight); + } + catch (Exception e) + { + Logger.Error("GL3 XResizeWindow", e); + } } #endregion } diff --git a/Samples/SimpleNoContent/SimpleNoContent.csproj b/Samples/SimpleNoContent/SimpleNoContent.csproj index 2c02e36e..bbec55cf 100644 --- a/Samples/SimpleNoContent/SimpleNoContent.csproj +++ b/Samples/SimpleNoContent/SimpleNoContent.csproj @@ -62,9 +62,9 @@ {068eb2e9-963c-4e1b-8831-e25011f11ffe} ANX.PlatformSystem.Windows - - {5be49183-2f6f-4527-ac90-d816911fcf90} - ANX.RenderSystem.Windows.DX10 + + {eb8258e0-6741-4db9-b756-1ebdf67b1ed6} + ANX.RenderSystem.GL3 {c4ddffff-595e-4089-b499-06f68caf2566} diff --git a/Samples/SimpleNoContent/SimpleNoContent_Linux.csproj b/Samples/SimpleNoContent/SimpleNoContent_Linux.csproj index b9a25c62..a737d697 100644 --- a/Samples/SimpleNoContent/SimpleNoContent_Linux.csproj +++ b/Samples/SimpleNoContent/SimpleNoContent_Linux.csproj @@ -53,10 +53,18 @@ {49066074-3b7b-4a55-b122-6bd33ab73558} ANX.InputSystem.Standard - + + {eb8258e0-6741-4db9-b756-1ebdf67b1ed6} + ANX.RenderSystem.GL3 + + {c4ddffff-595e-4089-b499-06f68caf2566} ANX.SoundSystem.Null + + {14ef49ab-6d3f-458d-9d5c-d120b86edd7a} + ANX.SoundSystem.OpenAL +