added netstandard project
This commit is contained in:
parent
c455638dd1
commit
c73ba80a84
6 changed files with 117 additions and 11 deletions
|
@ -340,7 +340,7 @@ namespace OpenTK.Graphics.ES20
|
||||||
{
|
{
|
||||||
GL.Viewport(0, 0, size.Width, size.Height);
|
GL.Viewport(0, 0, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
|
#if !MINIMAL
|
||||||
public static void Viewport(Point location, Size size)
|
public static void Viewport(Point location, Size size)
|
||||||
{
|
{
|
||||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||||
|
@ -350,7 +350,7 @@ namespace OpenTK.Graphics.ES20
|
||||||
{
|
{
|
||||||
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||||
}
|
}
|
||||||
#if MINIMAL
|
#else
|
||||||
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
||||||
{
|
{
|
||||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||||
|
|
|
@ -335,7 +335,7 @@ namespace OpenTK.Graphics.ES30
|
||||||
{
|
{
|
||||||
GL.Viewport(0, 0, size.Width, size.Height);
|
GL.Viewport(0, 0, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
|
#if !MINIMAL
|
||||||
public static void Viewport(Point location, Size size)
|
public static void Viewport(Point location, Size size)
|
||||||
{
|
{
|
||||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||||
|
@ -345,7 +345,7 @@ namespace OpenTK.Graphics.ES30
|
||||||
{
|
{
|
||||||
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||||
}
|
}
|
||||||
#if MINIMAL
|
#else
|
||||||
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
||||||
{
|
{
|
||||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||||
|
|
|
@ -2772,7 +2772,7 @@ namespace OpenTK.Graphics.OpenGL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if MINIMAL
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// [requires: v1.0]
|
/// [requires: v1.0]
|
||||||
/// Set the viewport. This function assumes a lower left corner of (0, 0).
|
/// Set the viewport. This function assumes a lower left corner of (0, 0).
|
||||||
|
@ -2814,7 +2814,7 @@ namespace OpenTK.Graphics.OpenGL
|
||||||
{
|
{
|
||||||
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||||
}
|
}
|
||||||
#if MINIMAL
|
#else
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// [requires: v1.0]
|
/// [requires: v1.0]
|
||||||
/// Set the viewport.
|
/// Set the viewport.
|
||||||
|
|
|
@ -411,7 +411,7 @@ namespace OpenTK.Graphics.OpenGL4
|
||||||
{
|
{
|
||||||
GL.Viewport(0, 0, size.Width, size.Height);
|
GL.Viewport(0, 0, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
|
#if !MINIMAL
|
||||||
public static void Viewport(Point location, Size size)
|
public static void Viewport(Point location, Size size)
|
||||||
{
|
{
|
||||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||||
|
@ -421,7 +421,7 @@ namespace OpenTK.Graphics.OpenGL4
|
||||||
{
|
{
|
||||||
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||||
}
|
}
|
||||||
#if MINIMAL
|
#else
|
||||||
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
||||||
{
|
{
|
||||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||||
|
|
99
src/OpenTK/OpenTK.Standard.csproj
Normal file
99
src/OpenTK/OpenTK.Standard.csproj
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyName>OpenTK</AssemblyName>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<RootNamespace>OpenTK</RootNamespace>
|
||||||
|
<DefineConstants>$(DefineConstants);WIN32;CARBON;X11;SDL2;OPENGL;OPENGLES;MINIMAL</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
|
<BaseAddress>285212672</BaseAddress>
|
||||||
|
<ConfigurationOverrideFile>
|
||||||
|
</ConfigurationOverrideFile>
|
||||||
|
<DocumentationFile>bin\Debug\OpenTK.xml</DocumentationFile>
|
||||||
|
<FileAlignment>4096</FileAlignment>
|
||||||
|
<Optimize>False</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<RegisterForComInterop>False</RegisterForComInterop>
|
||||||
|
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
|
<BaseAddress>285212672</BaseAddress>
|
||||||
|
<ConfigurationOverrideFile>
|
||||||
|
</ConfigurationOverrideFile>
|
||||||
|
<DocumentationFile>bin\Release\OpenTK.xml</DocumentationFile>
|
||||||
|
<FileAlignment>4096</FileAlignment>
|
||||||
|
<Optimize>True</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<RegisterForComInterop>False</RegisterForComInterop>
|
||||||
|
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>True</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>..\..\OpenTK.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Graphics\ES31\**" />
|
||||||
|
<Compile Remove="Platform\Android\**" />
|
||||||
|
<Compile Remove="Platform\iPhoneOS\**" />
|
||||||
|
<Compile Remove="Resources\**" />
|
||||||
|
<EmbeddedResource Remove="Graphics\ES31\**" />
|
||||||
|
<EmbeddedResource Remove="Platform\Android\**" />
|
||||||
|
<EmbeddedResource Remove="Platform\iPhoneOS\**" />
|
||||||
|
<EmbeddedResource Remove="Resources\**" />
|
||||||
|
<None Remove="Graphics\ES31\**" />
|
||||||
|
<None Remove="Platform\Android\**" />
|
||||||
|
<None Remove="Platform\iPhoneOS\**" />
|
||||||
|
<None Remove="Resources\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AdditionalFiles Include="$(SolutionDir)\stylecop.json">
|
||||||
|
<Link>stylecop.json</Link>
|
||||||
|
</AdditionalFiles>
|
||||||
|
<AdditionalFiles Include="$(SolutionDir)\stylecop.ruleset">
|
||||||
|
<Link>stylecop.ruleset</Link>
|
||||||
|
</AdditionalFiles>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
<Version>1.0.1</Version>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk -debug -netstandard" Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Debug'" />
|
||||||
|
<Exec Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk -netstandard" Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Release'" />
|
||||||
|
<Exec Command="mono $(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk -debug -netstandard" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" />
|
||||||
|
<Exec Command="mono $(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk -netstandard" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" />
|
||||||
|
</Target>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<MonoDevelop>
|
||||||
|
<Properties>
|
||||||
|
<Policies>
|
||||||
|
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" />
|
||||||
|
<CSharpFormattingPolicy IndentSwitchBody="True" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ElseNewLinePlacement="NewLine" CatchNewLinePlacement="NewLine" FinallyNewLinePlacement="NewLine" WhileNewLinePlacement="NewLine" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" BeforeIndexerDeclarationBracket="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" BlankLinesBeforeFirstDeclaration="1" AlignToFirstMethodDeclarationParameter="False" AlignToFirstIndexerDeclarationParameter="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
|
||||||
|
<TextStylePolicy FileWidth="120" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
|
||||||
|
<StandardHeader Text="#region License

${FileName}
 
Author:
 ${AuthorName} <${AuthorEmail}>

Copyright (c) 2006-${Year} ${CopyrightHolder}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

#endregion" IncludeInNewFiles="True" />
|
||||||
|
<TextStylePolicy TabWidth="2" IndentWidth="2" NoTabsAfterNonTabs="True" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="application/xml" />
|
||||||
|
<XmlFormattingPolicy inheritsSet="Mono" inheritsScope="application/xml" scope="application/xml" />
|
||||||
|
</Policies>
|
||||||
|
</Properties>
|
||||||
|
</MonoDevelop>
|
||||||
|
</ProjectExtensions>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="4.5.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Properties\" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -44,8 +44,11 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
private const ExtendedWindowStyle ParentStyleEx = ExtendedWindowStyle.WindowEdge | ExtendedWindowStyle.ApplicationWindow;
|
private const ExtendedWindowStyle ParentStyleEx = ExtendedWindowStyle.WindowEdge | ExtendedWindowStyle.ApplicationWindow;
|
||||||
private const ExtendedWindowStyle ChildStyleEx = 0;
|
private const ExtendedWindowStyle ChildStyleEx = 0;
|
||||||
|
#if NETSTANDARD
|
||||||
|
private readonly IntPtr Instance = Functions.GetModuleHandle(typeof(WinGLNative).Module.Name);
|
||||||
|
#else
|
||||||
private readonly IntPtr Instance = Marshal.GetHINSTANCE(typeof(WinGLNative).Module);
|
private readonly IntPtr Instance = Marshal.GetHINSTANCE(typeof(WinGLNative).Module);
|
||||||
|
#endif
|
||||||
private readonly IntPtr ClassName = Marshal.StringToHGlobalAuto(Guid.NewGuid().ToString());
|
private readonly IntPtr ClassName = Marshal.StringToHGlobalAuto(Guid.NewGuid().ToString());
|
||||||
private readonly WindowProcedure WindowProcedureDelegate;
|
private readonly WindowProcedure WindowProcedureDelegate;
|
||||||
|
|
||||||
|
@ -1240,11 +1243,15 @@ namespace OpenTK.Platform.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if !NETSTANDARD
|
||||||
Debug.Assert(oldCursorHandle != IntPtr.Zero);
|
Debug.Assert(oldCursorHandle != IntPtr.Zero);
|
||||||
Debug.Assert(oldCursorHandle != cursor_handle);
|
Debug.Assert(oldCursorHandle != cursor_handle);
|
||||||
Debug.Assert(oldCursor != cursor);
|
Debug.Assert(oldCursor != cursor);
|
||||||
|
#else
|
||||||
|
System.Diagnostics.Debug.Assert(oldCursorHandle != IntPtr.Zero);
|
||||||
|
System.Diagnostics.Debug.Assert(oldCursorHandle != cursor_handle);
|
||||||
|
System.Diagnostics.Debug.Assert(oldCursor != cursor);
|
||||||
|
#endif
|
||||||
// If we've replaced a custom (non-default) cursor we need to free the handle.
|
// If we've replaced a custom (non-default) cursor we need to free the handle.
|
||||||
if (oldCursor != MouseCursor.Default)
|
if (oldCursor != MouseCursor.Default)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue