some minor GL3 RenderSystem tweaking

This commit is contained in:
Glatzemann 2012-11-29 11:09:02 +00:00 committed by Konstantin Koch
parent 749fa0a5f1
commit 4096a16846
5 changed files with 32 additions and 13 deletions

View File

@ -204,7 +204,7 @@ namespace ANX.Framework
//TODO: validate graphics device //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); GraphicsResourceTracker.Instance.UpdateGraphicsDeviceReference(this.graphicsDevice);
//TODO: hookup events //TODO: hookup events

View File

@ -6,6 +6,7 @@ using ANX.RenderSystem.GL3.Helpers;
using OpenTK.Graphics; using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL; using OpenTK.Graphics.OpenGL;
using OpenTK.Platform; using OpenTK.Platform;
using OpenTK.Platform.X11;
// This file is part of the ANX.Framework created by the // This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license. // "ANX.Framework developer group" and released under the Ms-PL license.
@ -375,9 +376,12 @@ namespace ANX.RenderSystem.GL3
} }
else else
{ {
LinuxInterop.ResizeWindow(presentationParameters.DeviceWindowHandle, if (nativeWindowInfo != null)
presentationParameters.BackBufferWidth, {
presentationParameters.BackBufferHeight); LinuxInterop.ResizeWindow(IntPtr.Zero, presentationParameters.DeviceWindowHandle,
presentationParameters.BackBufferWidth,
presentationParameters.BackBufferHeight);
}
} }
} }
#endregion #endregion

View File

@ -2,6 +2,7 @@ using System;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using OpenTK.Platform; using OpenTK.Platform;
using ANX.Framework.NonXNA;
// This file is part of the ANX.Framework created by the // This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license. // "ANX.Framework developer group" and released under the Ms-PL license.
@ -46,9 +47,8 @@ namespace ANX.RenderSystem.GL3.Helpers
[DllImport("libX11")] [DllImport("libX11")]
private static extern int XPending(IntPtr diplay); private static extern int XPending(IntPtr diplay);
[DllImport("libX11")] [DllImport("libX11", EntryPoint = "XResizeWindow")]
private static extern void XResizeWindow(IntPtr display, IntPtr window, private static extern void XResizeWindow(IntPtr display, IntPtr window, int width, int height);
int width, int height);
#endregion #endregion
#region GetStaticFieldValue #region GetStaticFieldValue
@ -108,10 +108,17 @@ namespace ANX.RenderSystem.GL3.Helpers
#endregion #endregion
#region ResizeWindow #region ResizeWindow
public static void ResizeWindow(IntPtr windowHandle, int backBufferWidth, public static void ResizeWindow(IntPtr display, IntPtr windowHandle, int backBufferWidth,
int backBufferHeight) int backBufferHeight)
{ {
XResizeWindow(IntPtr.Zero, windowHandle, backBufferWidth, backBufferHeight); try
{
XResizeWindow(display, windowHandle, backBufferWidth, backBufferHeight);
}
catch (Exception e)
{
Logger.Error("GL3 XResizeWindow", e);
}
} }
#endregion #endregion
} }

View File

@ -62,9 +62,9 @@
<Project>{068eb2e9-963c-4e1b-8831-e25011f11ffe}</Project> <Project>{068eb2e9-963c-4e1b-8831-e25011f11ffe}</Project>
<Name>ANX.PlatformSystem.Windows</Name> <Name>ANX.PlatformSystem.Windows</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\RenderSystems\ANX.RenderSystem.Windows.DX10\ANX.RenderSystem.Windows.DX10.csproj"> <ProjectReference Include="..\..\RenderSystems\ANX.Framework.GL3\ANX.RenderSystem.GL3.csproj">
<Project>{5be49183-2f6f-4527-ac90-d816911fcf90}</Project> <Project>{eb8258e0-6741-4db9-b756-1ebdf67b1ed6}</Project>
<Name>ANX.RenderSystem.Windows.DX10</Name> <Name>ANX.RenderSystem.GL3</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Null\ANX.SoundSystem.Null.csproj"> <ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Null\ANX.SoundSystem.Null.csproj">
<Project>{c4ddffff-595e-4089-b499-06f68caf2566}</Project> <Project>{c4ddffff-595e-4089-b499-06f68caf2566}</Project>

View File

@ -53,10 +53,18 @@
<Project>{49066074-3b7b-4a55-b122-6bd33ab73558}</Project> <Project>{49066074-3b7b-4a55-b122-6bd33ab73558}</Project>
<Name>ANX.InputSystem.Standard</Name> <Name>ANX.InputSystem.Standard</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Null\ANX.SoundSystem.Null.csproj"> <ProjectReference Include="..\..\RenderSystems\ANX.Framework.GL3\ANX.RenderSystem.GL3_Linux.csproj">
<Project>{eb8258e0-6741-4db9-b756-1ebdf67b1ed6}</Project>
<Name>ANX.RenderSystem.GL3</Name>
</ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Null\ANX.SoundSystem.Null_Linux.csproj">
<Project>{c4ddffff-595e-4089-b499-06f68caf2566}</Project> <Project>{c4ddffff-595e-4089-b499-06f68caf2566}</Project>
<Name>ANX.SoundSystem.Null</Name> <Name>ANX.SoundSystem.Null</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.OpenAL\ANX.SoundSystem.OpenAL_Linux.csproj">
<Project>{14ef49ab-6d3f-458d-9d5c-d120b86edd7a}</Project>
<Name>ANX.SoundSystem.OpenAL</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="anx.ico" /> <Content Include="anx.ico" />