Fixed capitalization of Texture2D etc.
This commit is contained in:
parent
ecda68e709
commit
d8860a6aaa
14 changed files with 1237 additions and 7 deletions
329
Source/Examples/Examples.csproj
Normal file
329
Source/Examples/Examples.csproj
Normal file
|
@ -0,0 +1,329 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4BE3065D-7798-4322-9356-C7259DDBD787}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>Examples</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>
|
||||
</AppDesignerFolder>
|
||||
<RootNamespace>Examples</RootNamespace>
|
||||
<StartupObject>Examples.ExampleLauncher</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;</DefineConstants>
|
||||
<DocumentationFile>OpenTK.xml</DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\Binaries\Release\Examples\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>DEBUG;TRACE;</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\Binaries\Debug\Examples\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
<HintPath>\System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<Name>System.Drawing</Name>
|
||||
<HintPath>\System.Drawing.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<Name>System.Windows.Forms</Name>
|
||||
<HintPath>\System.Windows.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
<HintPath>\System.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenTK\OpenTK.csproj">
|
||||
<Name>OpenTK</Name>
|
||||
<Project>{BE736391-17D4-46AB-950D-673A4A32791F}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ExampleAttribute.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ExampleLauncher.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ExampleLauncher.Designer.cs">
|
||||
<DependentUpon>ExampleLauncher.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IExample.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tests\TestResolutionChanges.cs" />
|
||||
<Compile Include="Utilities.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="OpenAL\TestAudioContext.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="OpenGL\GluTessellation.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="OpenGL\TessellatorClass.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Shapes\Cube.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Shapes\IsoSphere.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Shapes\Plane.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Shapes\Shape.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tests\MathSpeed.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tests\S01_Call_Performance.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tests\S04_Input_Logger.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tests\S04_Input_Logger.Designer.cs">
|
||||
<DependentUpon>S04_Input_Logger.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\Fonts.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T01_Simple_Window.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T02_Vertex_Arrays.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T03_Immediate_Mode_Cube.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T04_Vertex_Lighting.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T07_Display_Lists_Flower.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T08_VBO.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\T10_GLSL_Cube.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\Text.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tutorial\Textures.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\DerivedGLControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\DerivedGLControl.Designer.cs">
|
||||
<DependentUpon>DerivedGLControl.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W01_First_Window.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W01_First_Window.Designer.cs">
|
||||
<DependentUpon>W01_First_Window.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W02_Immediate_Mode_Cube.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W02_Immediate_Mode_Cube.Designer.cs">
|
||||
<DependentUpon>W02_Immediate_Mode_Cube.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W03_Extensions.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W03_Extensions.Designer.cs">
|
||||
<DependentUpon>W03_Extensions.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W04_Multiple_GLControls.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WinForms\W04_Multiple_GLControls.Designer.cs">
|
||||
<DependentUpon>W04_Multiple_GLControls.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<None Include="..\Examples\Data\logo-dark.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\logo.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\metal.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Poem.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\all-wcprops">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\entries">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\format">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\prop-base\logo-dark.jpg.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\prop-base\logo.jpg.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\prop-base\metal.jpg.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\text-base\logo-dark.jpg.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\text-base\logo.jpg.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\text-base\metal.jpg.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\.svn\text-base\Poem.txt.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\Simple_FS.glsl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\Simple_VS.glsl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\.svn\all-wcprops">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\.svn\entries">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\.svn\format">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\.svn\text-base\Simple_FS.glsl.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\Examples\Data\Shaders\.svn\text-base\Simple_VS.glsl.svn-base">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Poem.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Shaders\Simple_FS.glsl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Shaders\Simple_VS.glsl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\OpenTK\OpenTK.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
25
Source/Examples/Examples.csproj.user
Normal file
25
Source/Examples/Examples.csproj.user
Normal file
|
@ -0,0 +1,25 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>
|
||||
</ReferencePath>
|
||||
<LastOpenVersion>8.0.50727</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
<PublishUrlHistory>
|
||||
</PublishUrlHistory>
|
||||
<InstallUrlHistory>
|
||||
</InstallUrlHistory>
|
||||
<SupportUrlHistory>
|
||||
</SupportUrlHistory>
|
||||
<UpdateUrlHistory>
|
||||
</UpdateUrlHistory>
|
||||
<BootstrapperUrlHistory>
|
||||
</BootstrapperUrlHistory>
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
</Project>
|
321
Source/Examples/OpenGL/TessellatorClass.cs
Normal file
321
Source/Examples/OpenGL/TessellatorClass.cs
Normal file
|
@ -0,0 +1,321 @@
|
|||
#region --- License ---
|
||||
/* Copyright (c) 2006-2008 the OpenTK team
|
||||
* See license.txt for licensing details
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
using OpenTK;
|
||||
using OpenTK.OpenGL;
|
||||
using OpenTK.OpenGL.Enums;
|
||||
using OpenTK.OpenAL;
|
||||
using OpenTK.OpenAL.Enums;
|
||||
using OpenTK.Audio;
|
||||
using OpenTK.Input;
|
||||
using System.Runtime.InteropServices;
|
||||
using OpenTK.Math;
|
||||
|
||||
namespace Examples
|
||||
{
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Defines a single Vertex in 3d space, with double-precision numerals.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
class Vertex : CustomVertex
|
||||
{
|
||||
#region --- Constructors ---
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Vertex.
|
||||
/// </summary>
|
||||
/// <param name="x">The position of the Vertex on the x-axis.</param>
|
||||
/// <param name="y">The position of the Vertex on the y-axis.</param>
|
||||
/// <param name="z">The position of the Vertex on the z-axis.</param>
|
||||
public Vertex(double x, double y, double z)
|
||||
: this(new Vector3d(x, y, z)) { }
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Vertex.
|
||||
/// </summary>
|
||||
/// <param name="v">The position of the Vertex.</param>
|
||||
public Vertex(Vector3d v)
|
||||
{
|
||||
Position = v;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The position of this verrtex.
|
||||
/// </summary>
|
||||
public Vector3d Position;
|
||||
|
||||
public override double[] ToArray()
|
||||
{
|
||||
return new double[] { Position.X, Position.Y, Position.Z };
|
||||
}
|
||||
}
|
||||
|
||||
[Example("GLU Tesselation Functions Test", ExampleCategory.OpenGL)]
|
||||
public class GluTesselation : GameWindow
|
||||
{
|
||||
/*
|
||||
Vertex[] rect = new Vertex[4]
|
||||
{
|
||||
new Vertex(50.0f, 50.0f, 0.0f),
|
||||
new Vertex(200.0f, 50.0f, 0.0f),
|
||||
new Vertex(200.0f, 200.0f, 0.0f),
|
||||
new Vertex(50.0f, 200.0f, 0.0f)
|
||||
};
|
||||
*/
|
||||
|
||||
Vertex[] rect = new Vertex[4]
|
||||
{
|
||||
new Vertex(50.0, 50.0, 0.0),
|
||||
new Vertex(200.0, 50.0, 0.0),
|
||||
new Vertex(200.0, 200.0, 0.0),
|
||||
new Vertex(50.0, 200.0, 0.0)
|
||||
};
|
||||
Vertex[] tri = new Vertex[3]
|
||||
{
|
||||
new Vertex(75.0f, 75.0f, 0.0f),
|
||||
new Vertex(125.0f, 175.0f, 0.0f),
|
||||
new Vertex(175.0f, 75.0f, 0.0f)
|
||||
};
|
||||
double[][] star = new double[5][] {
|
||||
new double[] {250.0f, 50.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
new double[] {325.0f, 200.0f, 0.0f, 1.0f, 1.0f, 0.0f},
|
||||
new double[] {400.0f, 50.0f, 0.0f, 0.0f, 1.0f, 1.0f},
|
||||
new double[] {250.0f, 150.0f, 0.0f, 1.0f, 0.0f, 0.0f},
|
||||
new double[] {400.0f, 150.0f, 0.0f, 0.0f, 1.0f, 0.0f}
|
||||
};
|
||||
|
||||
Tessellator<double[]> tess = new Tessellator<double[]>();
|
||||
int startList;
|
||||
|
||||
public GluTesselation()
|
||||
: base()
|
||||
{
|
||||
Keyboard.KeyDown += KeyDownHandler;
|
||||
}
|
||||
|
||||
#region --- GLU Tessellation callbacks ---
|
||||
|
||||
#region BeginHandler
|
||||
|
||||
void BeginHandler(BeginMode mode)
|
||||
{
|
||||
GL.Begin(mode);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region EndHandler
|
||||
|
||||
void EndHandler()
|
||||
{
|
||||
GL.End();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region VertexHandler
|
||||
|
||||
void VertexHandler(IntPtr v)
|
||||
{
|
||||
unsafe { GL.Vertex3((double*)v); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ErrorHandler
|
||||
|
||||
void ErrorHandler(GluErrorCode code)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show(
|
||||
String.Format("GLU Error {0}: {1}", code.ToString(), Glu.ErrorString(code)),
|
||||
"An error occured while tesselating.");
|
||||
this.Exit();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CombineHandler
|
||||
|
||||
unsafe double*[] combineData = new double*[16];
|
||||
int data_index = 0;
|
||||
unsafe void CombineHandler(double[] coordinates, CustomVertex[] dataIn, float[] weight, out CustomVertex[] dataOut)
|
||||
{
|
||||
Vertex[] results = new Vertex[2];
|
||||
Vertex[] data = (Vertex[])dataIn;
|
||||
|
||||
results[0].Position.X = coordinates[0];
|
||||
results[0].Position.Y = coordinates[1];
|
||||
results[0].Position.Z = coordinates[2];
|
||||
|
||||
results[1].Position.X = weight[0] * data[0].Position.X +
|
||||
weight[1] * data[0].Position.X +
|
||||
weight[2] * data[0].Position.X +
|
||||
weight[3] * data[0].Position.X;
|
||||
|
||||
results[1].Position.Y = weight[0] * data[0].Position.Y +
|
||||
weight[1] * data[0].Position.Y +
|
||||
weight[2] * data[0].Position.Y +
|
||||
weight[3] * data[0].Position.Y;
|
||||
|
||||
|
||||
results[1].Position.Z = weight[0] * data[0].Position.Z +
|
||||
weight[1] * data[0].Position.Z +
|
||||
weight[2] * data[0].Position.Z +
|
||||
weight[3] * data[0].Position.Z;
|
||||
|
||||
dataOut = (CustomVertex[])results;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region KeyDownHandler
|
||||
|
||||
public void KeyDownHandler(KeyboardDevice sender, Key key)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case Key.Escape:
|
||||
this.Exit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnResize
|
||||
|
||||
protected override void OnResize(OpenTK.Platform.ResizeEventArgs e)
|
||||
{
|
||||
GL.Viewport(0, 0, Width, Height);
|
||||
GL.MatrixMode(MatrixMode.Projection);
|
||||
GL.LoadIdentity();
|
||||
Glu.Ortho2D(0.0, (double)Width, 0.0, (double)Height);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnLoad
|
||||
|
||||
public override void OnLoad(EventArgs e)
|
||||
{
|
||||
GL.ClearColor(System.Drawing.Color.SteelBlue);
|
||||
|
||||
// Create a rectangle with a triangle cut out from its middle.
|
||||
tess.BeginCallback += this.BeginHandler;
|
||||
tess.EndCallback += this.EndHandler;
|
||||
tess.ErrorCallback += this.ErrorHandler;
|
||||
tess.CombineCallback += this.CombineHandler;
|
||||
tess.VertexCallback += this.VertexHandler;
|
||||
|
||||
startList = GL.GenLists(2);
|
||||
GL.NewList(startList, ListMode.Compile);
|
||||
GL.ShadeModel(ShadingModel.Flat);
|
||||
|
||||
tess.BeginPolygon(null);
|
||||
|
||||
tess.BeginContour();
|
||||
tess.Vertex(rect[0], rect[0]);
|
||||
tess.Vertex(rect[1], rect[1]);
|
||||
tess.Vertex(rect[2], rect[2]);
|
||||
tess.Vertex(rect[3], rect[3]);
|
||||
tess.EndContour();
|
||||
|
||||
tess.BeginContour();
|
||||
tess.Vertex(tri[0], tri[0]);
|
||||
tess.Vertex(tri[1], tri[1]);
|
||||
tess.Vertex(tri[2], tri[2]);
|
||||
tess.EndContour();
|
||||
|
||||
tess.EndPolygon();
|
||||
|
||||
GL.EndList();
|
||||
|
||||
ErrorCode code = GL.GetError();
|
||||
if (code != ErrorCode.NoError)
|
||||
throw new Exception(String.Format("OpenGL Error \"{0}\": {1}", code.ToString(), Glu.ErrorString(code)));
|
||||
|
||||
tess.Dispose();
|
||||
|
||||
// Create a self-intersecting star
|
||||
tess = new Tessellator<double[]>();
|
||||
tess.BeginCallback += this.BeginHandler;
|
||||
tess.EndCallback += this.EndHandler;
|
||||
tess.ErrorCallback += this.ErrorHandler;
|
||||
tess.CombineCallback += this.CombineHandler;
|
||||
tess.VertexCallback += this.VertexHandler;
|
||||
|
||||
GL.NewList(startList + 1, ListMode.Compile);
|
||||
GL.ShadeModel(ShadingModel.Smooth);
|
||||
tess.WindingRule(TessWinding.TessWindingPositive);
|
||||
|
||||
tess.BeginPolygon(null);
|
||||
|
||||
tess.BeginContour();
|
||||
tess.Vertex(star[0], star[0]);
|
||||
tess.Vertex(star[1], star[1]);
|
||||
tess.Vertex(star[2], star[2]);
|
||||
tess.Vertex(star[3], star[3]);
|
||||
//tess.Vertex(star[4], star[4]);
|
||||
tess.EndContour();
|
||||
|
||||
tess.EndPolygon();
|
||||
|
||||
GL.EndList();
|
||||
|
||||
tess.Dispose();
|
||||
tess = null;
|
||||
|
||||
code = GL.GetError();
|
||||
if (code != ErrorCode.NoError)
|
||||
throw new Exception(String.Format("OpenGL Error \"{0}\": {1}", code.ToString(), Glu.ErrorString(code)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnUnload
|
||||
|
||||
public override void OnUnload(EventArgs e)
|
||||
{
|
||||
GL.DeleteLists(startList, 3);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnRenderFrame
|
||||
|
||||
public override void OnRenderFrame(RenderFrameEventArgs e)
|
||||
{
|
||||
GL.Clear(ClearBufferMask.ColorBufferBit);
|
||||
|
||||
GL.Color3(1.0f, 1.0f, 1.0f);
|
||||
GL.CallList(startList);
|
||||
GL.CallList(startList + 1);
|
||||
GL.Flush();
|
||||
|
||||
this.SwapBuffers();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
using (GluTesselation test = new GluTesselation())
|
||||
{
|
||||
Utilities.SetWindowTitle(test);
|
||||
test.Run(30.0, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
469
Source/Examples/OpenTK.xml
Normal file
469
Source/Examples/OpenTK.xml
Normal file
|
@ -0,0 +1,469 @@
|
|||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Examples</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="F:Examples.WinForms.DerivedGLControl.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.DerivedGLControl.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.DerivedGLControl.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tests.S04_Input_Logger.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Examples.Tests.S04_Input_Logger.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tests.S04_Input_Logger.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.Tests.S04_Input_Logger.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W03_Extensions.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Examples.WinForms.W03_Extensions.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W03_Extensions.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W03_Extensions.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.T10_GLSL_Cube">
|
||||
<summary>
|
||||
Demonstrates how to load and use a simple OpenGL shader program. Example is incomplete (documentation).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T10_GLSL_Cube.OnLoad(System.EventArgs)">
|
||||
<summary>
|
||||
This is the place to load resources that change little
|
||||
during the lifetime of the GameWindow. In this case, we
|
||||
check for GLSL support, and load the shaders.
|
||||
</summary>
|
||||
<param name="e">Not used.</param>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T10_GLSL_Cube.OnResize(OpenTK.Platform.ResizeEventArgs)">
|
||||
<summary>
|
||||
Called when the user resizes the window.
|
||||
</summary>
|
||||
<param name="e">Contains the new width/height of the window.</param>
|
||||
<remarks>
|
||||
You want the OpenGL viewport to match the window. This is the place to do it!
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T10_GLSL_Cube.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Prepares the next frame for rendering.
|
||||
</summary>
|
||||
<remarks>
|
||||
Place your control logic here. This is the place to respond to user input,
|
||||
update object positions etc.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T10_GLSL_Cube.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
Place your rendering code here.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T10_GLSL_Cube.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Utilities.ColorToRgba32(System.Drawing.Color)">
|
||||
<summary>
|
||||
Converts a System.Drawing.Color to a System.Int32.
|
||||
</summary>
|
||||
<param name="c">The System.Drawing.Color to convert.</param>
|
||||
<returns>A System.Int32 containing the R, G, B, A values of the
|
||||
given System.Drawing.Color in the Rbga32 format.</returns>
|
||||
</member>
|
||||
<member name="F:Examples.WinForms.W01_First_Window.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W01_First_Window.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W01_First_Window.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W01_First_Window.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.IExample">
|
||||
<summary>
|
||||
This interface is is used by the ExampleLauncher to identify OpenTK examples,
|
||||
your applications do not need to implement or use it.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Examples.WinForms.W02_Immediate_Mode_Cube.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W02_Immediate_Mode_Cube.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W02_Immediate_Mode_Cube.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W02_Immediate_Mode_Cube.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.Textures">
|
||||
<summary>
|
||||
Demonstrates simple OpenGL Texturing.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Textures.OnLoad(System.EventArgs)">
|
||||
<summary>
|
||||
Setup OpenGL and load resources here.
|
||||
</summary>
|
||||
<param name="e">Not used.</param>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Textures.OnResize(OpenTK.Platform.ResizeEventArgs)">
|
||||
<summary>
|
||||
Respond to resize events here.
|
||||
</summary>
|
||||
<param name="e">Contains information on the new GameWindow size.</param>
|
||||
<remarks>There is no need to call the base implementation.</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Textures.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Add your game logic here.
|
||||
</summary>
|
||||
<param name="e">Contains timing information.</param>
|
||||
<remarks>There is no need to call the base implementation.</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Textures.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
Add your game rendering code here.
|
||||
</summary>
|
||||
<param name="e">Contains timing information.</param>
|
||||
<remarks>There is no need to call the base implementation.</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Textures.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.Text">
|
||||
<summary>
|
||||
Shows how to render and scroll large amounts of text.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Text.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T07_Display_Lists_Flower.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.T03_Immediate_Mode_Cube">
|
||||
<summary>
|
||||
Demonstrates immediate mode rendering. Example is incomplete, and will probably go away in the future.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T03_Immediate_Mode_Cube.OnResize(OpenTK.Platform.ResizeEventArgs)">
|
||||
<summary>
|
||||
Called when the user resizes the window.
|
||||
</summary>
|
||||
<param name="e">Contains the new width/height of the window.</param>
|
||||
<remarks>
|
||||
You want the OpenGL viewport to match the window. This is the place to do it!
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T03_Immediate_Mode_Cube.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Prepares the next frame for rendering.
|
||||
</summary>
|
||||
<remarks>
|
||||
Place your control logic here. This is the place to respond to user input,
|
||||
update object positions etc.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T03_Immediate_Mode_Cube.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
Place your rendering code here.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T03_Immediate_Mode_Cube.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.ExampleLauncher.Main">
|
||||
<summary>
|
||||
The main entry point for the application.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Examples.ExampleLauncher.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.ExampleLauncher.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.ExampleLauncher.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.ExampleLauncher.ExampleInfo">
|
||||
<summary>
|
||||
Contains the information necessary to display and launch an example thorugh the ExampleLauncer.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T08_VBO.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Prepares the next frame for rendering.
|
||||
</summary>
|
||||
<remarks>
|
||||
Place your control logic here. This is the place to respond to user input,
|
||||
update object positions etc.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T08_VBO.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.T01_Simple_Window">
|
||||
<summary>
|
||||
Demonstrates the GameWindow class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T01_Simple_Window.OnLoad(System.EventArgs)">
|
||||
<summary>
|
||||
Setup OpenGL and load resources here.
|
||||
</summary>
|
||||
<param name="e">Not used.</param>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T01_Simple_Window.OnResize(OpenTK.Platform.ResizeEventArgs)">
|
||||
<summary>
|
||||
Respond to resize events here.
|
||||
</summary>
|
||||
<param name="e">Contains information on the new GameWindow size.</param>
|
||||
<remarks>There is no need to call the base implementation.</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T01_Simple_Window.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Add your game logic here.
|
||||
</summary>
|
||||
<param name="e">Contains timing information.</param>
|
||||
<remarks>There is no need to call the base implementation.</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T01_Simple_Window.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
Add your game rendering code here.
|
||||
</summary>
|
||||
<param name="e">Contains timing information.</param>
|
||||
<remarks>There is no need to call the base implementation.</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T01_Simple_Window.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.Fonts">
|
||||
<summary>
|
||||
Tests Font loading and rendering.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Fonts.OnLoad(System.EventArgs)">
|
||||
<summary>
|
||||
To maintain high rendering performance, we need to cache the text
|
||||
we wish to draw, for each font we want to draw it with. To achieve
|
||||
this, we use the TextPrinter.Prepare() method, which returns a
|
||||
TextHandle - i.e. a handle to the cached text.
|
||||
<para>
|
||||
We can use these TextHandles with the TextPrinter.Draw() method
|
||||
to draw text with very high performance.
|
||||
</para>
|
||||
</summary>
|
||||
<param name="e"></param>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Fonts.OnUnload(System.EventArgs)">
|
||||
<summary>
|
||||
It is important that we need to call the Dispose() methods to reclaim of
|
||||
each and every TextHandle and TextureFont to reclaim the unamanged
|
||||
(OpenGL) resources they are using.
|
||||
</summary>
|
||||
<param name="e"></param>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Fonts.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
To render pixel-perfect text, we have to setup a 2d display projection
|
||||
with a width/height that corresponds to our current Viewport.
|
||||
In OpenGL this can be easily achieved using the GL.Ortho method.
|
||||
<para>
|
||||
It is still possible to render text in a 3d projection, but it will
|
||||
be very hard to achieve pixel-perfect precision.
|
||||
</para>
|
||||
<para>
|
||||
To achieve the highest possible performance, render your 3d scene first.
|
||||
At the end of the RenderFrame call, setup a 2d projection and render all
|
||||
text in one go.
|
||||
</para>
|
||||
</summary>
|
||||
<param name="e"></param>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.Fonts.Main">
|
||||
<summary>
|
||||
Entry point of this example.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.T04_Vertex_Lighting">
|
||||
<summary>
|
||||
Demonstrates fixed-function OpenGL lighting. Example is incomplete (documentation).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T04_Vertex_Lighting.OnResize(OpenTK.Platform.ResizeEventArgs)">
|
||||
<summary>
|
||||
Called when the user resizes the window.
|
||||
</summary>
|
||||
<param name="e">Contains the new width/height of the window.</param>
|
||||
<remarks>
|
||||
You want the OpenGL viewport to match the window. This is the place to do it!
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T04_Vertex_Lighting.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Prepares the next frame for rendering.
|
||||
</summary>
|
||||
<remarks>
|
||||
Place your control logic here. This is the place to respond to user input,
|
||||
update object positions etc.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T04_Vertex_Lighting.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
Place your rendering code here.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T04_Vertex_Lighting.Launch">
|
||||
<summary>
|
||||
Launches this example.
|
||||
</summary>
|
||||
<remarks>
|
||||
Provides a simple way for the example launcher to launch the examples.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Examples.WinForms.W04_Multiple_GLControls.components">
|
||||
<summary>
|
||||
Required designer variable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W04_Multiple_GLControls.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Clean up any resources being used.
|
||||
</summary>
|
||||
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
</member>
|
||||
<member name="M:Examples.WinForms.W04_Multiple_GLControls.InitializeComponent">
|
||||
<summary>
|
||||
Required method for Designer support - do not modify
|
||||
the contents of this method with the code editor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Examples.Tutorial.T02_Vertex_Arrays">
|
||||
<summary>
|
||||
Demonstrates Vertex Arrays (in system memory). Example is incomplete (documentation).
|
||||
Broken since release 0.3.12.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T02_Vertex_Arrays.OnResize(OpenTK.Platform.ResizeEventArgs)">
|
||||
<summary>
|
||||
Called when the user resizes the window.
|
||||
</summary>
|
||||
<param name="e">Contains the new width/height of the window.</param>
|
||||
<remarks>
|
||||
You want the OpenGL viewport to match the window. This is the place to do it!
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T02_Vertex_Arrays.OnUpdateFrame(OpenTK.UpdateFrameEventArgs)">
|
||||
<summary>
|
||||
Prepares the next frame for rendering.
|
||||
</summary>
|
||||
<remarks>
|
||||
Place your control logic here. This is the place to respond to user input,
|
||||
update object positions etc.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T02_Vertex_Arrays.OnRenderFrame(OpenTK.RenderFrameEventArgs)">
|
||||
<summary>
|
||||
Place your rendering code here.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Examples.Tutorial.T02_Vertex_Arrays.Launch">
|
||||
<summary>
|
||||
Launches this example.
|
||||
</summary>
|
||||
<remarks>
|
||||
Provides a simple way for the example launcher to launch the examples.
|
||||
</remarks>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
33
Source/Examples/Tests/TestResolutionChanges.cs
Normal file
33
Source/Examples/Tests/TestResolutionChanges.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK team.
|
||||
* This notice may not be removed.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace Examples.Tests
|
||||
{
|
||||
[Example("Test Resolution Changes", ExampleCategory.Test)]
|
||||
public class TestResolutionChanges
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
foreach (DisplayDevice dev in DisplayDevice.AvailableDisplays)
|
||||
{
|
||||
Trace.WriteLine(dev.ToString());
|
||||
//MessageBox.Show(dev.ToString());
|
||||
//dev.ChangeResolution(640, 480, 32, 60.0f);
|
||||
//dev.RestoreResolution();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -61,7 +61,7 @@ namespace Examples.Tutorial
|
|||
|
||||
public override void OnLoad(EventArgs e)
|
||||
{
|
||||
GL.Enable(EnableCap.Texture2d);
|
||||
GL.Enable(EnableCap.Texture2D);
|
||||
|
||||
GL.ClearColor(Color.CadetBlue);
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
|
|
|
@ -40,23 +40,23 @@ namespace Examples.Tutorial
|
|||
public override void OnLoad(EventArgs e)
|
||||
{
|
||||
GL.ClearColor(Color.SteelBlue);
|
||||
GL.Enable(EnableCap.Texture2d);
|
||||
GL.Enable(EnableCap.Texture2D);
|
||||
|
||||
GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest);
|
||||
|
||||
GL.GenTextures(1, out texture);
|
||||
GL.BindTexture(TextureTarget.Texture2d, texture);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture);
|
||||
|
||||
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
||||
ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
|
||||
GL.TexImage2D(TextureTarget.Texture2d, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0,
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0,
|
||||
OpenTK.OpenGL.Enums.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
|
||||
GL.TexParameter(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -116,7 +116,7 @@ namespace Examples.Tutorial
|
|||
|
||||
GL.MatrixMode(MatrixMode.Modelview);
|
||||
GL.LoadIdentity();
|
||||
GL.BindTexture(TextureTarget.Texture2d, texture);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture);
|
||||
|
||||
GL.Begin(BeginMode.Quads);
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\OpenTK.dll.config
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\logo-dark.jpg
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\logo.jpg
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\metal.jpg
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Poem.txt
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\all-wcprops
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\entries
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\format
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\prop-base\logo-dark.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\prop-base\logo.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\prop-base\metal.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\text-base\logo-dark.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\text-base\logo.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\text-base\metal.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\.svn\text-base\Poem.txt.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\Simple_FS.glsl
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\Simple_VS.glsl
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\.svn\all-wcprops
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\.svn\entries
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\.svn\format
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\.svn\text-base\Simple_FS.glsl.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Data\Shaders\.svn\text-base\Simple_VS.glsl.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Examples.exe
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Debug\Examples\Examples.pdb
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Source\Examples\obj\Debug\ResolveAssemblyReference.cache
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Source\Examples\obj\Debug\Examples.exe
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Source\Examples\obj\Debug\Examples.pdb
|
BIN
Source/Examples/obj/Debug/Examples.exe
Normal file
BIN
Source/Examples/obj/Debug/Examples.exe
Normal file
Binary file not shown.
BIN
Source/Examples/obj/Debug/Examples.pdb
Normal file
BIN
Source/Examples/obj/Debug/Examples.pdb
Normal file
Binary file not shown.
BIN
Source/Examples/obj/Debug/ResolveAssemblyReference.cache
Normal file
BIN
Source/Examples/obj/Debug/ResolveAssemblyReference.cache
Normal file
Binary file not shown.
|
@ -0,0 +1,26 @@
|
|||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\OpenTK.dll.config
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\logo-dark.jpg
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\logo.jpg
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\metal.jpg
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Poem.txt
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\all-wcprops
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\entries
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\format
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\prop-base\logo-dark.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\prop-base\logo.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\prop-base\metal.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\text-base\logo-dark.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\text-base\logo.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\text-base\metal.jpg.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\.svn\text-base\Poem.txt.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\Simple_FS.glsl
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\Simple_VS.glsl
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\.svn\all-wcprops
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\.svn\entries
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\.svn\format
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\.svn\text-base\Simple_FS.glsl.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Data\Shaders\.svn\text-base\Simple_VS.glsl.svn-base
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\Examples.exe
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Binaries\Release\Examples\OpenTK.xml
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Source\Examples\obj\Release\ResolveAssemblyReference.cache
|
||||
E:\Documents\Projects\opentk\opentk\trunk\Source\Examples\obj\Release\Examples.exe
|
BIN
Source/Examples/obj/Release/Examples.exe
Normal file
BIN
Source/Examples/obj/Release/Examples.exe
Normal file
Binary file not shown.
BIN
Source/Examples/obj/Release/ResolveAssemblyReference.cache
Normal file
BIN
Source/Examples/obj/Release/ResolveAssemblyReference.cache
Normal file
Binary file not shown.
Loading…
Reference in a new issue