зеркало из https://github.com/stride3d/SDL2-CS.git
Add back MiniTK, for those that need legacy GL/AL bindings support.
This reverts commit 92f293416d
.
This commit is contained in:
Родитель
ec8bd4ab09
Коммит
5ea01f5bf6
88
Makefile
88
Makefile
|
@ -1,20 +1,102 @@
|
|||
# Makefile for SDL2#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
# Dependencies
|
||||
DEPS = \
|
||||
-r:System \
|
||||
-r:System.Drawing \
|
||||
-r:System.Xml
|
||||
|
||||
# Source Lists
|
||||
SRC = \
|
||||
SDL2 = \
|
||||
src/LPUtf8StrMarshaler.cs \
|
||||
src/SDL2.cs \
|
||||
src/SDL2_image.cs \
|
||||
src/SDL2_mixer.cs \
|
||||
src/SDL2_ttf.cs
|
||||
MINITK = \
|
||||
src/MiniTK/BlittableValueType.cs \
|
||||
src/MiniTK/Math/Quaterniond.cs \
|
||||
src/MiniTK/Math/Vector4.cs \
|
||||
src/MiniTK/Math/Vector3h.cs \
|
||||
src/MiniTK/Math/Vector2.cs \
|
||||
src/MiniTK/Math/Vector4h.cs \
|
||||
src/MiniTK/Math/Functions.cs \
|
||||
src/MiniTK/Math/BezierCurve.cs \
|
||||
src/MiniTK/Math/Rectangle.cs \
|
||||
src/MiniTK/Math/Quaternion.cs \
|
||||
src/MiniTK/Math/Size.cs \
|
||||
src/MiniTK/Math/Vector4d.cs \
|
||||
src/MiniTK/Math/Point.cs \
|
||||
src/MiniTK/Math/MathHelper.cs \
|
||||
src/MiniTK/Math/Matrix4.cs \
|
||||
src/MiniTK/Math/Box2.cs \
|
||||
src/MiniTK/Math/Half.cs \
|
||||
src/MiniTK/Math/Matrix4d.cs \
|
||||
src/MiniTK/Math/Vector3d.cs \
|
||||
src/MiniTK/Math/Vector2d.cs \
|
||||
src/MiniTK/Math/BezierCurveQuadric.cs \
|
||||
src/MiniTK/Math/Matrix3d.cs \
|
||||
src/MiniTK/Math/Vector2h.cs \
|
||||
src/MiniTK/Math/BezierCurveCubic.cs \
|
||||
src/MiniTK/Math/Vector3.cs \
|
||||
src/MiniTK/AutoGeneratedAttribute.cs \
|
||||
src/MiniTK/ContextHandle.cs \
|
||||
src/MiniTK/Graphics/GraphicsBindingsBase.cs \
|
||||
src/MiniTK/Graphics/ES20/Core.cs \
|
||||
src/MiniTK/Graphics/ES20/ErrorHelper.cs \
|
||||
src/MiniTK/Graphics/ES20/Enums.cs \
|
||||
src/MiniTK/Graphics/ES20/Delegates.cs \
|
||||
src/MiniTK/Graphics/ES20/Helper.cs \
|
||||
src/MiniTK/Graphics/ES20/ES.cs \
|
||||
src/MiniTK/Graphics/GraphicsContextMissingException.cs \
|
||||
src/MiniTK/Graphics/OpenGL/GLDelegates.cs \
|
||||
src/MiniTK/Graphics/OpenGL/GLCore.cs \
|
||||
src/MiniTK/Graphics/OpenGL/ErrorHelper.cs \
|
||||
src/MiniTK/Graphics/OpenGL/GLHelper.cs \
|
||||
src/MiniTK/Graphics/OpenGL/GL.cs \
|
||||
src/MiniTK/Graphics/OpenGL/GLEnums.cs \
|
||||
src/MiniTK/Graphics/ES10/Core.cs \
|
||||
src/MiniTK/Graphics/ES10/ErrorHelper.cs \
|
||||
src/MiniTK/Graphics/ES10/Enums.cs \
|
||||
src/MiniTK/Graphics/ES10/Delegates.cs \
|
||||
src/MiniTK/Graphics/ES10/Helper.cs \
|
||||
src/MiniTK/Graphics/ES10/ES.cs \
|
||||
src/MiniTK/Graphics/ES11/Core.cs \
|
||||
src/MiniTK/Graphics/ES11/ErrorHelper.cs \
|
||||
src/MiniTK/Graphics/ES11/Enums.cs \
|
||||
src/MiniTK/Graphics/ES11/Delegates.cs \
|
||||
src/MiniTK/Graphics/ES11/Helper.cs \
|
||||
src/MiniTK/Graphics/ES11/ES.cs \
|
||||
src/MiniTK/Graphics/SDL2_GraphicsContext.cs \
|
||||
src/MiniTK/Graphics/Color4.cs \
|
||||
src/MiniTK/Graphics/GraphicsContextException.cs \
|
||||
src/MiniTK/Graphics/GraphicsErrorException.cs \
|
||||
src/MiniTK/Graphics/GraphicsExceptions.cs \
|
||||
src/MiniTK/BindingsBase.cs \
|
||||
src/MiniTK/Audio/AudioCapture.cs \
|
||||
src/MiniTK/Audio/AudioContextException.cs \
|
||||
src/MiniTK/Audio/AudioException.cs \
|
||||
src/MiniTK/Audio/OpenAL/Alc/Alc.cs \
|
||||
src/MiniTK/Audio/OpenAL/Alc/AlcEnums.cs \
|
||||
src/MiniTK/Audio/OpenAL/AL/EffectsExtensionEnums.cs \
|
||||
src/MiniTK/Audio/OpenAL/AL/EffectsExtension.cs \
|
||||
src/MiniTK/Audio/OpenAL/AL/AL.cs \
|
||||
src/MiniTK/Audio/OpenAL/AL/XRamExtension.cs \
|
||||
src/MiniTK/Audio/OpenAL/AL/EffectsExtensionPresets.cs \
|
||||
src/MiniTK/Audio/OpenAL/AL/ALEnums.cs \
|
||||
src/MiniTK/Audio/AudioContext.cs \
|
||||
src/MiniTK/Audio/AudioValueException.cs \
|
||||
src/MiniTK/Audio/AudioDeviceErrorChecker.cs \
|
||||
src/MiniTK/Audio/AudioDeviceEnumerator.cs \
|
||||
src/MiniTK/Audio/AudioDeviceException.cs
|
||||
|
||||
# Targets
|
||||
|
||||
debug: clean-debug
|
||||
mkdir -p bin/debug
|
||||
cp SDL2-CS.dll.config bin/debug
|
||||
dmcs /unsafe -debug -out:bin/debug/SDL2-CS.dll -target:library $(SRC)
|
||||
dmcs /unsafe -debug -out:bin/debug/SDL2-CS.dll -target:library $(SDL2) $(MINITK) $(DEPS)
|
||||
|
||||
clean-debug:
|
||||
rm -rf bin/debug
|
||||
|
@ -22,7 +104,7 @@ clean-debug:
|
|||
release: clean-release
|
||||
mkdir -p bin/release
|
||||
cp SDL2-CS.dll.config bin/release
|
||||
dmcs /unsafe -optimize -out:bin/release/SDL2-CS.dll -target:library $(SRC)
|
||||
dmcs /unsafe -optimize -out:bin/release/SDL2-CS.dll -target:library $(SDL2) $(MINITK) $(DEPS)
|
||||
|
||||
clean-release:
|
||||
rm -rf bin/release
|
||||
|
|
17
README
17
README
|
@ -6,6 +6,9 @@ License
|
|||
-------
|
||||
SDL2 and SDL2# are released under the zlib license. See LICENSE for details.
|
||||
|
||||
SDL2# currently uses parts of OpenTK, which is released under the MIT license.
|
||||
See opentk.LICENSE for details.
|
||||
|
||||
About SDL2
|
||||
----------
|
||||
For more information about SDL2, visit the SDL wiki:
|
||||
|
@ -23,6 +26,8 @@ The wrapper provides bindings for the following libraries:
|
|||
- SDL2_mixer
|
||||
- SDL2_ttf
|
||||
|
||||
We also provide bindings for OpenGL and OpenAL, taken from OpenTK.
|
||||
|
||||
Note that SDL2# will not provide every single SDL2 function. This is due to
|
||||
limitations in the C# language that would cause major conflicts with the native
|
||||
SDL2 library and its extensions.
|
||||
|
@ -33,6 +38,18 @@ be exactly as they are done in the C library, with little-to-no concern for
|
|||
names will indicate which library file the function/type/value exists in, and
|
||||
everything else will be as close to the C version as technically possible.
|
||||
|
||||
Using MiniTK
|
||||
------------
|
||||
To use the OpenGL/OpenAL bindings, simply use them as you were with OpenTK,
|
||||
but after calling SDL_GL_CreateContext, add the following lines:
|
||||
|
||||
OpenTK.Graphics.GraphicsContext.CurrentContext = yourContextIntPtr;
|
||||
GL.LoadAll();
|
||||
|
||||
This will load the OpenTK entry points. It is strongly recommended that you
|
||||
load your own entry points using SDL_GL_GetProcAddress and delegates, but
|
||||
this has been provided for OpenTK compatibility.
|
||||
|
||||
Roadmap
|
||||
-------
|
||||
To see the current roadmap for SDL2#, visit the GitHub issues page:
|
||||
|
|
|
@ -80,6 +80,81 @@
|
|||
<Compile Include="src\SDL2_image.cs" />
|
||||
<Compile Include="src\SDL2_mixer.cs" />
|
||||
<Compile Include="src\SDL2_ttf.cs" />
|
||||
<Compile Include="src\MiniTK\BlittableValueType.cs" />
|
||||
<Compile Include="src\MiniTK\ContextHandle.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioCapture.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioContext.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioContextException.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioDeviceEnumerator.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioDeviceErrorChecker.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioDeviceException.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioException.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\AudioValueException.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\AL\AL.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\AL\ALEnums.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\AL\EffectsExtension.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\AL\EffectsExtensionEnums.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\AL\EffectsExtensionPresets.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\AL\XRamExtension.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\Alc\Alc.cs" />
|
||||
<Compile Include="src\MiniTK\Audio\OpenAL\Alc\AlcEnums.cs" />
|
||||
<Compile Include="src\MiniTK\Math\BezierCurve.cs" />
|
||||
<Compile Include="src\MiniTK\Math\BezierCurveCubic.cs" />
|
||||
<Compile Include="src\MiniTK\Math\BezierCurveQuadric.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Box2.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Functions.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Half.cs" />
|
||||
<Compile Include="src\MiniTK\Math\MathHelper.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Matrix3d.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Matrix4.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Matrix4d.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Point.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Quaternion.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Quaterniond.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Rectangle.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Size.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector2.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector2d.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector2h.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector3.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector3d.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector3h.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector4.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector4d.cs" />
|
||||
<Compile Include="src\MiniTK\Math\Vector4h.cs" />
|
||||
<Compile Include="src\MiniTK\AutoGeneratedAttribute.cs" />
|
||||
<Compile Include="src\MiniTK\BindingsBase.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\Color4.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\GraphicsBindingsBase.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\GraphicsContextException.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\GraphicsContextMissingException.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\GraphicsErrorException.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\GraphicsExceptions.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\SDL2_GraphicsContext.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES10\Core.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES10\Delegates.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES10\ES.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES10\Enums.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES10\ErrorHelper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES10\Helper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES11\Core.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES11\Delegates.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES11\ES.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES11\Enums.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES11\ErrorHelper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES11\Helper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES20\Core.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES20\Delegates.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES20\ES.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES20\Enums.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES20\ErrorHelper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\ES20\Helper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\OpenGL\ErrorHelper.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GL.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLCore.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLDelegates.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLEnums.cs" />
|
||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLHelper.cs" />
|
||||
<Compile Include="src\LPUtf8StrMarshaler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -89,6 +164,8 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="src\" />
|
||||
<Folder Include="src\MiniTK\" />
|
||||
<Folder Include="src\MiniTK\Graphics\" />
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
|
@ -101,5 +178,7 @@
|
|||
</ProjectExtensions>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Drawing" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -15,4 +15,8 @@
|
|||
<dllmap dll="SDL2_ttf.dll" os="windows" target="SDL2_ttf.dll"/>
|
||||
<dllmap dll="SDL2_ttf.dll" os="osx" target="libSDL2_ttf-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_ttf.dll" os="linux" target="libSDL2_ttf-2.0.so.0"/>
|
||||
|
||||
<dllmap dll="soft_oal.dll" os="windows" target="soft_oal.dll"/>
|
||||
<dllmap dll="soft_oal.dll" os="osx" target="libopenal.1.dylib"/>
|
||||
<dllmap dll="soft_oal.dll" os="linux" target="libopenal.so.1"/>
|
||||
</configuration>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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.
|
||||
*/
|
|
@ -0,0 +1,415 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using OpenTK.Audio.OpenAL;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Provides methods to instantiate, use and destroy an audio device for recording.
|
||||
/// Static methods are provided to list available devices known by the driver.
|
||||
/// </summary>
|
||||
public sealed class AudioCapture : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
// This must stay private info so the end-user cannot call any Alc commands for the recording device.
|
||||
IntPtr Handle;
|
||||
|
||||
// Alc.CaptureStop should be called prior to device shutdown, this keeps track of Alc.CaptureStart/Stop calls.
|
||||
bool _isrecording = false;
|
||||
|
||||
ALFormat sample_format;
|
||||
int sample_frequency;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
static AudioCapture()
|
||||
{
|
||||
if (AudioDeviceEnumerator.IsOpenALSupported) // forces enumeration
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the default device for audio recording.
|
||||
/// Implicitly set parameters are: 22050Hz, 16Bit Mono, 4096 samples ringbuffer.
|
||||
/// </summary>
|
||||
public AudioCapture()
|
||||
: this(AudioCapture.DefaultDevice, 22050, ALFormat.Mono16, 4096)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Opens a device for audio recording.</summary>
|
||||
/// <param name="deviceName">The device name.</param>
|
||||
/// <param name="frequency">The frequency that the data should be captured at.</param>
|
||||
/// <param name="sampleFormat">The requested capture buffer format.</param>
|
||||
/// <param name="bufferSize">The size of OpenAL's capture internal ring-buffer. This value expects number of samples, not bytes.</param>
|
||||
public AudioCapture(string deviceName, int frequency, ALFormat sampleFormat, int bufferSize)
|
||||
{
|
||||
if (!AudioDeviceEnumerator.IsOpenALSupported)
|
||||
throw new DllNotFoundException("soft_oal.dll");
|
||||
if (frequency <= 0)
|
||||
throw new ArgumentOutOfRangeException("frequency");
|
||||
if (bufferSize <= 0)
|
||||
throw new ArgumentOutOfRangeException("bufferSize");
|
||||
|
||||
// Try to open specified device. If it fails, try to open default device.
|
||||
device_name = deviceName;
|
||||
Handle = Alc.CaptureOpenDevice(deviceName, frequency, sampleFormat, bufferSize);
|
||||
|
||||
if (Handle == IntPtr.Zero)
|
||||
{
|
||||
Debug.WriteLine(ErrorMessage(deviceName, frequency, sampleFormat, bufferSize));
|
||||
device_name = "IntPtr.Zero";
|
||||
Handle = Alc.CaptureOpenDevice(null, frequency, sampleFormat, bufferSize);
|
||||
}
|
||||
|
||||
if (Handle == IntPtr.Zero)
|
||||
{
|
||||
Debug.WriteLine(ErrorMessage("IntPtr.Zero", frequency, sampleFormat, bufferSize));
|
||||
device_name = AudioDeviceEnumerator.DefaultRecordingDevice;
|
||||
Handle = Alc.CaptureOpenDevice(AudioDeviceEnumerator.DefaultRecordingDevice, frequency, sampleFormat, bufferSize);
|
||||
}
|
||||
|
||||
if (Handle == IntPtr.Zero)
|
||||
{
|
||||
// Everything we tried failed. Capture may not be supported, bail out.
|
||||
Debug.WriteLine(ErrorMessage(AudioDeviceEnumerator.DefaultRecordingDevice, frequency, sampleFormat, bufferSize));
|
||||
device_name = "None";
|
||||
|
||||
throw new AudioDeviceException("All attempts to open capture devices returned IntPtr.Zero. See debug log for verbose list.");
|
||||
}
|
||||
|
||||
// handle is not null, check for some Alc Error
|
||||
CheckErrors();
|
||||
|
||||
SampleFormat = sampleFormat;
|
||||
SampleFrequency = frequency;
|
||||
}
|
||||
|
||||
#endregion Constructor
|
||||
|
||||
#region Public Members
|
||||
|
||||
#region CurrentDevice
|
||||
|
||||
private string device_name;
|
||||
|
||||
/// <summary>
|
||||
/// The name of the device associated with this instance.
|
||||
/// </summary>
|
||||
public string CurrentDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
return device_name;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AvailableDevices
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of strings containing all known recording devices.
|
||||
/// </summary>
|
||||
public static IList<string> AvailableDevices
|
||||
{
|
||||
get
|
||||
{
|
||||
return AudioDeviceEnumerator.AvailableRecordingDevices;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DefaultDevice
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the device that will be used as recording default.
|
||||
/// </summary>
|
||||
public static string DefaultDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
return AudioDeviceEnumerator.DefaultRecordingDevice;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CheckErrors
|
||||
|
||||
/// <summary>
|
||||
/// Checks for ALC error conditions.
|
||||
/// </summary>
|
||||
/// <exception cref="OutOfMemoryException">Raised when an out of memory error is detected.</exception>
|
||||
/// <exception cref="AudioValueException">Raised when an invalid value is detected.</exception>
|
||||
/// <exception cref="AudioDeviceException">Raised when an invalid device is detected.</exception>
|
||||
/// <exception cref="AudioContextException">Raised when an invalid context is detected.</exception>
|
||||
public void CheckErrors()
|
||||
{
|
||||
new AudioDeviceErrorChecker(Handle).Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CurrentError
|
||||
|
||||
/// <summary>Returns the ALC error code for this device.</summary>
|
||||
public AlcError CurrentError
|
||||
{
|
||||
get
|
||||
{
|
||||
return Alc.GetError(Handle);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start & Stop
|
||||
|
||||
/// <summary>
|
||||
/// Start recording samples.
|
||||
/// The number of available samples can be obtained through the <see cref="AvailableSamples"/> property.
|
||||
/// The data can be queried with any <see cref="ReadSamples(IntPtr, int)"/> method.
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
Alc.CaptureStart(Handle);
|
||||
_isrecording = true;
|
||||
}
|
||||
|
||||
/// <summary>Stop recording samples. This will not clear previously recorded samples.</summary>
|
||||
public void Stop()
|
||||
{
|
||||
Alc.CaptureStop(Handle);
|
||||
_isrecording = false;
|
||||
}
|
||||
|
||||
#endregion Start & Stop Capture
|
||||
|
||||
#region AvailableSamples
|
||||
|
||||
/// <summary>Returns the number of available samples for capture.</summary>
|
||||
public int AvailableSamples
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO: Investigate inconsistency between documentation and actual usage.
|
||||
// Doc claims the 3rd param is Number-of-Bytes, but it appears to be Number-of-Int32s
|
||||
int result;
|
||||
Alc.GetInteger(Handle, AlcGetInteger.CaptureSamples, 1, out result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Available samples property
|
||||
|
||||
#region ReadSamples
|
||||
|
||||
/// <summary>Fills the specified buffer with samples from the internal capture ring-buffer. This method does not block: it is an error to specify a sampleCount larger than AvailableSamples.</summary>
|
||||
/// <param name="buffer">A pointer to a previously initialized and pinned array.</param>
|
||||
/// <param name="sampleCount">The number of samples to be written to the buffer.</param>
|
||||
public void ReadSamples(IntPtr buffer, int sampleCount)
|
||||
{
|
||||
Alc.CaptureSamples(Handle, buffer, sampleCount);
|
||||
}
|
||||
|
||||
/// <summary>Fills the specified buffer with samples from the internal capture ring-buffer. This method does not block: it is an error to specify a sampleCount larger than AvailableSamples.</summary>
|
||||
/// <param name="buffer">The buffer to fill.</param>
|
||||
/// <param name="sampleCount">The number of samples to be written to the buffer.</param>
|
||||
/// <exception cref="System.ArgumentNullException">Raised when buffer is null.</exception>
|
||||
/// <exception cref="System.ArgumentOutOfRangeException">Raised when sampleCount is larger than the buffer.</exception>
|
||||
public void ReadSamples<TBuffer>(TBuffer[] buffer, int sampleCount)
|
||||
where TBuffer : struct
|
||||
{
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException("buffer");
|
||||
|
||||
int buffer_size = BlittableValueType<TBuffer>.Stride * buffer.Length;
|
||||
// This is more of a heuristic than a 100% valid check. However, it will work
|
||||
// correctly for 99.9% of all use cases.
|
||||
// This should never produce a false positive, but a false negative might
|
||||
// be produced with compressed sample formats (which are very rare).
|
||||
// Still, this is better than no check at all.
|
||||
if (sampleCount * GetSampleSize(SampleFormat) > buffer_size)
|
||||
throw new ArgumentOutOfRangeException("sampleCount");
|
||||
|
||||
GCHandle buffer_ptr = GCHandle.Alloc(buffer, GCHandleType.Pinned);
|
||||
try { ReadSamples(buffer_ptr.AddrOfPinnedObject(), sampleCount); }
|
||||
finally { buffer_ptr.Free(); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SampleFormat & SampleFrequency
|
||||
|
||||
/// <summary>
|
||||
/// Gets the OpenTK.Audio.ALFormat for this instance.
|
||||
/// </summary>
|
||||
public ALFormat SampleFormat
|
||||
{
|
||||
get { return sample_format; }
|
||||
private set { sample_format = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sampling rate for this instance.
|
||||
/// </summary>
|
||||
public int SampleFrequency
|
||||
{
|
||||
get { return sample_frequency; }
|
||||
private set { sample_frequency = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsRunning
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is currently capturing samples.
|
||||
/// </summary>
|
||||
public bool IsRunning
|
||||
{
|
||||
get { return _isrecording; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Members
|
||||
|
||||
// Retrieves the sample size in bytes for various ALFormats.
|
||||
// Compressed formats always return 1.
|
||||
static int GetSampleSize(ALFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case ALFormat.Mono8: return 1;
|
||||
case ALFormat.Mono16: return 2;
|
||||
case ALFormat.Stereo8: return 2;
|
||||
case ALFormat.Stereo16: return 4;
|
||||
case ALFormat.MonoFloat32Ext: return 4;
|
||||
case ALFormat.MonoDoubleExt: return 8;
|
||||
case ALFormat.StereoFloat32Ext: return 8;
|
||||
case ALFormat.StereoDoubleExt: return 16;
|
||||
|
||||
case ALFormat.MultiQuad8Ext: return 4;
|
||||
case ALFormat.MultiQuad16Ext: return 8;
|
||||
case ALFormat.MultiQuad32Ext: return 16;
|
||||
|
||||
case ALFormat.Multi51Chn8Ext: return 6;
|
||||
case ALFormat.Multi51Chn16Ext: return 12;
|
||||
case ALFormat.Multi51Chn32Ext: return 24;
|
||||
|
||||
case ALFormat.Multi61Chn8Ext: return 7;
|
||||
case ALFormat.Multi71Chn16Ext: return 14;
|
||||
case ALFormat.Multi71Chn32Ext: return 28;
|
||||
|
||||
case ALFormat.MultiRear8Ext: return 1;
|
||||
case ALFormat.MultiRear16Ext: return 2;
|
||||
case ALFormat.MultiRear32Ext: return 4;
|
||||
|
||||
default: return 1; // Unknown sample size.
|
||||
}
|
||||
}
|
||||
|
||||
// Converts an error code to an error string with additional information.
|
||||
string ErrorMessage(string devicename, int frequency, ALFormat bufferformat, int buffersize)
|
||||
{
|
||||
string alcerrmsg;
|
||||
AlcError alcerrcode = CurrentError;
|
||||
switch (alcerrcode)
|
||||
{
|
||||
case AlcError.OutOfMemory:
|
||||
alcerrmsg = alcerrcode.ToString() + ": The specified device is invalid, or can not capture audio.";
|
||||
break;
|
||||
case AlcError.InvalidValue:
|
||||
alcerrmsg = alcerrcode.ToString() + ": One of the parameters has an invalid value.";
|
||||
break;
|
||||
default:
|
||||
alcerrmsg = alcerrcode.ToString();
|
||||
break;
|
||||
}
|
||||
return "The handle returned by Alc.CaptureOpenDevice is null." +
|
||||
"\nAlc Error: " + alcerrmsg +
|
||||
"\nDevice Name: " + devicename +
|
||||
"\nCapture frequency: " + frequency +
|
||||
"\nBuffer format: " + bufferformat +
|
||||
"\nBuffer Size: " + buffersize;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes this instance.
|
||||
/// </summary>
|
||||
~AudioCapture()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private bool IsDisposed;
|
||||
|
||||
/// <summary>Closes the device and disposes the instance.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private void Dispose(bool manual)
|
||||
{
|
||||
if (!this.IsDisposed)
|
||||
{
|
||||
if (this.Handle != IntPtr.Zero)
|
||||
{
|
||||
if (this._isrecording)
|
||||
this.Stop();
|
||||
|
||||
Alc.CaptureCloseDevice(this.Handle);
|
||||
}
|
||||
this.IsDisposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Destructor
|
||||
}
|
||||
}
|
|
@ -0,0 +1,770 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
using OpenTK.Audio.OpenAL;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides methods to instantiate, use and destroy an audio context for playback.
|
||||
/// Static methods are provided to list available devices known by the driver.
|
||||
/// </summary>
|
||||
public sealed class AudioContext : IDisposable
|
||||
{
|
||||
#region --- Fields ---
|
||||
|
||||
bool disposed;
|
||||
bool is_processing, is_synchronized;
|
||||
IntPtr device_handle;
|
||||
ContextHandle context_handle;
|
||||
bool context_exists;
|
||||
|
||||
string device_name;
|
||||
static object audio_context_lock = new object();
|
||||
static Dictionary<ContextHandle, AudioContext> available_contexts = new Dictionary<ContextHandle, AudioContext>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Constructors ---
|
||||
|
||||
#region static AudioContext()
|
||||
|
||||
/// \internal
|
||||
/// <summary>
|
||||
/// Runs before the actual class constructor, to load available devices.
|
||||
/// </summary>
|
||||
static AudioContext()
|
||||
{
|
||||
if (AudioDeviceEnumerator.IsOpenALSupported) // forces enumeration
|
||||
{ }
|
||||
}
|
||||
|
||||
#endregion static AudioContext()
|
||||
|
||||
#region public AudioContext()
|
||||
|
||||
/// <summary>Constructs a new AudioContext, using the default audio device.</summary>
|
||||
public AudioContext()
|
||||
: this(null, 0, 0, false, true, MaxAuxiliarySends.UseDriverDefault) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region public AudioContext(string device)
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new AudioContext instance.
|
||||
/// </summary>
|
||||
/// <param name="device">The device name that will host this instance.</param>
|
||||
public AudioContext(string device) : this(device, 0, 0, false, true, MaxAuxiliarySends.UseDriverDefault) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region public AudioContext(string device, int freq)
|
||||
|
||||
/// <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
|
||||
/// <param name="device">The name of the audio device to use.</param>
|
||||
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <remarks>
|
||||
/// Use AudioContext.AvailableDevices to obtain a list of all available audio devices.
|
||||
/// devices.
|
||||
/// </remarks>
|
||||
public AudioContext(string device, int freq) : this(device, freq, 0, false, true, MaxAuxiliarySends.UseDriverDefault) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region public AudioContext(string device, int freq, int refresh)
|
||||
|
||||
/// <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
|
||||
/// <param name="device">The name of the audio device to use.</param>
|
||||
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <remarks>
|
||||
/// Use AudioContext.AvailableDevices to obtain a list of all available audio devices.
|
||||
/// devices.
|
||||
/// </remarks>
|
||||
public AudioContext(string device, int freq, int refresh)
|
||||
: this(device, freq, refresh, false, true, MaxAuxiliarySends.UseDriverDefault) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region public AudioContext(string device, int freq, int refresh, bool sync)
|
||||
|
||||
/// <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
|
||||
/// <param name="device">The name of the audio device to use.</param>
|
||||
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="sync">Flag, indicating a synchronous context.</param>
|
||||
/// <remarks>
|
||||
/// Use AudioContext.AvailableDevices to obtain a list of all available audio devices.
|
||||
/// devices.
|
||||
/// </remarks>
|
||||
public AudioContext(string device, int freq, int refresh, bool sync)
|
||||
: this(AudioDeviceEnumerator.AvailablePlaybackDevices[0], freq, refresh, sync, true) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx)
|
||||
|
||||
/// <summary>Creates the audio context using the specified device and device parameters.</summary>
|
||||
/// <param name="device">The device descriptor obtained through AudioContext.AvailableDevices.</param>
|
||||
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="sync">Flag, indicating a synchronous context.</param>
|
||||
/// <param name="enableEfx">Indicates whether the EFX extension should be initialized, if present.</param>
|
||||
/// <exception cref="ArgumentNullException">Occurs when the device string is invalid.</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Occurs when a specified parameter is invalid.</exception>
|
||||
/// <exception cref="AudioDeviceException">
|
||||
/// Occurs when the specified device is not available, or is in use by another program.
|
||||
/// </exception>
|
||||
/// <exception cref="AudioContextException">
|
||||
/// Occurs when an audio context could not be created with the specified parameters.
|
||||
/// </exception>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Occurs when an AudioContext already exists.</exception>
|
||||
/// <remarks>
|
||||
/// <para>For maximum compatibility, you are strongly recommended to use the default constructor.</para>
|
||||
/// <para>Multiple AudioContexts are not supported at this point.</para>
|
||||
/// <para>
|
||||
/// The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well
|
||||
/// as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends.
|
||||
/// Values higher than supported will be clamped by the driver.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx)
|
||||
{
|
||||
CreateContext(device, freq, refresh, sync, enableEfx, MaxAuxiliarySends.UseDriverDefault);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxMaxAuxSends)
|
||||
|
||||
/// <summary>Creates the audio context using the specified device and device parameters.</summary>
|
||||
/// <param name="device">The device descriptor obtained through AudioContext.AvailableDevices.</param>
|
||||
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="sync">Flag, indicating a synchronous context.</param>
|
||||
/// <param name="enableEfx">Indicates whether the EFX extension should be initialized, if present.</param>
|
||||
/// <param name="efxMaxAuxSends">Requires EFX enabled. The number of desired Auxiliary Sends per source.</param>
|
||||
/// <exception cref="ArgumentNullException">Occurs when the device string is invalid.</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Occurs when a specified parameter is invalid.</exception>
|
||||
/// <exception cref="AudioDeviceException">
|
||||
/// Occurs when the specified device is not available, or is in use by another program.
|
||||
/// </exception>
|
||||
/// <exception cref="AudioContextException">
|
||||
/// Occurs when an audio context could not be created with the specified parameters.
|
||||
/// </exception>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Occurs when an AudioContext already exists.</exception>
|
||||
/// <remarks>
|
||||
/// <para>For maximum compatibility, you are strongly recommended to use the default constructor.</para>
|
||||
/// <para>Multiple AudioContexts are not supported at this point.</para>
|
||||
/// <para>
|
||||
/// The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well
|
||||
/// as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends.
|
||||
/// Values higher than supported will be clamped by the driver.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxMaxAuxSends)
|
||||
{
|
||||
CreateContext(device, freq, refresh, sync, enableEfx, efxMaxAuxSends);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion --- Constructors ---
|
||||
|
||||
#region --- Private Methods ---
|
||||
|
||||
#region CreateContext
|
||||
|
||||
/// <summary>May be passed at context construction time to indicate the number of desired auxiliary effect slot sends per source.</summary>
|
||||
public enum MaxAuxiliarySends:int
|
||||
{
|
||||
/// <summary>Will chose a reliably working parameter.</summary>
|
||||
UseDriverDefault = 0,
|
||||
/// <summary>One send per source.</summary>
|
||||
One = 1,
|
||||
/// <summary>Two sends per source.</summary>
|
||||
Two = 2,
|
||||
/// <summary>Three sends per source.</summary>
|
||||
Three = 3,
|
||||
/// <summary>Four sends per source.</summary>
|
||||
Four = 4,
|
||||
}
|
||||
|
||||
/// \internal
|
||||
/// <summary>Creates the audio context using the specified device.</summary>
|
||||
/// <param name="device">The device descriptor obtained through AudioContext.AvailableDevices, or null for the default device.</param>
|
||||
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
|
||||
/// <param name="sync">Flag, indicating a synchronous context.</param>
|
||||
/// <param name="enableEfx">Indicates whether the EFX extension should be initialized, if present.</param>
|
||||
/// <param name="efxAuxiliarySends">Requires EFX enabled. The number of desired Auxiliary Sends per source.</param>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Occurs when a specified parameter is invalid.</exception>
|
||||
/// <exception cref="AudioDeviceException">
|
||||
/// Occurs when the specified device is not available, or is in use by another program.
|
||||
/// </exception>
|
||||
/// <exception cref="AudioContextException">
|
||||
/// Occurs when an audio context could not be created with the specified parameters.
|
||||
/// </exception>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Occurs when an AudioContext already exists.</exception>
|
||||
/// <remarks>
|
||||
/// <para>For maximum compatibility, you are strongly recommended to use the default constructor.</para>
|
||||
/// <para>Multiple AudioContexts are not supported at this point.</para>
|
||||
/// <para>
|
||||
/// The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well
|
||||
/// as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends.
|
||||
/// Values higher than supported will be clamped by the driver.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
void CreateContext(string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxAuxiliarySends)
|
||||
{
|
||||
if (!AudioDeviceEnumerator.IsOpenALSupported)
|
||||
throw new DllNotFoundException("soft_oal.dll");
|
||||
|
||||
if (AudioDeviceEnumerator.Version == AudioDeviceEnumerator.AlcVersion.Alc1_1 && AudioDeviceEnumerator.AvailablePlaybackDevices.Count == 0) // Alc 1.0 does not support device enumeration.
|
||||
throw new NotSupportedException("No audio hardware is available.");
|
||||
if (context_exists) throw new NotSupportedException("Multiple AudioContexts are not supported.");
|
||||
if (freq < 0) throw new ArgumentOutOfRangeException("freq", freq, "Should be greater than zero.");
|
||||
if (refresh < 0) throw new ArgumentOutOfRangeException("refresh", refresh, "Should be greater than zero.");
|
||||
|
||||
|
||||
if (!String.IsNullOrEmpty(device))
|
||||
{
|
||||
device_name = device;
|
||||
device_handle = Alc.OpenDevice(device); // try to open device by name
|
||||
}
|
||||
if (device_handle == IntPtr.Zero)
|
||||
{
|
||||
device_name = "IntPtr.Zero (null string)";
|
||||
device_handle = Alc.OpenDevice(null); // try to open unnamed default device
|
||||
}
|
||||
if (device_handle == IntPtr.Zero)
|
||||
{
|
||||
device_name = AudioContext.DefaultDevice;
|
||||
device_handle = Alc.OpenDevice(AudioContext.DefaultDevice); // try to open named default device
|
||||
}
|
||||
if (device_handle == IntPtr.Zero)
|
||||
{
|
||||
device_name = "None";
|
||||
throw new AudioDeviceException(String.Format("Audio device '{0}' does not exist or is tied up by another application.",
|
||||
String.IsNullOrEmpty(device) ? "default" : device));
|
||||
}
|
||||
|
||||
CheckErrors();
|
||||
|
||||
// Build the attribute list
|
||||
List<int> attributes = new List<int>();
|
||||
|
||||
if (freq != 0)
|
||||
{
|
||||
attributes.Add((int)AlcContextAttributes.Frequency);
|
||||
attributes.Add(freq);
|
||||
}
|
||||
|
||||
if (refresh != 0)
|
||||
{
|
||||
attributes.Add((int)AlcContextAttributes.Refresh);
|
||||
attributes.Add(refresh);
|
||||
}
|
||||
|
||||
attributes.Add((int)AlcContextAttributes.Sync);
|
||||
attributes.Add(sync ? 1 : 0);
|
||||
|
||||
if (enableEfx && Alc.IsExtensionPresent(device_handle, "ALC_EXT_EFX"))
|
||||
{
|
||||
int num_slots;
|
||||
switch (efxAuxiliarySends)
|
||||
{
|
||||
case MaxAuxiliarySends.One:
|
||||
case MaxAuxiliarySends.Two:
|
||||
case MaxAuxiliarySends.Three:
|
||||
case MaxAuxiliarySends.Four:
|
||||
num_slots = (int)efxAuxiliarySends;
|
||||
break;
|
||||
default:
|
||||
case MaxAuxiliarySends.UseDriverDefault:
|
||||
Alc.GetInteger(device_handle, AlcGetInteger.EfxMaxAuxiliarySends, 1, out num_slots);
|
||||
break;
|
||||
}
|
||||
|
||||
attributes.Add((int)AlcContextAttributes.EfxMaxAuxiliarySends);
|
||||
attributes.Add(num_slots);
|
||||
}
|
||||
attributes.Add(0);
|
||||
|
||||
context_handle = Alc.CreateContext(device_handle, attributes.ToArray());
|
||||
|
||||
if (context_handle == ContextHandle.Zero)
|
||||
{
|
||||
Alc.CloseDevice(device_handle);
|
||||
throw new AudioContextException("The audio context could not be created with the specified parameters.");
|
||||
}
|
||||
|
||||
CheckErrors();
|
||||
|
||||
// HACK: OpenAL SI on Linux/ALSA crashes on MakeCurrent. This hack avoids calling MakeCurrent when
|
||||
// an old OpenAL version is detect - it may affect outdated OpenAL versions different than OpenAL SI,
|
||||
// but it looks like a good compromise for now.
|
||||
if (AudioDeviceEnumerator.AvailablePlaybackDevices.Count > 0)
|
||||
MakeCurrent();
|
||||
|
||||
CheckErrors();
|
||||
|
||||
device_name = Alc.GetString(device_handle, AlcGetString.DeviceSpecifier);
|
||||
|
||||
|
||||
lock (audio_context_lock)
|
||||
{
|
||||
available_contexts.Add(this.context_handle, this);
|
||||
context_exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion --- Private Methods ---
|
||||
|
||||
#region static void MakeCurrent(AudioContext context)
|
||||
|
||||
/// \internal
|
||||
/// <summary>Makes the specified AudioContext current in the calling thread.</summary>
|
||||
/// <param name="context">The OpenTK.Audio.AudioContext to make current, or null.</param>
|
||||
/// <exception cref="ObjectDisposedException">
|
||||
/// Occurs if this function is called after the AudioContext has been disposed.
|
||||
/// </exception>
|
||||
/// <exception cref="AudioContextException">
|
||||
/// Occurs when the AudioContext could not be made current.
|
||||
/// </exception>
|
||||
static void MakeCurrent(AudioContext context)
|
||||
{
|
||||
lock (audio_context_lock)
|
||||
{
|
||||
if (!Alc.MakeContextCurrent(context != null ? context.context_handle : ContextHandle.Zero))
|
||||
throw new AudioContextException(String.Format("ALC {0} error detected at {1}.",
|
||||
Alc.GetError(context != null ? (IntPtr)context.context_handle : IntPtr.Zero).ToString(),
|
||||
context != null ? context.ToString() : "null"));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region internal bool IsCurrent
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a System.Boolean indicating whether the AudioContext
|
||||
/// is current.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only one AudioContext can be current in the application at any time,
|
||||
/// <b>regardless of the number of threads</b>.
|
||||
/// </remarks>
|
||||
internal bool IsCurrent
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (audio_context_lock)
|
||||
{
|
||||
if (available_contexts.Count == 0)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
return AudioContext.CurrentContext == this;
|
||||
}
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value) AudioContext.MakeCurrent(this);
|
||||
else AudioContext.MakeCurrent(null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IntPtr Device
|
||||
|
||||
IntPtr Device { get { return device_handle; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Public Members ---
|
||||
|
||||
#region CheckErrors
|
||||
|
||||
/// <summary>
|
||||
/// Checks for ALC error conditions.
|
||||
/// </summary>
|
||||
/// <exception cref="OutOfMemoryException">Raised when an out of memory error is detected.</exception>
|
||||
/// <exception cref="AudioValueException">Raised when an invalid value is detected.</exception>
|
||||
/// <exception cref="AudioDeviceException">Raised when an invalid device is detected.</exception>
|
||||
/// <exception cref="AudioContextException">Raised when an invalid context is detected.</exception>
|
||||
public void CheckErrors()
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
new AudioDeviceErrorChecker(device_handle).Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CurrentError
|
||||
|
||||
/// <summary>
|
||||
/// Returns the ALC error code for this instance.
|
||||
/// </summary>
|
||||
public AlcError CurrentError
|
||||
{
|
||||
get
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
return Alc.GetError(device_handle);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region MakeCurrent
|
||||
|
||||
/// <summary>Makes the AudioContext current in the calling thread.</summary>
|
||||
/// <exception cref="ObjectDisposedException">
|
||||
/// Occurs if this function is called after the AudioContext has been disposed.
|
||||
/// </exception>
|
||||
/// <exception cref="AudioContextException">
|
||||
/// Occurs when the AudioContext could not be made current.
|
||||
/// </exception>
|
||||
/// <remarks>
|
||||
/// Only one AudioContext can be current in the application at any time,
|
||||
/// <b>regardless of the number of threads</b>.
|
||||
/// </remarks>
|
||||
public void MakeCurrent()
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
AudioContext.MakeCurrent(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsProcessing
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Boolean indicating whether the AudioContext is
|
||||
/// currently processing audio events.
|
||||
/// </summary>
|
||||
/// <seealso cref="Process"/>
|
||||
/// <seealso cref="Suspend"/>
|
||||
public bool IsProcessing
|
||||
{
|
||||
get
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
return is_processing;
|
||||
}
|
||||
private set { is_processing = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsSynchronized
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Boolean indicating whether the AudioContext is
|
||||
/// synchronized.
|
||||
/// </summary>
|
||||
/// <seealso cref="Process"/>
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
return is_synchronized;
|
||||
}
|
||||
private set { is_synchronized = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public void Process
|
||||
|
||||
/// <summary>
|
||||
/// Processes queued audio events.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// If AudioContext.IsSynchronized is true, this function will resume
|
||||
/// the internal audio processing thread. If AudioContext.IsSynchronized is false,
|
||||
/// you will need to call this function multiple times per second to process
|
||||
/// audio events.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// In some implementations this function may have no effect.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <exception cref="ObjectDisposedException">Occurs when this function is called after the AudioContext had been disposed.</exception>
|
||||
/// <seealso cref="Suspend"/>
|
||||
/// <seealso cref="IsProcessing"/>
|
||||
/// <seealso cref="IsSynchronized"/>
|
||||
public void Process()
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
Alc.ProcessContext(this.context_handle);
|
||||
IsProcessing = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public void Suspend
|
||||
|
||||
/// <summary>
|
||||
/// Suspends processing of audio events.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// To avoid audio artifacts when calling this function, set audio gain to zero before
|
||||
/// suspending an AudioContext.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// In some implementations, it can be faster to suspend processing before changing
|
||||
/// AudioContext state.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// In some implementations this function may have no effect.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <exception cref="ObjectDisposedException">Occurs when this function is called after the AudioContext had been disposed.</exception>
|
||||
/// <seealso cref="Process"/>
|
||||
/// <seealso cref="IsProcessing"/>
|
||||
/// <seealso cref="IsSynchronized"/>
|
||||
public void Suspend()
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
Alc.SuspendContext(this.context_handle);
|
||||
IsProcessing = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public bool SupportsExtension(string extension)
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the specified OpenAL extension is supported.
|
||||
/// </summary>
|
||||
/// <param name="extension">The name of the extension to check (e.g. "ALC_EXT_EFX").</param>
|
||||
/// <returns>true if the extension is supported; false otherwise.</returns>
|
||||
public bool SupportsExtension(string extension)
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
return Alc.IsExtensionPresent(this.Device, extension);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CurrentDevice
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.String with the name of the device used in this context.
|
||||
/// </summary>
|
||||
public string CurrentDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException(this.GetType().FullName);
|
||||
|
||||
return device_name;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion --- Public Members ---
|
||||
|
||||
#region --- Static Members ---
|
||||
|
||||
#region public static AudioContext CurrentContext
|
||||
|
||||
/// <summary>
|
||||
/// Gets the OpenTK.Audio.AudioContext which is current in the application.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only one AudioContext can be current in the application at any time,
|
||||
/// <b>regardless of the number of threads</b>.
|
||||
/// </remarks>
|
||||
public static AudioContext CurrentContext
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (audio_context_lock)
|
||||
{
|
||||
if (available_contexts.Count == 0)
|
||||
return null;
|
||||
else
|
||||
{
|
||||
AudioContext context;
|
||||
AudioContext.available_contexts.TryGetValue(
|
||||
(ContextHandle)Alc.GetCurrentContext(),
|
||||
out context);
|
||||
return context;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AvailableDevices
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of strings containing all known playback devices.
|
||||
/// </summary>
|
||||
public static IList<string> AvailableDevices
|
||||
{
|
||||
get
|
||||
{
|
||||
return AudioDeviceEnumerator.AvailablePlaybackDevices;
|
||||
}
|
||||
}
|
||||
#endregion public static IList<string> AvailablePlaybackDevices
|
||||
|
||||
#region DefaultDevice
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the device that will be used as playback default.
|
||||
/// </summary>
|
||||
public static string DefaultDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
return AudioDeviceEnumerator.DefaultPlaybackDevice;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- IDisposable Members ---
|
||||
|
||||
/// <summary>
|
||||
/// Disposes of the AudioContext, cleaning up all resources consumed by it.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
void Dispose(bool manual)
|
||||
{
|
||||
if (!disposed)
|
||||
{
|
||||
if (this.IsCurrent)
|
||||
this.IsCurrent = false;
|
||||
|
||||
if (context_handle != ContextHandle.Zero)
|
||||
{
|
||||
available_contexts.Remove(context_handle);
|
||||
Alc.DestroyContext(context_handle);
|
||||
}
|
||||
|
||||
if (device_handle != IntPtr.Zero)
|
||||
Alc.CloseDevice(device_handle);
|
||||
|
||||
if (manual)
|
||||
{
|
||||
}
|
||||
disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes this instance.
|
||||
/// </summary>
|
||||
~AudioContext()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Overrides ---
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the hash code for this instance.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares this instance with another.
|
||||
/// </summary>
|
||||
/// <param name="obj">The instance to compare to.</param>
|
||||
/// <returns>True, if obj refers to this instance; false otherwise.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String"/> that desrcibes this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.String"/> that desrcibes this instance.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{0} (handle: {1}, device: {2})",
|
||||
this.device_name, this.context_handle, this.device_handle);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
/// <summary>Represents exceptions related to an OpenTK.Audio.AudioContext.</summary>
|
||||
public class AudioContextException : AudioException
|
||||
{
|
||||
/// <summary>Constructs a new AudioContextException.</summary>
|
||||
public AudioContextException() : base() { }
|
||||
/// <summary>Constructs a new AudioContextException with the specified error message.</summary>
|
||||
/// <param name="message">The error message of the AudioContextException.</param>
|
||||
public AudioContextException(string message) : base(message) { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,218 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
using OpenTK.Audio.OpenAL;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
internal static class AudioDeviceEnumerator
|
||||
{
|
||||
#region All device strings
|
||||
|
||||
private static readonly List<string> available_playback_devices = new List<string>();
|
||||
private static readonly List<string> available_recording_devices = new List<string>();
|
||||
|
||||
internal static IList<string> AvailablePlaybackDevices
|
||||
{
|
||||
get
|
||||
{
|
||||
return available_playback_devices.AsReadOnly();
|
||||
}
|
||||
}
|
||||
internal static IList<string> AvailableRecordingDevices
|
||||
{
|
||||
get
|
||||
{
|
||||
return available_recording_devices.AsReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion All device strings
|
||||
|
||||
#region Default device strings
|
||||
|
||||
private static string default_playback_device;
|
||||
internal static string DefaultPlaybackDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
return default_playback_device;
|
||||
}
|
||||
}
|
||||
|
||||
private static string default_recording_device;
|
||||
internal static string DefaultRecordingDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
return default_recording_device;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Default device strings
|
||||
|
||||
#region Is OpenAL supported?
|
||||
|
||||
private static bool openal_supported = true;
|
||||
internal static bool IsOpenALSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
return openal_supported;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Is OpenAL supported?
|
||||
|
||||
#region Alc Version number
|
||||
|
||||
internal enum AlcVersion
|
||||
{
|
||||
Alc1_0,
|
||||
Alc1_1
|
||||
}
|
||||
|
||||
private static AlcVersion version;
|
||||
internal static AlcVersion Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Alc Version number
|
||||
|
||||
#region Constructors
|
||||
|
||||
// Loads all available audio devices into the available_*_devices lists.
|
||||
static AudioDeviceEnumerator()
|
||||
{
|
||||
IntPtr dummy_device = IntPtr.Zero;
|
||||
ContextHandle dummy_context = ContextHandle.Zero;
|
||||
|
||||
try
|
||||
{
|
||||
Debug.WriteLine("Enumerating audio devices.");
|
||||
Debug.Indent();
|
||||
|
||||
// need a dummy context for correct results
|
||||
dummy_device = Alc.OpenDevice(null);
|
||||
dummy_context = Alc.CreateContext(dummy_device, (int[])null);
|
||||
bool dummy_success = Alc.MakeContextCurrent(dummy_context);
|
||||
AlcError dummy_error = Alc.GetError(dummy_device);
|
||||
if (!dummy_success || dummy_error != AlcError.NoError)
|
||||
{
|
||||
throw new AudioContextException("Failed to create dummy Context. Device (" + dummy_device.ToString() +
|
||||
") Context (" + dummy_context.Handle.ToString() +
|
||||
") MakeContextCurrent " + (dummy_success ? "succeeded" : "failed") +
|
||||
", Alc Error (" + dummy_error.ToString() + ") " + Alc.GetString(IntPtr.Zero, (AlcGetString)dummy_error));
|
||||
}
|
||||
|
||||
// Get a list of all known playback devices, using best extension available
|
||||
if (Alc.IsExtensionPresent(IntPtr.Zero, "ALC_ENUMERATION_EXT"))
|
||||
{
|
||||
version = AlcVersion.Alc1_1;
|
||||
if (Alc.IsExtensionPresent(IntPtr.Zero, "ALC_ENUMERATE_ALL_EXT"))
|
||||
{
|
||||
available_playback_devices.AddRange(Alc.GetString(IntPtr.Zero, AlcGetStringList.AllDevicesSpecifier));
|
||||
default_playback_device = Alc.GetString(IntPtr.Zero, AlcGetString.DefaultAllDevicesSpecifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
available_playback_devices.AddRange(Alc.GetString(IntPtr.Zero, AlcGetStringList.DeviceSpecifier));
|
||||
default_playback_device = Alc.GetString(IntPtr.Zero, AlcGetString.DefaultDeviceSpecifier);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
version = AlcVersion.Alc1_0;
|
||||
Debug.Print("Device enumeration extension not available. Failed to enumerate playback devices.");
|
||||
}
|
||||
AlcError playback_err = Alc.GetError(dummy_device);
|
||||
if (playback_err != AlcError.NoError)
|
||||
throw new AudioContextException("Alc Error occured when querying available playback devices. " + playback_err.ToString());
|
||||
|
||||
// Get a list of all known recording devices, at least ALC_ENUMERATION_EXT is needed too
|
||||
if (version == AlcVersion.Alc1_1 && Alc.IsExtensionPresent(IntPtr.Zero, "ALC_EXT_CAPTURE"))
|
||||
{
|
||||
available_recording_devices.AddRange(Alc.GetString(IntPtr.Zero, AlcGetStringList.CaptureDeviceSpecifier));
|
||||
default_recording_device = Alc.GetString(IntPtr.Zero, AlcGetString.CaptureDefaultDeviceSpecifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Print("Capture extension not available. Failed to enumerate recording devices.");
|
||||
}
|
||||
AlcError record_err = Alc.GetError(dummy_device);
|
||||
if (record_err != AlcError.NoError)
|
||||
throw new AudioContextException("Alc Error occured when querying available recording devices. " + record_err.ToString());
|
||||
|
||||
#if DEBUG
|
||||
Debug.WriteLine("Found playback devices:");
|
||||
foreach (string s in available_playback_devices)
|
||||
Debug.WriteLine(s);
|
||||
|
||||
Debug.WriteLine("Default playback device: " + default_playback_device);
|
||||
|
||||
Debug.WriteLine("Found recording devices:");
|
||||
foreach (string s in available_recording_devices)
|
||||
Debug.WriteLine(s);
|
||||
|
||||
Debug.WriteLine("Default recording device: " + default_recording_device);
|
||||
#endif
|
||||
}
|
||||
catch (DllNotFoundException e)
|
||||
{
|
||||
Trace.WriteLine(e.ToString());
|
||||
openal_supported = false;
|
||||
}
|
||||
catch (AudioContextException ace)
|
||||
{
|
||||
Trace.WriteLine(ace.ToString());
|
||||
openal_supported = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Debug.Unindent();
|
||||
|
||||
// clean up the dummy context
|
||||
Alc.MakeContextCurrent(ContextHandle.Zero);
|
||||
if (dummy_context != ContextHandle.Zero && dummy_context.Handle != IntPtr.Zero)
|
||||
Alc.DestroyContext(dummy_context);
|
||||
if (dummy_device != IntPtr.Zero)
|
||||
Alc.CloseDevice(dummy_device);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using OpenTK.Audio.OpenAL;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
struct AudioDeviceErrorChecker : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
readonly IntPtr Device;
|
||||
static readonly string ErrorString = "Device {0} reported {1}.";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public AudioDeviceErrorChecker(IntPtr device)
|
||||
{
|
||||
if (device == IntPtr.Zero)
|
||||
throw new AudioDeviceException();
|
||||
|
||||
Device = device;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
AlcError err = Alc.GetError(Device);
|
||||
switch (err)
|
||||
{
|
||||
case AlcError.OutOfMemory:
|
||||
throw new OutOfMemoryException(String.Format(ErrorString, Device, err));
|
||||
|
||||
case AlcError.InvalidValue:
|
||||
throw new AudioValueException(String.Format(ErrorString, Device, err));
|
||||
|
||||
case AlcError.InvalidDevice:
|
||||
throw new AudioDeviceException(String.Format(ErrorString, Device, err));
|
||||
|
||||
case AlcError.InvalidContext:
|
||||
throw new AudioContextException(String.Format(ErrorString, Device, err));
|
||||
|
||||
case AlcError.NoError:
|
||||
default:
|
||||
// everything went fine, do nothing
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
/// <summary>Represents exceptions related to an OpenTK.Audio device.</summary>
|
||||
public class AudioDeviceException : AudioException
|
||||
{
|
||||
/// <summary>Constructs a new AudioDeviceException.</summary>
|
||||
public AudioDeviceException() : base() { }
|
||||
/// <summary>Constructs a new AudioDeviceException with the specified error message.</summary>
|
||||
/// <param name="message">The error message of the AudioDeviceException.</param>
|
||||
public AudioDeviceException(string message) : base(message) { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
/// <summary>Represents exceptions related to the OpenTK.Audio subsystem.</summary>
|
||||
public class AudioException : Exception
|
||||
{
|
||||
/// <summary>Constructs a new AudioException.</summary>
|
||||
public AudioException() : base() { }
|
||||
/// <summary>Constructs a new AudioException with the specified error message.</summary>
|
||||
/// <param name="message">The error message of the AudioException.</param>
|
||||
public AudioException(string message) : base(message) { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Audio
|
||||
{
|
||||
/// <summary>Represents exceptions related to invalid values.</summary>
|
||||
public class AudioValueException : AudioException
|
||||
{
|
||||
/// <summary>Constructs a new instance.</summary>
|
||||
public AudioValueException() : base() { }
|
||||
/// <summary>Constructs a new instance with the specified error message.</summary>
|
||||
/// <param name="message">The error message of the AudioContextException.</param>
|
||||
public AudioValueException(string message) : base(message) { }
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,450 @@
|
|||
#region --- OpenTK.OpenAL License ---
|
||||
/* AlTokens.cs
|
||||
* C header: \OpenAL 1.1 SDK\include\Al.h
|
||||
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
|
||||
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
|
||||
* See license.txt for license details
|
||||
* http://www.OpenTK.net */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenTK.Audio.OpenAL
|
||||
{
|
||||
|
||||
///<summary>A list of valid Enable/Disable/IsEnabled parameters</summary>
|
||||
public enum ALCapability : int
|
||||
{
|
||||
///<summary>Currently no state toggles exist for vanilla OpenAL and no Extension uses it.</summary>
|
||||
Invalid = -1,
|
||||
}
|
||||
|
||||
///<summary>A list of valid 32-bit Float Listener/GetListener parameters</summary>
|
||||
public enum ALListenerf : int
|
||||
{
|
||||
///<summary>Indicate the gain (Volume amplification) applied. Type: float Range: [0.0f - ? ] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB. A value of 0.0f is interpreted as zero volume and the channel is effectively disabled.</summary>
|
||||
Gain = 0x100A,
|
||||
|
||||
///<summary>(EFX Extension) This setting is critical if Air Absorption effects are enabled because the amount of Air Absorption applied is directly related to the real-world distance between the Source and the Listener. centimeters 0.01f meters 1.0f kilometers 1000.0f Range [float.MinValue .. float.MaxValue] Default: 1.0f</summary>
|
||||
EfxMetersPerUnit = 0x20004,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Math.Vector3 Listener/GetListener parameters</summary>
|
||||
public enum ALListener3f : int
|
||||
{
|
||||
///<summary>Specify the current location in three dimensional space. OpenAL, like OpenGL, uses a right handed coordinate system, where in a frontal default view X (thumb) points right, Y points up (index finger), and Z points towards the viewer/camera (middle finger). To switch from a left handed coordinate system, flip the sign on the Z coordinate. Listener position is always in the world coordinate system.</summary>
|
||||
Position = 0x1004,
|
||||
|
||||
///<summary>Specify the current velocity in three dimensional space.</summary>
|
||||
Velocity = 0x1006,
|
||||
}
|
||||
|
||||
///<summary>A list of valid float[] Listener/GetListener parameters</summary>
|
||||
public enum ALListenerfv : int
|
||||
{
|
||||
///<summary>Indicate Listener orientation. Expects two Vector3, At followed by Up.</summary>
|
||||
Orientation = 0x100F,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Integer Buffer parameters</summary>
|
||||
public enum ALBufferi : int
|
||||
{
|
||||
UnpackBlockAlignmentSoft = 0x200C,
|
||||
PackBlockAlignmentSoft = 0x200D
|
||||
}
|
||||
|
||||
//<summary>A list of valid Integer Vector Buffer/GetBuffer parameters</summary>
|
||||
public enum ALBufferiv : int
|
||||
{
|
||||
LoopPointsSoft = 0x2015,
|
||||
}
|
||||
|
||||
///<summary>A list of valid 32-bit Float Source/GetSource parameters</summary>
|
||||
public enum ALSourcef : int
|
||||
{
|
||||
///<summary>Source specific reference distance. Type: float Range: [0.0f - float.PositiveInfinity] At 0.0f, no distance attenuation occurs. Type: float Default: 1.0f.</summary>
|
||||
ReferenceDistance = 0x1020,
|
||||
|
||||
///<summary>Indicate distance above which Sources are not attenuated using the inverse clamped distance model. Default: float.PositiveInfinity Type: float Range: [0.0f - float.PositiveInfinity]</summary>
|
||||
MaxDistance = 0x1023,
|
||||
|
||||
///<summary>Source specific rolloff factor. Type: float Range: [0.0f - float.PositiveInfinity]</summary>
|
||||
RolloffFactor = 0x1021,
|
||||
|
||||
///<summary>Specify the pitch to be applied, either at Source, or on mixer results, at Listener. Range: [0.5f - 2.0f] Default: 1.0f</summary>
|
||||
Pitch = 0x1003,
|
||||
|
||||
///<summary>Indicate the gain (volume amplification) applied. Type: float. Range: [0.0f - ? ] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB. A value of 0.0f is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled.</summary>
|
||||
Gain = 0x100A,
|
||||
|
||||
///<summary>Indicate minimum Source attenuation. Type: float Range: [0.0f - 1.0f] (Logarthmic)</summary>
|
||||
MinGain = 0x100D,
|
||||
|
||||
///<summary>Indicate maximum Source attenuation. Type: float Range: [0.0f - 1.0f] (Logarthmic)</summary>
|
||||
MaxGain = 0x100E,
|
||||
|
||||
///<summary>Directional Source, inner cone angle, in degrees. Range: [0-360] Default: 360</summary>
|
||||
ConeInnerAngle = 0x1001,
|
||||
|
||||
///<summary>Directional Source, outer cone angle, in degrees. Range: [0-360] Default: 360</summary>
|
||||
ConeOuterAngle = 0x1002,
|
||||
|
||||
///<summary>Directional Source, outer cone gain. Default: 0.0f Range: [0.0f - 1.0] (Logarithmic)</summary>
|
||||
ConeOuterGain = 0x1022,
|
||||
|
||||
/// <summary>The playback position, expressed in seconds.</summary>
|
||||
SecOffset = 0x1024, // AL_EXT_OFFSET extension.
|
||||
|
||||
///<summary>(EFX Extension) This property is a multiplier on the amount of Air Absorption applied to the Source. The AL_AIR_ABSORPTION_FACTOR is multiplied by an internal Air Absorption Gain HF value of 0.994 (-0.05dB) per meter which represents normal atmospheric humidity and temperature. Range [0.0f .. 10.0f] Default: 0.0f</summary>
|
||||
EfxAirAbsorptionFactor = 0x20007,
|
||||
|
||||
///<summary>(EFX Extension) This property is defined the same way as the Reverb Room Rolloff property: it is one of two methods available in the Effect Extension to attenuate the reflected sound (early reflections and reverberation) according to source-listener distance. Range [0.0f .. 10.0f] Default: 0.0f</summary>
|
||||
EfxRoomRolloffFactor = 0x20008,
|
||||
|
||||
///<summary>(EFX Extension) A directed Source points in a specified direction. The Source sounds at full volume when the listener is directly in front of the source; it is attenuated as the listener circles the Source away from the front. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
EfxConeOuterGainHighFrequency = 0x20009,
|
||||
|
||||
}
|
||||
|
||||
///<summary>A list of valid Math.Vector3 Source/GetSource parameters</summary>
|
||||
public enum ALSource3f : int
|
||||
{
|
||||
///<summary>Specify the current location in three dimensional space. OpenAL, like OpenGL, uses a right handed coordinate system, where in a frontal default view X (thumb) points right, Y points up (index finger), and Z points towards the viewer/camera (middle finger). To switch from a left handed coordinate system, flip the sign on the Z coordinate. Listener position is always in the world coordinate system.</summary>
|
||||
Position = 0x1004,
|
||||
|
||||
///<summary>Specify the current velocity in three dimensional space.</summary>
|
||||
Velocity = 0x1006,
|
||||
|
||||
///<summary>Specify the current direction vector.</summary>
|
||||
Direction = 0x1005,
|
||||
}
|
||||
|
||||
///<summary>A list of valid 8-bit boolean Source/GetSource parameters</summary>
|
||||
public enum ALSourceb : int
|
||||
{
|
||||
///<summary>Indicate that the Source has relative coordinates. Type: bool Range: [True, False]</summary>
|
||||
SourceRelative = 0x202,
|
||||
|
||||
///<summary>Indicate whether the Source is looping. Type: bool Range: [True, False] Default: False.</summary>
|
||||
Looping = 0x1007,
|
||||
|
||||
///<summary>(EFX Extension) If this Source property is set to True, this Source’s direct-path is automatically filtered according to the orientation of the source relative to the listener and the setting of the Source property Sourcef.ConeOuterGainHF. Type: bool Range [False, True] Default: True</summary>
|
||||
EfxDirectFilterGainHighFrequencyAuto = 0x2000A,
|
||||
|
||||
///<summary>(EFX Extension) If this Source property is set to True, the intensity of this Source’s reflected sound is automatically attenuated according to source-listener distance and source directivity (as determined by the cone parameters). If it is False, the reflected sound is not attenuated according to distance and directivity. Type: bool Range [False, True] Default: True</summary>
|
||||
EfxAuxiliarySendFilterGainAuto = 0x2000B,
|
||||
|
||||
///<summary>(EFX Extension) If this Source property is AL_TRUE (its default value), the intensity of this Source’s reflected sound at high frequencies will be automatically attenuated according to the high-frequency source directivity as set by the Sourcef.ConeOuterGainHF property. If this property is AL_FALSE, the Source’s reflected sound is not filtered at all according to the Source’s directivity. Type: bool Range [False, True] Default: True</summary>
|
||||
EfxAuxiliarySendFilterGainHighFrequencyAuto = 0x2000C,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Int32 Source parameters</summary>
|
||||
public enum ALSourcei : int
|
||||
{
|
||||
///<summary>The playback position, expressed in bytes.</summary>
|
||||
ByteOffset = 0x1026, // AL_EXT_OFFSET extension.
|
||||
|
||||
///<summary>The playback position, expressed in samples.</summary>
|
||||
SampleOffset = 0x1025, // AL_EXT_OFFSET extension.
|
||||
|
||||
///<summary>Indicate the Buffer to provide sound samples. Type: uint Range: any valid Buffer Handle.</summary>
|
||||
Buffer = 0x1009,
|
||||
|
||||
///<summary>Source type (Static, Streaming or undetermined). Use enum AlSourceType for comparison</summary>
|
||||
SourceType = 0x1027,
|
||||
|
||||
///<summary>(EFX Extension) This Source property is used to apply filtering on the direct-path (dry signal) of a Source.</summary>
|
||||
EfxDirectFilter = 0x20005,
|
||||
}
|
||||
|
||||
///<summary>A list of valid 3x Int32 Source/GetSource parameters</summary>
|
||||
public enum ALSource3i : int
|
||||
{
|
||||
///<summary>(EFX Extension) This Source property is used to establish connections between Sources and Auxiliary Effect Slots. For a Source to feed an Effect that has been loaded into an Auxiliary Effect Slot the application must configure one of the Source’s auxiliary sends. This process involves setting 3 variables – the destination Auxiliary Effect Slot ID, the Auxiliary Send number, and an optional Filter ID. Type: uint Range: any valid Filter Handle.</summary>
|
||||
EfxAuxiliarySendFilter = 0x20006,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Int32 GetSource parameters</summary>
|
||||
public enum ALGetSourcei : int
|
||||
{
|
||||
///<summary>The playback position, expressed in bytes. AL_EXT_OFFSET Extension.</summary>
|
||||
ByteOffset = 0x1026,
|
||||
|
||||
///<summary>The playback position, expressed in samples. AL_EXT_OFFSET Extension.</summary>
|
||||
SampleOffset = 0x1025,
|
||||
|
||||
///<summary>Indicate the Buffer to provide sound samples. Type: uint Range: any valid Buffer Handle.</summary>
|
||||
Buffer = 0x1009,
|
||||
|
||||
/// <summary>The state of the source (Stopped, Playing, etc.) Use the enum AlSourceState for comparison.</summary>
|
||||
SourceState = 0x1010,
|
||||
|
||||
/// <summary>The number of buffers queued on this source.</summary>
|
||||
BuffersQueued = 0x1015,
|
||||
|
||||
/// <summary>The number of buffers in the queue that have been processed.</summary>
|
||||
BuffersProcessed = 0x1016,
|
||||
|
||||
///<summary>Source type (Static, Streaming or undetermined). Use enum AlSourceType for comparison.</summary>
|
||||
SourceType = 0x1027,
|
||||
}
|
||||
|
||||
/*
|
||||
public enum ALDeprecated : int
|
||||
{
|
||||
///<summary>Deprecated. Specify the channel mask. (Creative) Type: uint Range: [0 - 255]</summary>
|
||||
ChannelMask = 0x3000,
|
||||
}
|
||||
*/
|
||||
|
||||
///<summary>Source state information, can be retrieved by AL.Source() with ALSourcei.SourceState.</summary>
|
||||
public enum ALSourceState : int
|
||||
{
|
||||
///<summary>Default State when loaded, can be manually set with AL.SourceRewind().</summary>
|
||||
Initial = 0x1011,
|
||||
|
||||
///<summary>The source is currently playing.</summary>
|
||||
Playing = 0x1012,
|
||||
|
||||
///<summary>The source has paused playback.</summary>
|
||||
Paused = 0x1013,
|
||||
|
||||
///<summary>The source is not playing.</summary>
|
||||
Stopped = 0x1014,
|
||||
}
|
||||
|
||||
///<summary>Source type information, can be retrieved by AL.Source() with ALSourcei.SourceType.</summary>
|
||||
public enum ALSourceType : int
|
||||
{
|
||||
///<summary>Source is Static if a Buffer has been attached using AL.Source with the parameter Sourcei.Buffer.</summary>
|
||||
Static = 0x1028,
|
||||
|
||||
///<summary>Source is Streaming if one or more Buffers have been attached using AL.SourceQueueBuffers</summary>
|
||||
Streaming = 0x1029,
|
||||
|
||||
///<summary>Source is undetermined when it has a null Buffer attached</summary>
|
||||
Undetermined = 0x1030,
|
||||
}
|
||||
|
||||
///<summary>Sound samples: Format specifier.</summary>
|
||||
public enum ALFormat : int
|
||||
{
|
||||
///<summary>1 Channel, 8 bits per sample.</summary>
|
||||
Mono8 = 0x1100,
|
||||
|
||||
///<summary>1 Channel, 16 bits per sample.</summary>
|
||||
Mono16 = 0x1101,
|
||||
|
||||
///<summary>2 Channels, 8 bits per sample each.</summary>
|
||||
Stereo8 = 0x1102,
|
||||
|
||||
///<summary>2 Channels, 16 bits per sample each.</summary>
|
||||
Stereo16 = 0x1103,
|
||||
|
||||
/// <summary>1 Channel, A-law encoded data. Requires Extension: AL_EXT_ALAW</summary>
|
||||
MonoALawExt = 0x10016,
|
||||
|
||||
/// <summary>2 Channels, A-law encoded data. Requires Extension: AL_EXT_ALAW</summary>
|
||||
StereoALawExt = 0x10017,
|
||||
|
||||
/// <summary>1 Channel, µ-law encoded data. Requires Extension: AL_EXT_MULAW</summary>
|
||||
MonoMuLawExt = 0x10014,
|
||||
|
||||
/// <summary>2 Channels, µ-law encoded data. Requires Extension: AL_EXT_MULAW</summary>
|
||||
StereoMuLawExt = 0x10015,
|
||||
|
||||
/// <summary>Ogg Vorbis encoded data. Requires Extension: AL_EXT_vorbis</summary>
|
||||
VorbisExt = 0x10003,
|
||||
|
||||
/// <summary>MP3 encoded data. Requires Extension: AL_EXT_mp3</summary>
|
||||
Mp3Ext = 0x10020,
|
||||
|
||||
/// <summary>1 Channel, IMA4 ADPCM encoded data. Requires Extension: AL_EXT_IMA4</summary>
|
||||
MonoIma4Ext = 0x1300,
|
||||
|
||||
/// <summary>2 Channels, IMA4 ADPCM encoded data. Requires Extension: AL_EXT_IMA4</summary>
|
||||
StereoIma4Ext = 0x1301,
|
||||
|
||||
/// <summary>1 Channel, MSADPCM encoded data. Requires Extension: AL_SOFT_MSADPCM</summary>
|
||||
MonoMsadpcmSoft = 0x1302,
|
||||
|
||||
/// <summary>2 Channels, MSADPCM encoded data. Requires Extension: AL_SOFT_MSADPCM</summary>
|
||||
StereoMsadpcmSoft = 0x1303,
|
||||
|
||||
/// <summary>1 Channel, single-precision floating-point data. Requires Extension: AL_EXT_float32</summary>
|
||||
MonoFloat32Ext = 0x10010,
|
||||
|
||||
/// <summary>2 Channels, single-precision floating-point data. Requires Extension: AL_EXT_float32</summary>
|
||||
StereoFloat32Ext = 0x10011,
|
||||
|
||||
/// <summary>1 Channel, double-precision floating-point data. Requires Extension: AL_EXT_double</summary>
|
||||
MonoDoubleExt = 0x10012,
|
||||
|
||||
/// <summary>2 Channels, double-precision floating-point data. Requires Extension: AL_EXT_double</summary>
|
||||
StereoDoubleExt = 0x10013,
|
||||
|
||||
/// <summary>Multichannel 5.1, 16-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi51Chn16Ext = 0x120B,
|
||||
|
||||
/// <summary>Multichannel 5.1, 32-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi51Chn32Ext = 0x120C,
|
||||
|
||||
/// <summary>Multichannel 5.1, 8-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi51Chn8Ext = 0x120A,
|
||||
|
||||
/// <summary>Multichannel 6.1, 16-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi61Chn16Ext = 0x120E,
|
||||
|
||||
/// <summary>Multichannel 6.1, 32-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi61Chn32Ext = 0x120F,
|
||||
|
||||
/// <summary>Multichannel 6.1, 8-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi61Chn8Ext = 0x120D,
|
||||
|
||||
/// <summary>Multichannel 7.1, 16-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi71Chn16Ext = 0x1211,
|
||||
|
||||
/// <summary>Multichannel 7.1, 32-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi71Chn32Ext = 0x1212,
|
||||
|
||||
/// <summary>Multichannel 7.1, 8-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
Multi71Chn8Ext = 0x1210,
|
||||
|
||||
/// <summary>Multichannel 4.0, 16-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
MultiQuad16Ext = 0x1205,
|
||||
|
||||
/// <summary>Multichannel 4.0, 32-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
MultiQuad32Ext = 0x1206,
|
||||
|
||||
/// <summary>Multichannel 4.0, 8-bit data. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
MultiQuad8Ext = 0x1204,
|
||||
|
||||
/// <summary>1 Channel rear speaker, 16-bit data. See Quadrophonic setups. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
MultiRear16Ext = 0x1208,
|
||||
|
||||
/// <summary>1 Channel rear speaker, 32-bit data. See Quadrophonic setups. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
MultiRear32Ext = 0x1209,
|
||||
|
||||
/// <summary>1 Channel rear speaker, 8-bit data. See Quadrophonic setups. Requires Extension: AL_EXT_MCFORMATS</summary>
|
||||
MultiRear8Ext = 0x1207,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Int32 GetBuffer parameters</summary>
|
||||
public enum ALGetBufferi : int
|
||||
{
|
||||
///<summary>Sound sample's frequency, in units of hertz [Hz]. This is the number of samples per second. Half of the sample frequency marks the maximum significant frequency component.</summary>
|
||||
Frequency = 0x2001,
|
||||
|
||||
/// <summary>Bit depth of the buffer. Should be 8 or 16.</summary>
|
||||
Bits = 0x2002,
|
||||
|
||||
/// <summary>Number of channels in buffer. > 1 is valid, but buffer won’t be positioned when played. 1 for Mono, 2 for Stereo.</summary>
|
||||
Channels = 0x2003,
|
||||
|
||||
/// <summary>size of the Buffer in bytes.</summary>
|
||||
Size = 0x2004,
|
||||
|
||||
// Deprecated: From Manual, not in header: AL_DATA ( i, iv ) original location where buffer was copied from generally useless, as was probably freed after buffer creation
|
||||
}
|
||||
|
||||
///<summary>Buffer state. Not supported for public use (yet).</summary>
|
||||
public enum ALBufferState : int
|
||||
{
|
||||
///<summary>Buffer state. Not supported for public use (yet).</summary>
|
||||
Unused = 0x2010,
|
||||
|
||||
///<summary>Buffer state. Not supported for public use (yet).</summary>
|
||||
Pending = 0x2011,
|
||||
|
||||
///<summary>Buffer state. Not supported for public use (yet).</summary>
|
||||
Processed = 0x2012,
|
||||
}
|
||||
|
||||
/// <summary>Returned by AL.GetError</summary>
|
||||
public enum ALError : int
|
||||
{
|
||||
///<summary>No OpenAL Error.</summary>
|
||||
NoError = 0,
|
||||
|
||||
///<summary>Invalid Name paramater passed to OpenAL call.</summary>
|
||||
InvalidName = 0xA001,
|
||||
|
||||
///<summary>Invalid parameter passed to OpenAL call.</summary>
|
||||
IllegalEnum = 0xA002,
|
||||
///<summary>Invalid parameter passed to OpenAL call.</summary>
|
||||
InvalidEnum = 0xA002,
|
||||
|
||||
///<summary>Invalid OpenAL enum parameter value.</summary>
|
||||
InvalidValue = 0xA003,
|
||||
|
||||
///<summary>Illegal OpenAL call.</summary>
|
||||
IllegalCommand = 0xA004,
|
||||
///<summary>Illegal OpenAL call.</summary>
|
||||
InvalidOperation = 0xA004,
|
||||
|
||||
///<summary>No OpenAL memory left.</summary>
|
||||
OutOfMemory = 0xA005,
|
||||
}
|
||||
|
||||
///<summary>A list of valid string AL.Get() parameters</summary>
|
||||
public enum ALGetString : int
|
||||
{
|
||||
/// <summary>Gets the Vendor name.</summary>
|
||||
Vendor = 0xB001,
|
||||
|
||||
/// <summary>Gets the driver version.</summary>
|
||||
Version = 0xB002,
|
||||
|
||||
/// <summary>Gets the renderer mode.</summary>
|
||||
Renderer = 0xB003,
|
||||
|
||||
/// <summary>Gets a list of all available Extensions, separated with spaces.</summary>
|
||||
Extensions = 0xB004,
|
||||
}
|
||||
|
||||
///<summary>A list of valid 32-bit Float AL.Get() parameters</summary>
|
||||
public enum ALGetFloat : int
|
||||
{
|
||||
///<summary>Doppler scale. Default 1.0f</summary>
|
||||
DopplerFactor = 0xC000,
|
||||
|
||||
///<summary>Tweaks speed of propagation. This functionality is deprecated.</summary>
|
||||
DopplerVelocity = 0xC001,
|
||||
|
||||
///<summary>Speed of Sound in units per second. Default: 343.3f</summary>
|
||||
SpeedOfSound = 0xC003,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Int32 AL.Get() parameters</summary>
|
||||
public enum ALGetInteger : int
|
||||
{
|
||||
///<summary>See enum ALDistanceModel.</summary><see cref="ALDistanceModel"/>
|
||||
DistanceModel = 0xD000,
|
||||
}
|
||||
|
||||
/// <summary>Used by AL.DistanceModel(), the distance model can be retrieved by AL.Get() with ALGetInteger.DistanceModel</summary>
|
||||
public enum ALDistanceModel : int
|
||||
{
|
||||
///<summary>Bypasses all distance attenuation calculation for all Sources.</summary>
|
||||
None = 0,
|
||||
|
||||
///<summary>InverseDistance is equivalent to the IASIG I3DL2 model with the exception that ALSourcef.ReferenceDistance does not imply any clamping.</summary>
|
||||
InverseDistance = 0xD001,
|
||||
|
||||
///<summary>InverseDistanceClamped is the IASIG I3DL2 model, with ALSourcef.ReferenceDistance indicating both the reference distance and the distance below which gain will be clamped.</summary>
|
||||
InverseDistanceClamped = 0xD002,
|
||||
|
||||
///<summary>AL_EXT_LINEAR_DISTANCE extension.</summary>
|
||||
LinearDistance = 0xD003,
|
||||
|
||||
///<summary>AL_EXT_LINEAR_DISTANCE extension.</summary>
|
||||
LinearDistanceClamped = 0xD004,
|
||||
|
||||
///<summary>AL_EXT_EXPONENT_DISTANCE extension.</summary>
|
||||
ExponentDistance = 0xD005,
|
||||
|
||||
///<summary>AL_EXT_EXPONENT_DISTANCE extension.</summary>
|
||||
ExponentDistanceClamped = 0xD006,
|
||||
}
|
||||
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,480 @@
|
|||
#region --- OpenTK.OpenAL License ---
|
||||
/* EfxTokens.cs
|
||||
* C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
|
||||
* Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
|
||||
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
|
||||
* See license.txt for license details
|
||||
* http://www.OpenTK.net */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenTK.Audio.OpenAL
|
||||
{
|
||||
#region Effect
|
||||
|
||||
///<summary>A list of valid 32-bit Float Effect/GetEffect parameters</summary>
|
||||
public enum EfxEffectf : int
|
||||
{
|
||||
///<summary>Reverb Modal Density controls the coloration of the late reverb. Lowering the value adds more coloration to the late reverb. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
ReverbDensity = 0x0001,
|
||||
///<summary>The Reverb Diffusion property controls the echo density in the reverberation decay. The default 1.0f provides the highest density. Reducing diffusion gives the reverberation a more "grainy" character that is especially noticeable with percussive sound sources. If you set a diffusion value of 0.0f, the later reverberation sounds like a succession of distinct echoes. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
ReverbDiffusion = 0x0002,
|
||||
///<summary>The Reverb Gain property is the master volume control for the reflected sound - both early reflections and reverberation - that the reverb effect adds to all sound sources. Ranges from 1.0 (0db) (the maximum amount) to 0.0 (-100db) (no reflected sound at all) are accepted. Units: Linear gain Range [0.0f .. 1.0f] Default: 0.32f</summary>
|
||||
ReverbGain = 0x0003,
|
||||
///<summary>The Reverb Gain HF property further tweaks reflected sound by attenuating it at high frequencies. It controls a low-pass filter that applies globally to the reflected sound of all sound sources feeding the particular instance of the reverb effect. Ranges from 1.0f (0db) (no filter) to 0.0f (-100db) (virtually no reflected sound) are accepted. Units: Linear gain Range [0.0f .. 1.0f] Default: 0.89f</summary>
|
||||
ReverbGainHF = 0x0004,
|
||||
///<summary>The Decay Time property sets the reverberation decay time. It ranges from 0.1f (typically a small room with very dead surfaces) to 20.0 (typically a large room with very live surfaces). Unit: Seconds Range [0.1f .. 20.0f] Default: 1.49f</summary>
|
||||
ReverbDecayTime = 0x0005,
|
||||
///<summary>The Decay HF Ratio property sets the spectral quality of the Decay Time parameter. It is the ratio of high-frequency decay time relative to the time set by Decay Time.. Unit: linear multiplier Range [0.1f .. 2.0f] Default: 0.83f</summary>
|
||||
ReverbDecayHFRatio = 0x0006,
|
||||
///<summary>The Reflections Gain property controls the overall amount of initial reflections relative to the Gain property. The value of Reflections Gain ranges from a maximum of 3.16f (+10 dB) to a minimum of 0.0f (-100 dB) (no initial reflections at all), and is corrected by the value of the Gain property. Unit: Linear gain Range [0.0f .. 3.16f] Default: 0.05f</summary>
|
||||
ReverbReflectionsGain = 0x0007,
|
||||
///<summary>The Reflections Delay property is the amount of delay between the arrival time of the direct path from the source to the first reflection from the source. It ranges from 0 to 300 milliseconds. Unit: Seconds Range [0.0f .. 0.3f] Default: 0.007f</summary>
|
||||
ReverbReflectionsDelay = 0x0008,
|
||||
///<summary>The Late Reverb Gain property controls the overall amount of later reverberation relative to the Gain property. The value of Late Reverb Gain ranges from a maximum of 10.0f (+20 dB) to a minimum of 0.0f (-100 dB) (no late reverberation at all). Unit: Linear gain Range [0.0f .. 10.0f] Default: 1.26f</summary>
|
||||
ReverbLateReverbGain = 0x0009,
|
||||
///<summary>The Late Reverb Delay property defines the begin time of the late reverberation relative to the time of the initial reflection (the first of the early reflections). It ranges from 0 to 100 milliseconds. Unit: Seconds Range [0.0f .. 0.1f] Default: 0.011f</summary>
|
||||
ReverbLateReverbDelay = 0x000A,
|
||||
///<summary>The Air Absorption Gain HF property controls the distance-dependent attenuation at high frequencies caused by the propagation medium and applies to reflected sound only. Unit: Linear gain per meter Range [0.892f .. 1.0f] Default: 0.994f</summary>
|
||||
ReverbAirAbsorptionGainHF = 0x000B,
|
||||
///<summary>The Room Rolloff Factor property is one of two methods available to attenuate the reflected sound (containing both reflections and reverberation) according to source-listener distance. It's defined the same way as OpenAL's Rolloff Factor, but operates on reverb sound instead of direct-path sound. Unit: Linear multiplier Range [0.0f .. 10.0f] Default: 0.0f</summary>
|
||||
ReverbRoomRolloffFactor = 0x000C,
|
||||
|
||||
///<summary>This property sets the modulation rate of the low-frequency oscillator that controls the delay time of the delayed signals. Unit: Hz Range [0.0f .. 10.0f] Default: 1.1f</summary>
|
||||
ChorusRate = 0x0003,
|
||||
///<summary>This property controls the amount by which the delay time is modulated by the low-frequency oscillator. Range [0.0f .. 1.0f] Default: 0.1f</summary>
|
||||
ChorusDepth = 0x0004,
|
||||
///<summary>This property controls the amount of processed signal that is fed back to the input of the chorus effect. Negative values will reverse the phase of the feedback signal. At full magnitude the identical sample will repeat endlessly. Range [-1.0f .. +1.0f] Default: +0.25f</summary>
|
||||
ChorusFeedback = 0x0005,
|
||||
///<summary>This property controls the average amount of time the sample is delayed before it is played back, and with feedback, the amount of time between iterations of the sample. Larger values lower the pitch. Unit: Seconds Range [0.0f .. 0.016f] Default: 0.016f</summary>
|
||||
ChorusDelay = 0x0006,
|
||||
|
||||
///<summary>This property controls the shape of the distortion. The higher the value for Edge, the "dirtier" and "fuzzier" the effect. Range [0.0f .. 1.0f] Default: 0.2f</summary>
|
||||
DistortionEdge = 0x0001,
|
||||
///<summary>This property allows you to attenuate the distorted sound. Range [0.01f .. 1.0f] Default: 0.05f</summary>
|
||||
DistortionGain = 0x0002,
|
||||
///<summary>Input signals can have a low pass filter applied, to limit the amount of high frequency signal feeding into the distortion effect. Unit: Hz Range [80.0f .. 24000.0f] Default: 8000.0f</summary>
|
||||
DistortionLowpassCutoff = 0x0003,
|
||||
///<summary>This property controls the frequency at which the post-distortion attenuation (Distortion Gain) is active. Unit: Hz Range [80.0f .. 24000.0f] Default: 3600.0f</summary>
|
||||
DistortionEQCenter = 0x0004,
|
||||
///<summary>This property controls the bandwidth of the post-distortion attenuation. Unit: Hz Range [80.0f .. 24000.0f] Default: 3600.0f</summary>
|
||||
DistortionEQBandwidth = 0x0005,
|
||||
|
||||
///<summary>This property controls the delay between the original sound and the first "tap", or echo instance. Subsequently, the value for Echo Delay is used to determine the time delay between each "second tap" and the next "first tap". Unit: Seconds Range [0.0f .. 0.207f] Default: 0.1f</summary>
|
||||
EchoDelay = 0x0001,
|
||||
///<summary>This property controls the delay between the "first tap" and the "second tap". Subsequently, the value for Echo LR Delay is used to determine the time delay between each "first tap" and the next "second tap". Unit: Seconds Range [0.0f .. 0.404f] Default: 0.1f</summary>
|
||||
EchoLRDelay = 0x0002,
|
||||
///<summary>This property controls the amount of high frequency damping applied to each echo. As the sound is subsequently fed back for further echoes, damping results in an echo which progressively gets softer in tone as well as intensity. Range [0.0f .. 0.99f] Default: 0.5f</summary>
|
||||
EchoDamping = 0x0003,
|
||||
///<summary>This property controls the amount of feedback the output signal fed back into the input. Use this parameter to create "cascading" echoes. At full magnitude, the identical sample will repeat endlessly. Below full magnitude, the sample will repeat and fade. Range [0.0f .. 1.0f] Default: 0.5f</summary>
|
||||
EchoFeedback = 0x0004,
|
||||
///<summary>This property controls how hard panned the individual echoes are. With a value of 1.0f, the first "tap" will be panned hard left, and the second "tap" hard right. –1.0f gives the opposite result and values near to 0.0f result in less emphasized panning. Range [-1.0f .. +1.0f] Default: -1.0f</summary>
|
||||
EchoSpread = 0x0005,
|
||||
|
||||
///<summary>The number of times per second the low-frequency oscillator controlling the amount of delay repeats. Range [0.0f .. 10.0f] Default: 0.27f</summary>
|
||||
FlangerRate = 0x0003,
|
||||
///<summary>The ratio by which the delay time is modulated by the low-frequency oscillator. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
FlangerDepth = 0x0004,
|
||||
///<summary>This is the amount of the output signal level fed back into the effect's input. A negative value will reverse the phase of the feedback signal. Range [-1.0f .. +1.0f] Default: -0.5f</summary>
|
||||
FlangerFeedback = 0x0005,
|
||||
///<summary>The average amount of time the sample is delayed before it is played back. When used with the Feedback property it's the amount of time between iterations of the sample. Unit: Seconds Range [0.0f .. 0.004f] Default: 0.002f</summary>
|
||||
FlangerDelay = 0x0006,
|
||||
|
||||
///<summary>This is the carrier frequency. For carrier frequencies below the audible range, the single sideband modulator may produce phaser effects, spatial effects or a slight pitch-shift. As the carrier frequency increases, the timbre of the sound is affected. Unit: Hz Range [0.0f .. 24000.0f] Default: 0.0f</summary>
|
||||
FrequencyShifterFrequency = 0x0001,
|
||||
|
||||
///<summary>This controls the frequency of the low-frequency oscillator used to morph between the two phoneme filters. Unit: Hz Range [0.0f .. 10.0f] Default: 1.41f</summary>
|
||||
VocalMorpherRate = 0x0006,
|
||||
|
||||
///<summary>This is the frequency of the carrier signal. If the carrier signal is slowly varying (less than 20 Hz), the result is a slow amplitude variation effect (tremolo). Unit: Hz Range [0.0f .. 8000.0f] Default: 440.0f</summary>
|
||||
RingModulatorFrequency = 0x0001,
|
||||
///<summary>This controls the cutoff frequency at which the input signal is high-pass filtered before being ring modulated. Unit: Hz Range [0.0f .. 24000.0f] Default: 800.0f</summary>
|
||||
RingModulatorHighpassCutoff = 0x0002,
|
||||
|
||||
///<summary>This property controls the time the filtering effect takes to sweep from minimum to maximum center frequency when it is triggered by input signal. Unit: Seconds Range [0.0001f .. 1.0f] Default: 0.06f</summary>
|
||||
AutowahAttackTime = 0x0001,
|
||||
///<summary>This property controls the time the filtering effect takes to sweep from maximum back to base center frequency, when the input signal ends. Unit: Seconds Range [0.0001f .. 1.0f] Default: 0.06f</summary>
|
||||
AutowahReleaseTime = 0x0002,
|
||||
///<summary>This property controls the resonant peak, sometimes known as emphasis or Q, of the auto-wah band-pass filter. Range [2.0f .. 1000.0f] Default: 1000.0f</summary>
|
||||
AutowahResonance = 0x0003,
|
||||
///<summary>This property controls the input signal level at which the band-pass filter will be fully opened. Range [0.00003f .. 31621.0f] Default: 11.22f</summary>
|
||||
AutowahPeakGain = 0x0004,
|
||||
|
||||
///<summary>This property controls amount of cut or boost on the low frequency range. Range [0.126f .. 7.943f] Default: 1.0f</summary>
|
||||
EqualizerLowGain = 0x0001,
|
||||
///<summary>This property controls the low frequency below which signal will be cut off. Unit: Hz Range [50.0f .. 800.0f] Default: 200.0f</summary>
|
||||
EqualizerLowCutoff = 0x0002,
|
||||
///<summary>This property allows you to cut/boost signal on the "mid1" range. Range [0.126f .. 7.943f] Default: 1.0f</summary>
|
||||
EqualizerMid1Gain = 0x0003,
|
||||
///<summary>This property sets the center frequency for the "mid1" range. Unit: Hz Range [200.0f .. 3000.0f] Default: 500.0f</summary>
|
||||
EqualizerMid1Center = 0x0004,
|
||||
///<summary>This property controls the width of the "mid1" range. Range [0.01f .. 1.0f] Default: 1.0f</summary>
|
||||
EqualizerMid1Width = 0x0005,
|
||||
///<summary>This property allows you to cut/boost signal on the "mid2" range. Range [0.126f .. 7.943f] Default: 1.0f</summary>
|
||||
EqualizerMid2Gain = 0x0006,
|
||||
///<summary>This property sets the center frequency for the "mid2" range. Unit: Hz Range [1000.0f .. 8000.0f] Default: 3000.0f</summary>
|
||||
EqualizerMid2Center = 0x0007,
|
||||
///<summary>This property controls the width of the "mid2" range. Range [0.01f .. 1.0f] Default: 1.0f</summary>
|
||||
EqualizerMid2Width = 0x0008,
|
||||
///<summary>This property allows to cut/boost the signal at high frequencies. Range [0.126f .. 7.943f] Default: 1.0f</summary>
|
||||
EqualizerHighGain = 0x0009,
|
||||
///<summary>This property controls the high frequency above which signal will be cut off. Unit: Hz Range [4000.0f .. 16000.0f] Default: 6000.0f</summary>
|
||||
EqualizerHighCutoff = 0x000A,
|
||||
|
||||
///<summary>Reverb Modal Density controls the coloration of the late reverb. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
EaxReverbDensity = 0x0001,
|
||||
///<summary>The Reverb Diffusion property controls the echo density in the reverberation decay. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
EaxReverbDiffusion = 0x0002,
|
||||
///<summary>Reverb Gain controls the level of the reverberant sound in an environment. A high level of reverb is characteristic of rooms with highly reflective walls and/or small dimensions. Unit: Linear gain Range [0.0f .. 1.0f] Default: 0.32f</summary>
|
||||
EaxReverbGain = 0x0003,
|
||||
///<summary>Gain HF is used to attenuate the high frequency content of all the reflected sound in an environment. You can use this property to give a room specific spectral characteristic. Unit: Linear gain Range [0.0f .. 1.0f] Default: 0.89f</summary>
|
||||
EaxReverbGainHF = 0x0004,
|
||||
///<summary>Gain LF is the low frequency counterpart to Gain HF. Use this to reduce or boost the low frequency content in an environment. Unit: Linear gain Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
EaxReverbGainLF = 0x0005,
|
||||
///<summary>The Decay Time property sets the reverberation decay time. It ranges from 0.1f (typically a small room with very dead surfaces) to 20.0f (typically a large room with very live surfaces). Unit: Seconds Range [0.1f .. 20.0f] Default: 1.49f</summary>
|
||||
EaxReverbDecayTime = 0x0006,
|
||||
///<summary>Decay HF Ratio scales the decay time of high frequencies relative to the value of the Decay Time property. By changing this value, you are changing the amount of time it takes for the high frequencies to decay compared to the mid frequencies of the reverb. Range [0.1f .. 2.0f] Default: 0.83f</summary>
|
||||
EaxReverbDecayHFRatio = 0x0007,
|
||||
///<summary>Decay LF Ratio scales the decay time of low frequencies in the reverberation in the same manner that Decay HF Ratio handles high frequencies. Unit: Linear multiplier Range [0.1f .. 2.0f] Default: 1.0f</summary>
|
||||
EaxReverbDecayLFRatio = 0x0008,
|
||||
///<summary>Reflections Gain sets the level of the early reflections in an environment. Early reflections are used as a cue for determining the size of the environment we are in. Unit: Linear gain Range [0.0f .. 3.16f] Default: 0.05f</summary>
|
||||
EaxReverbReflectionsGain = 0x0009,
|
||||
///<summary>Reflections Delay controls the amount of time it takes for the first reflected wave front to reach the listener, relative to the arrival of the direct-path sound. Unit: Seconds Range [0.0f .. 0.3f] Default: 0.007f</summary>
|
||||
EaxReverbReflectionsDelay = 0x000A,
|
||||
///<summary>The Late Reverb Gain property controls the overall amount of later reverberation relative to the Gain property. Range [0.0f .. 10.0f] Default: 1.26f</summary>
|
||||
EaxReverbLateReverbGain = 0x000C,
|
||||
///<summary>The Late Reverb Delay property defines the begin time of the late reverberation relative to the time of the initial reflection (the first of the early reflections). It ranges from 0 to 100 milliseconds. Unit: Seconds Range [0.0f .. 0.1f] Default: 0.011f</summary>
|
||||
EaxReverbLateReverbDelay = 0x000D,
|
||||
///<summary>Echo Time controls the rate at which the cyclic echo repeats itself along the reverberation decay. Range [0.075f .. 0.25f] Default: 0.25f</summary>
|
||||
EaxReverbEchoTime = 0x000F,
|
||||
///<summary>Echo Depth introduces a cyclic echo in the reverberation decay, which will be noticeable with transient or percussive sounds. Range [0.0f .. 1.0f] Default: 0.0f</summary>
|
||||
EaxReverbEchoDepth = 0x0010,
|
||||
///<summary>Modulation Time controls the speed of the rate of periodic changes in pitch (vibrato). Range [0.04f .. 4.0f] Default: 0.25f</summary>
|
||||
EaxReverbModulationTime = 0x0011,
|
||||
///<summary>Modulation Depth controls the amount of pitch change. Low values of Diffusion will contribute to reinforcing the perceived effect by reducing the mixing of overlapping reflections in the reverberation decay. Range [0.0f .. 1.0f] Default: 0.0f</summary>
|
||||
EaxReverbModulationDepth = 0x0012,
|
||||
///<summary>The Air Absorption Gain HF property controls the distance-dependent attenuation at high frequencies caused by the propagation medium. It applies to reflected sound only. Range [0.892f .. 1.0f] Default: 0.994f</summary>
|
||||
EaxReverbAirAbsorptionGainHF = 0x0013,
|
||||
///<summary>The property HF reference determines the frequency at which the high-frequency effects created by Reverb properties are measured. Unit: Hz Range [1000.0f .. 20000.0f] Default: 5000.0f</summary>
|
||||
EaxReverbHFReference = 0x0014,
|
||||
///<summary>The property LF reference determines the frequency at which the low-frequency effects created by Reverb properties are measured. Unit: Hz Range [20.0f .. 1000.0f] Default: 250.0f</summary>
|
||||
EaxReverbLFReference = 0x0015,
|
||||
///<summary>The Room Rolloff Factor property is one of two methods available to attenuate the reflected sound (containing both reflections and reverberation) according to source-listener distance. It's defined the same way as OpenAL Rolloff Factor, but operates on reverb sound instead of direct-path sound. Range [0.0f .. 10.0f] Default: 0.0f</summary>
|
||||
EaxReverbRoomRolloffFactor = 0x0016,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Math.Vector3 Effect/GetEffect parameters</summary>
|
||||
public enum EfxEffect3f : int
|
||||
{
|
||||
/// <summary>Reverb Pan does for the Reverb what Reflections Pan does for the Reflections. Unit: Vector3 of length 0f to 1f Default: {0.0f, 0.0f, 0.0f}</summary>
|
||||
EaxReverbLateReverbPan = 0x000E,
|
||||
/// <summary>This Vector3 controls the spatial distribution of the cluster of early reflections. The direction of this vector controls the global direction of the reflections, while its magnitude controls how focused the reflections are towards this direction. For legacy reasons this Vector3 follows a left-handed co-ordinate system! Note that OpenAL uses a right-handed coordinate system. Unit: Vector3 of length 0f to 1f Default: {0.0f, 0.0f, 0.0f}</summary>
|
||||
EaxReverbReflectionsPan = 0x000B,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Int32 Effect/GetEffect parameters</summary>
|
||||
public enum EfxEffecti : int
|
||||
{
|
||||
///<summary>This property sets the waveform shape of the low-frequency oscillator that controls the delay time of the delayed signals. Unit: (0) Sinusoid, (1) Triangle Range [0 .. 1] Default: 1</summary>
|
||||
ChorusWaveform = 0x0001,
|
||||
///<summary>This property controls the phase difference between the left and right low-frequency oscillators. At zero degrees the two low-frequency oscillators are synchronized. Unit: Degrees Range [-180 .. 180] Default: 90</summary>
|
||||
ChorusPhase = 0x0002,
|
||||
|
||||
///<summary>Selects the shape of the low-frequency oscillator waveform that controls the amount of the delay of the sampled signal. Unit: (0) Sinusoid, (1) Triangle Range [0 .. 1] Default: 1</summary>
|
||||
FlangerWaveform = 0x0001,
|
||||
///<summary>This changes the phase difference between the left and right low-frequency oscillator's. At zero degrees the two low-frequency oscillators are synchronized. Range [-180 .. +180] Default: 0</summary>
|
||||
FlangerPhase = 0x0002,
|
||||
|
||||
///<summary>These select which internal signals are added together to produce the output. Unit: (0) Down, (1) Up, (2) Off Range [0 .. 2] Default: 0</summary>
|
||||
FrequencyShifterLeftDirection = 0x0002,
|
||||
///<summary>These select which internal signals are added together to produce the output. Unit: (0) Down, (1) Up, (2) Off Range [0 .. 2] Default: 0</summary>
|
||||
FrequencyShifterRightDirection = 0x0003,
|
||||
|
||||
///<summary>Sets the vocal morpher 4-band formant filter A, used to impose vocal tract effects upon the input signal. The vocal morpher is not necessarily intended for use on voice signals; it is primarily intended for pitched noise effects, vocal-like wind effects, etc. Unit: Use enum EfxFormantFilterSettings Range [0 .. 29] Default: 0, "Phoneme A"</summary>
|
||||
VocalMorpherPhonemeA = 0x0001,
|
||||
///<summary>This is used to adjust the pitch of phoneme filter A in 1-semitone increments. Unit: Semitones Range [-24 .. +24] Default: 0</summary>
|
||||
VocalMorpherPhonemeACoarseTuning = 0x0002,
|
||||
///<summary>Sets the vocal morpher 4-band formant filter B, used to impose vocal tract effects upon the input signal. The vocal morpher is not necessarily intended for use on voice signals; it is primarily intended for pitched noise effects, vocal-like wind effects, etc. Unit: Use enum EfxFormantFilterSettings Range [0 .. 29] Default: 10, "Phoneme ER"</summary>
|
||||
VocalMorpherPhonemeB = 0x0003,
|
||||
///<summary>This is used to adjust the pitch of phoneme filter B in 1-semitone increments. Unit: Semitones Range [-24 .. +24] Default: 0</summary>
|
||||
VocalMorpherPhonemeBCoarseTuning = 0x0004,
|
||||
///<summary>This controls the shape of the low-frequency oscillator used to morph between the two phoneme filters. Unit: (0) Sinusoid, (1) Triangle, (2) Sawtooth Range [0 .. 2] Default: 0</summary>
|
||||
VocalMorpherWaveform = 0x0005,
|
||||
|
||||
///<summary>This sets the number of semitones by which the pitch is shifted. There are 12 semitones per octave. Unit: Semitones Range [-12 .. +12] Default: +12</summary>
|
||||
PitchShifterCoarseTune = 0x0001,
|
||||
///<summary>This sets the number of cents between Semitones a pitch is shifted. A Cent is 1/100th of a Semitone. Unit: Cents Range [-50 .. +50] Default: 0</summary>
|
||||
PitchShifterFineTune = 0x0002,
|
||||
|
||||
///<summary>This controls which waveform is used as the carrier signal. Traditional ring modulator and tremolo effects generally use a sinusoidal carrier. Unit: (0) Sinusoid, (1) Sawtooth, (2) Square Range [0 .. 2] Default: 0</summary>
|
||||
RingModulatorWaveform = 0x0003,
|
||||
|
||||
///<summary>Enabling this will result in audio exhibiting smaller variation in intensity between the loudest and quietest portions. Unit: (0) Off, (1) On Range [0 .. 1] Default: 1</summary>
|
||||
CompressorOnoff = 0x0001,
|
||||
|
||||
///<summary>When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property Air Absorption HF. Unit: (0) False, (1) True Range [False, True] Default: True</summary>
|
||||
ReverbDecayHFLimit = 0x000D,
|
||||
|
||||
///<summary>When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property AirAbsorptionGainHF. Unit: (0) False, (1) True Range [False, True] Default: True</summary>
|
||||
EaxReverbDecayHFLimit = 0x0017,
|
||||
|
||||
/// <summary>Used with the enum EfxEffectType as it's parameter.</summary>
|
||||
EffectType = 0x8001,
|
||||
}
|
||||
|
||||
///<summary>Vocal morpher effect parameters. If both parameters are set to the same phoneme, that determines the filtering effect that will be heard. If these two parameters are set to different phonemes, the filtering effect will morph between the two settings at a rate specified by EfxEffectf.VocalMorpherRate.</summary>
|
||||
public enum EfxFormantFilterSettings : int
|
||||
{
|
||||
/// <summary>
|
||||
/// The A phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeA = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The E phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The I phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeI = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The O phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeO = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The U phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeU = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The AA phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeAA = 5,
|
||||
|
||||
/// <summary>
|
||||
/// The AE phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeAE = 6,
|
||||
|
||||
/// <summary>
|
||||
/// The AH phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeAH = 7,
|
||||
|
||||
/// <summary>
|
||||
/// The AO phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeAO = 8,
|
||||
|
||||
/// <summary>
|
||||
/// The EH phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeEH = 9,
|
||||
|
||||
/// <summary>
|
||||
/// The ER phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeER = 10,
|
||||
|
||||
/// <summary>
|
||||
/// The IH phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeIH = 11,
|
||||
|
||||
/// <summary>
|
||||
/// The IY phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeIY = 12,
|
||||
|
||||
/// <summary>
|
||||
/// The UH phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeUH = 13,
|
||||
|
||||
/// <summary>
|
||||
/// The UW phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeUW = 14,
|
||||
|
||||
/// <summary>
|
||||
/// The B phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeB = 15,
|
||||
|
||||
/// <summary>
|
||||
/// The D phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeD = 16,
|
||||
|
||||
/// <summary>
|
||||
/// The F phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeF = 17,
|
||||
|
||||
/// <summary>
|
||||
/// The G phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeG = 18,
|
||||
|
||||
/// <summary>
|
||||
/// The J phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeJ = 19,
|
||||
|
||||
/// <summary>
|
||||
/// The K phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeK = 20,
|
||||
|
||||
/// <summary>
|
||||
/// The L phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeL = 21,
|
||||
|
||||
/// <summary>
|
||||
/// The M phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeM = 22,
|
||||
|
||||
/// <summary>
|
||||
/// The N phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeN = 23,
|
||||
|
||||
/// <summary>
|
||||
/// The P phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeP = 24,
|
||||
|
||||
/// <summary>
|
||||
/// The R phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeR = 25,
|
||||
|
||||
/// <summary>
|
||||
/// The S phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeS = 26,
|
||||
|
||||
/// <summary>
|
||||
/// The T phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeT = 27,
|
||||
|
||||
/// <summary>
|
||||
/// The V phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeV = 28,
|
||||
|
||||
/// <summary>
|
||||
/// The Z phoneme of the vocal morpher.
|
||||
/// </summary>
|
||||
VocalMorpherPhonemeZ = 29,
|
||||
}
|
||||
|
||||
///<summary>Effect type definitions to be used with EfxEffecti.EffectType.</summary>
|
||||
public enum EfxEffectType : int
|
||||
{
|
||||
///<summary>No Effect, disable. This Effect type is used when an Effect object is initially created.</summary>
|
||||
Null = 0x0000,
|
||||
///<summary>The Reverb effect is the standard Effects Extension's environmental reverberation effect. It is available on all Generic Software and Generic Hardware devices.</summary>
|
||||
Reverb = 0x0001,
|
||||
///<summary>The Chorus effect essentially replays the input audio accompanied by another slightly delayed version of the signal, creating a "doubling" effect.</summary>
|
||||
Chorus = 0x0002,
|
||||
///<summary>The Distortion effect simulates turning up (overdriving) the gain stage on a guitar amplifier or adding a distortion pedal to an instrument's output.</summary>
|
||||
Distortion = 0x0003,
|
||||
///<summary>The Echo effect generates discrete, delayed instances of the input signal.</summary>
|
||||
Echo = 0x0004,
|
||||
///<summary>The Flanger effect creates a "tearing" or "whooshing" sound, like a jet flying overhead.</summary>
|
||||
Flanger = 0x0005,
|
||||
///<summary>The Frequency shifter is a single-sideband modulator, which translates all the component frequencies of the input signal by an equal amount.</summary>
|
||||
FrequencyShifter = 0x0006,
|
||||
///<summary>The Vocal morpher consists of a pair of 4-band formant filters, used to impose vocal tract effects upon the input signal.</summary>
|
||||
VocalMorpher = 0x0007,
|
||||
///<summary>The Pitch shifter applies time-invariant pitch shifting to the input signal, over a one octave range and controllable at a semi-tone and cent resolution.</summary>
|
||||
PitchShifter = 0x0008,
|
||||
///<summary>The Ring modulator multiplies an input signal by a carrier signal in the time domain, resulting in tremolo or inharmonic effects.</summary>
|
||||
RingModulator = 0x0009,
|
||||
///<summary>The Auto-wah effect emulates the sound of a wah-wah pedal used with an electric guitar, or a mute on a brass instrument.</summary>
|
||||
Autowah = 0x000A,
|
||||
///<summary>The Compressor will boost quieter portions of the audio, while louder portions will stay the same or may even be reduced.</summary>
|
||||
Compressor = 0x000B,
|
||||
///<summary>The Equalizer is very flexible, providing tonal control over four different adjustable frequency ranges.</summary>
|
||||
Equalizer = 0x000C,
|
||||
///<summary>The EAX Reverb has a more advanced parameter set than EfxEffectType.Reverb, but is only natively supported on devices that support the EAX 3.0 or above.</summary>
|
||||
EaxReverb = 0x8000,
|
||||
}
|
||||
|
||||
#endregion Effect
|
||||
|
||||
#region Auxiliary Effect Slot
|
||||
|
||||
///<summary>A list of valid Int32 AuxiliaryEffectSlot/GetAuxiliaryEffectSlot parameters</summary>
|
||||
public enum EfxAuxiliaryi : int
|
||||
{
|
||||
/// <summary>This property is used to attach an Effect object to the Auxiliary Effect Slot object. After the attachment, the Auxiliary Effect Slot object will contain the effect type and have the same effect parameters that were stored in the Effect object. Any Sources feeding the Auxiliary Effect Slot will immediate feed the new effect type and new effect parameters.</summary>
|
||||
EffectslotEffect = 0x0001,
|
||||
|
||||
/// <summary>This property is used to enable or disable automatic send adjustments based on the physical positions of the sources and the listener. This property should be enabled when an application wishes to use a reverb effect to simulate the environment surrounding a listener or a collection of Sources. Range [False, True] Default: True </summary>
|
||||
EffectslotAuxiliarySendAuto = 0x0003,
|
||||
}
|
||||
|
||||
///<summary>A list of valid 32-bits Float AuxiliaryEffectSlot/GetAuxiliaryEffectSlot parameters</summary>
|
||||
public enum EfxAuxiliaryf : int
|
||||
{
|
||||
/// <summary>This property is used to specify an output level for the Auxiliary Effect Slot. Setting the gain to 0.0f mutes the output. Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
EffectslotGain = 0x0002,
|
||||
}
|
||||
|
||||
#endregion Auxiliary Effect Slot
|
||||
|
||||
#region Filter Object
|
||||
|
||||
///<summary>A list of valid 32-bits Float Filter/GetFilter parameters</summary>
|
||||
public enum EfxFilterf : int
|
||||
{
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
LowpassGain = 0x0001,
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
LowpassGainHF = 0x0002,
|
||||
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
HighpassGain = 0x0001,
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
HighpassGainLF = 0x0002,
|
||||
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
BandpassGain = 0x0001,
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
BandpassGainLF = 0x0002,
|
||||
///<summary>Range [0.0f .. 1.0f] Default: 1.0f</summary>
|
||||
BandpassGainHF = 0x0003,
|
||||
}
|
||||
|
||||
///<summary>A list of valid Int32 Filter/GetFilter parameters</summary>
|
||||
public enum EfxFilteri : int
|
||||
{
|
||||
/// <summary>Used with the enum EfxFilterType as Parameter to select a filter logic.</summary>
|
||||
FilterType = 0x8001,
|
||||
}
|
||||
|
||||
///<summary>Filter type definitions to be used with EfxFilteri.FilterType.</summary>
|
||||
public enum EfxFilterType : int
|
||||
{
|
||||
///<summary>No Filter, disable. This Filter type is used when a Filter object is initially created.</summary>
|
||||
Null = 0x0000,
|
||||
/// <summary>A low-pass filter is used to remove high frequency content from a signal.</summary>
|
||||
Lowpass = 0x0001,
|
||||
///<summary>Currently not implemented. A high-pass filter is used to remove low frequency content from a signal.</summary>
|
||||
Highpass = 0x0002,
|
||||
///<summary>Currently not implemented. A band-pass filter is used to remove high and low frequency content from a signal.</summary>
|
||||
Bandpass = 0x0003,
|
||||
}
|
||||
|
||||
#endregion Filter Object
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
#region --- OpenTK.OpenAL License ---
|
||||
/* EfxPresets.cs
|
||||
* C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
|
||||
* Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
|
||||
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
|
||||
* See license.txt for license details
|
||||
* http://www.OpenTK.net */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
namespace OpenTK.Audio.OpenAL
|
||||
{
|
||||
public partial class EffectsExtension
|
||||
{
|
||||
// Todo: Add documentation
|
||||
// Todo: CLS compliance.
|
||||
|
||||
#pragma warning disable 1591
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public struct EaxReverb
|
||||
{
|
||||
public uint Environment; // TODO: EAX-EFX conversion
|
||||
public float EnvironmentSize; // TODO: EAX-EFX conversion
|
||||
public float EnvironmentDiffusion; // TODO: EAX-EFX conversion
|
||||
public int Room; // TODO: EAX-EFX conversion
|
||||
public int RoomHF; // TODO: EAX-EFX conversion
|
||||
public int RoomLF; // TODO: EAX-EFX conversion
|
||||
public float DecayTime;
|
||||
public float DecayHFRatio;
|
||||
public float DecayLFRatio;
|
||||
public int Reflections; // TODO: EAX-EFX conversion
|
||||
public float ReflectionsDelay;
|
||||
public Vector3 ReflectionsPan;
|
||||
public int Reverb; // TODO: EAX-EFX conversion
|
||||
public float ReverbDelay;
|
||||
public Vector3 ReverbPan;
|
||||
public float EchoTime;
|
||||
public float EchoDepth;
|
||||
public float ModulationTime;
|
||||
public float ModulationDepth;
|
||||
public float AirAbsorptionHF;
|
||||
public float HFReference;
|
||||
public float LFReference;
|
||||
public float RoomRolloffFactor;
|
||||
public uint Flags; // TODO: EAX-EFX conversion
|
||||
|
||||
public EaxReverb(uint environment,
|
||||
float environmentSize,
|
||||
float environmentDiffusion,
|
||||
int room,
|
||||
int roomHF,
|
||||
int roomLF,
|
||||
float decayTime,
|
||||
float decayHFRatio,
|
||||
float decayLFRatio,
|
||||
int reflections,
|
||||
float reflectionsDelay,
|
||||
float reflectionsPanX,
|
||||
float reflectionsPanY,
|
||||
float reflectionsPanZ,
|
||||
int reverb,
|
||||
float reverbDelay,
|
||||
float reverbPanX,
|
||||
float reverbPanY,
|
||||
float reverbPanZ,
|
||||
float echoTime,
|
||||
float echoDepth,
|
||||
float modulationTime,
|
||||
float modulationDepth,
|
||||
float airAbsorptionHF,
|
||||
float hfReference,
|
||||
float lfReference,
|
||||
float roomRolloffFactor,
|
||||
uint flags)
|
||||
{
|
||||
Environment = environment;
|
||||
EnvironmentSize = environmentSize;
|
||||
EnvironmentDiffusion = environmentDiffusion;
|
||||
Room = room;
|
||||
RoomHF = roomHF;
|
||||
RoomLF = roomLF;
|
||||
DecayTime = decayTime;
|
||||
DecayHFRatio = decayHFRatio;
|
||||
DecayLFRatio = decayLFRatio;
|
||||
Reflections = reflections;
|
||||
ReflectionsDelay = reflectionsDelay;
|
||||
ReflectionsPan = new Vector3(reflectionsPanX, reflectionsPanY, reflectionsPanZ);
|
||||
Reverb = reverb;
|
||||
ReverbDelay = reverbDelay;
|
||||
ReverbPan = new Vector3(reverbPanX, reverbPanY, reverbPanZ);
|
||||
EchoTime = echoTime;
|
||||
EchoDepth = echoDepth;
|
||||
ModulationTime = modulationTime;
|
||||
ModulationDepth = modulationDepth;
|
||||
AirAbsorptionHF = airAbsorptionHF;
|
||||
HFReference = hfReference;
|
||||
LFReference = lfReference;
|
||||
RoomRolloffFactor = roomRolloffFactor;
|
||||
Flags = flags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: CLS compliance.
|
||||
[CLSCompliant(false)]
|
||||
public static void GetEaxFromEfxEax(ref EaxReverb input, out EfxEaxReverb output)
|
||||
{
|
||||
output.AirAbsorptionGainHF = 0.995f; // input.AirAbsorptionHF * somegain?
|
||||
output.RoomRolloffFactor = input.RoomRolloffFactor;
|
||||
|
||||
output.Density = 1f; // todo, currently default
|
||||
output.Diffusion = 1f; // todo, currently default
|
||||
|
||||
output.DecayTime = input.DecayTime;
|
||||
output.DecayHFLimit = 1; // todo, currently default
|
||||
output.DecayHFRatio = input.DecayHFRatio;
|
||||
output.DecayLFRatio = input.DecayLFRatio;
|
||||
|
||||
output.EchoDepth = input.EchoDepth;
|
||||
output.EchoTime = input.EchoTime;
|
||||
|
||||
output.Gain = 0.32f; // todo, currently default
|
||||
output.GainHF = 0.89f; // todo, currently default
|
||||
output.GainLF = 1f;// todo, currently default
|
||||
|
||||
output.LFReference = input.LFReference;
|
||||
output.HFReference = input.HFReference;
|
||||
|
||||
output.LateReverbDelay = input.ReverbDelay;
|
||||
output.LateReverbGain = 1.26f; // todo, currently default
|
||||
output.LateReverbPan = input.ReverbPan;
|
||||
|
||||
output.ModulationDepth = input.ModulationDepth;
|
||||
output.ModulationTime = input.ModulationTime;
|
||||
|
||||
output.ReflectionsDelay = input.ReflectionsDelay;
|
||||
output.ReflectionsGain = 0.05f; // todo, currently default
|
||||
output.ReflectionsPan = input.ReflectionsPan;
|
||||
}
|
||||
|
||||
public struct EfxEaxReverb
|
||||
{
|
||||
public float Density;
|
||||
public float Diffusion;
|
||||
public float Gain;
|
||||
public float GainHF;
|
||||
public float GainLF;
|
||||
public float DecayTime;
|
||||
public float DecayHFRatio;
|
||||
public float DecayLFRatio;
|
||||
public float ReflectionsGain;
|
||||
public float ReflectionsDelay;
|
||||
public Vector3 ReflectionsPan;
|
||||
public float LateReverbGain;
|
||||
public float LateReverbDelay;
|
||||
public Vector3 LateReverbPan;
|
||||
public float EchoTime;
|
||||
public float EchoDepth;
|
||||
public float ModulationTime;
|
||||
public float ModulationDepth;
|
||||
public float AirAbsorptionGainHF;
|
||||
public float HFReference;
|
||||
public float LFReference;
|
||||
public float RoomRolloffFactor;
|
||||
public int DecayHFLimit;
|
||||
}
|
||||
|
||||
/*
|
||||
public struct _EAXOBSTRUCTIONPROPERTIES
|
||||
{
|
||||
public int lObstruction;
|
||||
public float flObstructionLFRatio;
|
||||
}
|
||||
_EAXOBSTRUCTIONPROPERTIES EAXOBSTRUCTIONPROPERTIES;//, *LPEAXOBSTRUCTIONPROPERTIES;
|
||||
|
||||
public struct _EAXOCCLUSIONPROPERTIES
|
||||
{
|
||||
public int lOcclusion;
|
||||
public float flOcclusionLFRatio;
|
||||
public float flOcclusionRoomRatio;
|
||||
public float flOcclusionDirectRatio;
|
||||
}
|
||||
_EAXOCCLUSIONPROPERTIES EAXOCCLUSIONPROPERTIES;//, *LPEAXOCCLUSIONPROPERTIES;
|
||||
|
||||
public struct _EAXEXCLUSIONPROPERTIES
|
||||
{
|
||||
public int lExclusion;
|
||||
public float flExclusionLFRatio;
|
||||
}
|
||||
_EAXEXCLUSIONPROPERTIES EAXEXCLUSIONPROPERTIES;//, *LPEAXEXCLUSIONPROPERTIES;
|
||||
|
||||
public struct _EFXLOWPASSFILTER
|
||||
{
|
||||
public float flGain;
|
||||
public float flGainHF;
|
||||
}
|
||||
_EFXLOWPASSFILTER EFXLOWPASSFILTER;//, *LPEFXLOWPASSFILTER;
|
||||
|
||||
|
||||
void ConvertReverbParameters(EAXREVERBPROPERTIES *pEAXProp, EFXEAXREVERBPROPERTIES *pEFXEAXReverb);
|
||||
void ConvertObstructionParameters(EAXOBSTRUCTIONPROPERTIES *pObProp, EFXLOWPASSFILTER *pDirectLowPassFilter);
|
||||
void ConvertExclusionParameters(EAXEXCLUSIONPROPERTIES *pExProp, EFXLOWPASSFILTER *pSendLowPassFilter);
|
||||
void ConvertOcclusionParameters(EAXOCCLUSIONPROPERTIES *pOcProp, EFXLOWPASSFILTER *pDirectLowPassFilter, EFXLOWPASSFILTER *pSendLowPassFilter);
|
||||
*/
|
||||
|
||||
// TODO: CLS compliance.
|
||||
///<summary>EAX Reverb Presets in legacy format - use ConvertReverbParameters() to convert to EFX EAX Reverb Presets for use with the OpenAL Effects Extension.</summary>
|
||||
[CLSCompliant(false)]
|
||||
public static class ReverbPresets
|
||||
{
|
||||
// CASTLE PRESETS
|
||||
|
||||
public static EaxReverb CastleSmallRoom = new EaxReverb(26, 8.3f, 0.890f, -1000, -800, -2000, 1.22f, 0.83f, 0.31f, -100, 0.022f, 0f, 0f, 0f, 600, 0.011f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleShortPassage = new EaxReverb(26, 8.3f, 0.890f, -1000, -1000, -2000, 2.32f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 200, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleMediumroom = new EaxReverb(26, 8.3f, 0.930f, -1000, -1100, -2000, 2.04f, 0.83f, 0.46f, -400, 0.022f, 0f, 0f, 0f, 400, 0.011f, 0f, 0f, 0f, 0.155f, 0.030f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleLongpassage = new EaxReverb(26, 8.3f, 0.890f, -1000, -800, -2000, 3.42f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleLargeroom = new EaxReverb(26, 8.3f, 0.820f, -1000, -1100, -1800, 2.53f, 0.83f, 0.50f, -700, 0.034f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.185f, 0.070f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleHall = new EaxReverb(26, 8.3f, 0.810f, -1000, -1100, -1500, 3.14f, 0.79f, 0.62f, -1500, 0.056f, 0f, 0f, 0f, 100, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleCupboard = new EaxReverb(26, 8.3f, 0.890f, -1000, -1100, -2000, 0.67f, 0.87f, 0.31f, 300, 0.010f, 0f, 0f, 0f, 1100, 0.007f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
public static EaxReverb CastleCourtyard = new EaxReverb(26, 8.3f, 0.420f, -1000, -700, -1400, 2.13f, 0.61f, 0.23f, -1300, 0.160f, 0f, 0f, 0f, -300, 0.036f, 0f, 0f, 0f, 0.250f, 0.370f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb CastleAlcove = new EaxReverb(26, 8.3f, 0.890f, -1000, -600, -2000, 1.64f, 0.87f, 0.31f, 00, 0.007f, 0f, 0f, 0f, 300, 0.034f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
|
||||
|
||||
// FACTORY PRESETS
|
||||
|
||||
public static EaxReverb FactoryAlcove = new EaxReverb(26, 1.8f, 0.590f, -1200, -200, -600, 3.14f, 0.65f, 1.31f, 300, 0.010f, 0f, 0f, 0f, 000, 0.038f, 0f, 0f, 0f, 0.114f, 0.100f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryShortpassage = new EaxReverb(26, 1.8f, 0.640f, -1200, -200, -600, 2.53f, 0.65f, 1.31f, 0, 0.010f, 0f, 0f, 0f, 200, 0.038f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryMediumroom = new EaxReverb(26, 1.9f, 0.820f, -1200, -200, -600, 2.76f, 0.65f, 1.31f, -1100, 0.022f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.174f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryLongpassage = new EaxReverb(26, 1.8f, 0.640f, -1200, -200, -600, 4.06f, 0.65f, 1.31f, 0, 0.020f, 0f, 0f, 0f, 200, 0.037f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryLargeroom = new EaxReverb(26, 1.9f, 0.750f, -1200, -300, -400, 4.24f, 0.51f, 1.31f, -1500, 0.039f, 0f, 0f, 0f, 100, 0.023f, 0f, 0f, 0f, 0.231f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryHall = new EaxReverb(26, 1.9f, 0.750f, -1000, -300, -400, 7.43f, 0.51f, 1.31f, -2400, 0.073f, 0f, 0f, 0f, -100, 0.027f, 0f, 0f, 0f, 0.250f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryCupboard = new EaxReverb(26, 1.7f, 0.630f, -1200, -200, -600, 0.49f, 0.65f, 1.31f, 200, 0.010f, 0f, 0f, 0f, 600, 0.032f, 0f, 0f, 0f, 0.107f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactoryCourtyard = new EaxReverb(26, 1.7f, 0.570f, -1000, -1000, -400, 2.32f, 0.29f, 0.56f, -1300, 0.140f, 0f, 0f, 0f, -800, 0.039f, 0f, 0f, 0f, 0.250f, 0.290f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
public static EaxReverb FactorySmallroom = new EaxReverb(26, 1.8f, 0.820f, -1000, -200, -600, 1.72f, 0.65f, 1.31f, -300, 0.010f, 0f, 0f, 0f, 500, 0.024f, 0f, 0f, 0f, 0.119f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
|
||||
|
||||
// ICE PALACE PRESETS
|
||||
|
||||
public static EaxReverb IcepalaceAlcove = new EaxReverb(26, 2.7f, 0.840f, -1000, -500, -1100, 2.76f, 1.46f, 0.28f, 100, 0.010f, 0f, 0f, 0f, -100, 0.030f, 0f, 0f, 0f, 0.161f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceShortpassage = new EaxReverb(26, 2.7f, 0.750f, -1000, -500, -1100, 1.79f, 1.46f, 0.28f, -600, 0.010f, 0f, 0f, 0f, 100, 0.019f, 0f, 0f, 0f, 0.177f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceMediumroom = new EaxReverb(26, 2.7f, 0.870f, -1000, -500, -700, 2.22f, 1.53f, 0.32f, -800, 0.039f, 0f, 0f, 0f, 100, 0.027f, 0f, 0f, 0f, 0.186f, 0.120f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceLongpassage = new EaxReverb(26, 2.7f, 0.770f, -1000, -500, -800, 3.01f, 1.46f, 0.28f, -200, 0.012f, 0f, 0f, 0f, 200, 0.025f, 0f, 0f, 0f, 0.186f, 0.040f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceLargeroom = new EaxReverb(26, 2.9f, 0.810f, -1000, -500, -700, 3.14f, 1.53f, 0.32f, -1200, 0.039f, 0f, 0f, 0f, 000, 0.027f, 0f, 0f, 0f, 0.214f, 0.110f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceHall = new EaxReverb(26, 2.9f, 0.760f, -1000, -700, -500, 5.49f, 1.53f, 0.38f, -1900, 0.054f, 0f, 0f, 0f, -400, 0.052f, 0f, 0f, 0f, 0.226f, 0.110f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceCupboard = new EaxReverb(26, 2.7f, 0.830f, -1000, -600, -1300, 0.76f, 1.53f, 0.26f, 100, 0.012f, 0f, 0f, 0f, 600, 0.016f, 0f, 0f, 0f, 0.143f, 0.080f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceCourtyard = new EaxReverb(26, 2.9f, 0.590f, -1000, -1100, -1000, 2.04f, 1.20f, 0.38f, -1000, 0.173f, 0f, 0f, 0f, -1000, 0.043f, 0f, 0f, 0f, 0.235f, 0.480f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
public static EaxReverb IcepalaceSmallroom = new EaxReverb(26, 2.7f, 0.840f, -1000, -500, -1100, 1.51f, 1.53f, 0.27f, -100, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.164f, 0.140f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
|
||||
|
||||
// SPACE STATION PRESETS
|
||||
|
||||
public static EaxReverb SpacestationAlcove = new EaxReverb(26, 1.5f, 0.780f, -1000, -300, -100, 1.16f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 000, 0.018f, 0f, 0f, 0f, 0.192f, 0.210f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationMediumroom = new EaxReverb(26, 1.5f, 0.750f, -1000, -400, -100, 3.01f, 0.50f, 0.55f, -800, 0.034f, 0f, 0f, 0f, 100, 0.035f, 0f, 0f, 0f, 0.209f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationShortpassage = new EaxReverb(26, 1.5f, 0.870f, -1000, -400, -100, 3.57f, 0.50f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 100, 0.016f, 0f, 0f, 0f, 0.172f, 0.200f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationLongpassage = new EaxReverb(26, 1.9f, 0.820f, -1000, -400, -100, 4.62f, 0.62f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 200, 0.031f, 0f, 0f, 0f, 0.250f, 0.230f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationLargeroom = new EaxReverb(26, 1.8f, 0.810f, -1000, -400, -100, 3.89f, 0.38f, 0.61f, -1000, 0.056f, 0f, 0f, 0f, -100, 0.035f, 0f, 0f, 0f, 0.233f, 0.280f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationHall = new EaxReverb(26, 1.9f, 0.870f, -1000, -400, -100, 7.11f, 0.38f, 0.61f, -1500, 0.100f, 0f, 0f, 0f, -400, 0.047f, 0f, 0f, 0f, 0.250f, 0.250f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationCupboard = new EaxReverb(26, 1.4f, 0.560f, -1000, -300, -100, 0.79f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 500, 0.018f, 0f, 0f, 0f, 0.181f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
public static EaxReverb SpacestationSmallroom = new EaxReverb(26, 1.5f, 0.700f, -1000, -300, -100, 1.72f, 0.82f, 0.55f, -200, 0.007f, 0f, 0f, 0f, 300, 0.013f, 0f, 0f, 0f, 0.188f, 0.260f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
|
||||
|
||||
// WOODEN GALLEON PRESETS
|
||||
|
||||
public static EaxReverb WoodenAlcove = new EaxReverb(26, 7.5f, 1f, -1000, -1800, -1000, 1.22f, 0.62f, 0.91f, 100, 0.012f, 0f, 0f, 0f, -300, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenShortpassage = new EaxReverb(26, 7.5f, 1f, -1000, -1800, -1000, 1.75f, 0.50f, 0.87f, -100, 0.012f, 0f, 0f, 0f, -400, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenMediumroom = new EaxReverb(26, 7.5f, 1f, -1000, -2000, -1100, 1.47f, 0.42f, 0.82f, -100, 0.049f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenLongpassage = new EaxReverb(26, 7.5f, 1f, -1000, -2000, -1000, 1.99f, 0.40f, 0.79f, 000, 0.020f, 0f, 0f, 0f, -700, 0.036f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenLargeroom = new EaxReverb(26, 7.5f, 1f, -1000, -2100, -1100, 2.65f, 0.33f, 0.82f, -100, 0.066f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenHall = new EaxReverb(26, 7.5f, 1f, -1000, -2200, -1100, 3.45f, 0.30f, 0.82f, -100, 0.088f, 0f, 0f, 0f, -200, 0.063f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenCupboard = new EaxReverb(26, 7.5f, 1f, -1000, -1700, -1000, 0.56f, 0.46f, 0.91f, 100, 0.012f, 0f, 0f, 0f, 100, 0.028f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenSmallroom = new EaxReverb(26, 7.5f, 1f, -1000, -1900, -1000, 0.79f, 0.32f, 0.87f, 00, 0.032f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
public static EaxReverb WoodenCourtyard = new EaxReverb(26, 7.5f, 0.650f, -1000, -2200, -1000, 1.79f, 0.35f, 0.79f, -500, 0.123f, 0f, 0f, 0f, -2000, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
|
||||
|
||||
// SPORTS PRESETS
|
||||
|
||||
public static EaxReverb SportEmptystadium = new EaxReverb(26, 7.2f, 1f, -1000, -700, -200, 6.26f, 0.51f, 1.10f, -2400, 0.183f, 0f, 0f, 0f, -800, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
|
||||
public static EaxReverb SportSquashcourt = new EaxReverb(26, 7.5f, 0.750f, -1000, -1000, -200, 2.22f, 0.91f, 1.16f, -700, 0.007f, 0f, 0f, 0f, -200, 0.011f, 0f, 0f, 0f, 0.126f, 0.190f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
|
||||
public static EaxReverb SportSmallswimmingpool = new EaxReverb(26, 36.2f, 0.700f, -1000, -200, -100, 2.76f, 1.25f, 1.14f, -400, 0.020f, 0f, 0f, 0f, -200, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -5f, 5000f, 250f, 0f, 0x0);
|
||||
public static EaxReverb SportLargeswimmingpool = new EaxReverb(26, 36.2f, 0.820f, -1000, -200, 0, 5.49f, 1.31f, 1.14f, -700, 0.039f, 0f, 0f, 0f, -600, 0.049f, 0f, 0f, 0f, 0.222f, 0.550f, 1.159f, 0.210f, -5f, 5000f, 250f, 0f, 0x0);
|
||||
public static EaxReverb SportGymnasium = new EaxReverb(26, 7.5f, 0.810f, -1000, -700, -100, 3.14f, 1.06f, 1.35f, -800, 0.029f, 0f, 0f, 0f, -500, 0.045f, 0f, 0f, 0f, 0.146f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
|
||||
public static EaxReverb SportFullstadium = new EaxReverb(26, 7.2f, 1f, -1000, -2300, -200, 5.25f, 0.17f, 0.80f, -2000, 0.188f, 0f, 0f, 0f, -1100, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
|
||||
public static EaxReverb SportStadimtannoy = new EaxReverb(26, 3f, 0.780f, -1000, -500, -600, 2.53f, 0.88f, 0.68f, -1100, 0.230f, 0f, 0f, 0f, -600, 0.063f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
|
||||
|
||||
// PREFAB PRESETS
|
||||
|
||||
public static EaxReverb PrefabWorkshop = new EaxReverb(26, 1.9f, 1f, -1000, -1700, -800, 0.76f, 1f, 1f, 0, 0.012f, 0f, 0f, 0f, 100, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0);
|
||||
public static EaxReverb PrefabSchoolroom = new EaxReverb(26, 1.86f, 0.690f, -1000, -400, -600, 0.98f, 0.45f, 0.18f, 300, 0.017f, 0f, 0f, 0f, 300, 0.015f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
|
||||
public static EaxReverb PrefabPractiseroom = new EaxReverb(26, 1.86f, 0.870f, -1000, -800, -600, 1.12f, 0.56f, 0.18f, 200, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
|
||||
public static EaxReverb PrefabOuthouse = new EaxReverb(26, 80.3f, 0.820f, -1000, -1900, -1600, 1.38f, 0.38f, 0.35f, -100, 0.024f, 0f, 0f, -0f, -400, 0.044f, 0f, 0f, 0f, 0.121f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
|
||||
public static EaxReverb PrefabCaravan = new EaxReverb(26, 8.3f, 1f, -1000, -2100, -1800, 0.43f, 1.50f, 1f, 0, 0.012f, 0f, 0f, 0f, 600, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
|
||||
// DOME AND PIPE PRESETS
|
||||
|
||||
public static EaxReverb DomeTomb = new EaxReverb(26, 51.8f, 0.790f, -1000, -900, -1300, 4.18f, 0.21f, 0.10f, -825, 0.030f, 0f, 0f, 0f, 450, 0.022f, 0f, 0f, 0f, 0.177f, 0.190f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0);
|
||||
public static EaxReverb DomeSaintPauls = new EaxReverb(26, 50.3f, 0.870f, -1000, -900, -1300, 10.48f, 0.19f, 0.10f, -1500, 0.090f, 0f, 0f, 0f, 200, 0.042f, 0f, 0f, 0f, 0.250f, 0.120f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f);
|
||||
public static EaxReverb PipeSmall = new EaxReverb(26, 50.3f, 1f, -1000, -900, -1300, 5.04f, 0.10f, 0.10f, -600, 0.032f, 0f, 0f, 0f, 800, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f);
|
||||
public static EaxReverb PipeLongthin = new EaxReverb(26, 1.6f, 0.910f, -1000, -700, -1100, 9.21f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, -300, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0);
|
||||
public static EaxReverb PipeLarge = new EaxReverb(26, 50.3f, 1f, -1000, -900, -1300, 8.45f, 0.10f, 0.10f, -800, 0.046f, 0f, 0f, 0f, 400, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f);
|
||||
public static EaxReverb PipeResonant = new EaxReverb(26, 1.3f, 0.910f, -1000, -700, -1100, 6.81f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, 00, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0);
|
||||
|
||||
// OUTDOORS PRESETS
|
||||
|
||||
public static EaxReverb OutdoorsBackyard = new EaxReverb(26, 80.3f, 0.450f, -1000, -1200, -600, 1.12f, 0.34f, 0.46f, -700, 0.069f, 0f, 0f, -0f, -300, 0.023f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
|
||||
public static EaxReverb OutdoorsRollingplains = new EaxReverb(26, 80.3f, 0f, -1000, -3900, -400, 2.13f, 0.21f, 0.46f, -1500, 0.300f, 0f, 0f, -0f, -700, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
|
||||
public static EaxReverb OutdoorsDeepcanyon = new EaxReverb(26, 80.3f, 0.740f, -1000, -1500, -400, 3.89f, 0.21f, 0.46f, -1000, 0.223f, 0f, 0f, -0f, -900, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
|
||||
public static EaxReverb OutdoorsCreek = new EaxReverb(26, 80.3f, 0.350f, -1000, -1500, -600, 2.13f, 0.21f, 0.46f, -800, 0.115f, 0f, 0f, -0f, -1400, 0.031f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
|
||||
public static EaxReverb OutdoorsValley = new EaxReverb(26, 80.3f, 0.280f, -1000, -3100, -1600, 2.88f, 0.26f, 0.35f, -1700, 0.263f, 0f, 0f, -0f, -800, 0.100f, 0f, 0f, 0f, 0.250f, 0.340f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
|
||||
|
||||
// MOOD PRESETS
|
||||
|
||||
public static EaxReverb MoodHeaven = new EaxReverb(26, 19.6f, 0.940f, -1000, -200, -700, 5.04f, 1.12f, 0.56f, -1230, 0.020f, 0f, 0f, 0f, 200, 0.029f, 0f, 0f, 0f, 0.250f, 0.080f, 2.742f, 0.050f, -2f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb MoodHell = new EaxReverb(26, 100f, 0.570f, -1000, -900, -700, 3.57f, 0.49f, 2f, -10000, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.110f, 0.040f, 2.109f, 0.520f, -5f, 5000f, 139.5f, 0f, 0x40);
|
||||
public static EaxReverb MoodMemory = new EaxReverb(26, 8f, 0.850f, -1000, -400, -900, 4.06f, 0.82f, 0.56f, -2800, 0f, 0f, 0f, 0f, 100, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.474f, 0.450f, -10f, 5000f, 250f, 0f, 0x0);
|
||||
|
||||
// DRIVING SIMULATION PRESETS
|
||||
|
||||
public static EaxReverb DrivingCommentator = new EaxReverb(26, 3f, 0f, 1000, -500, -600, 2.42f, 0.88f, 0.68f, -1400, 0.093f, 0f, 0f, 0f, -1200, 0.017f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -10f, 5000f, 250f, 0f, 0x20);
|
||||
public static EaxReverb DrivingPitgarage = new EaxReverb(26, 1.9f, 0.590f, -1000, -300, -500, 1.72f, 0.93f, 0.87f, -500, 0f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.250f, 0.110f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0);
|
||||
public static EaxReverb DrivingIncarRacer = new EaxReverb(26, 1.1f, 0.800f, -1000, 0, -200, 0.17f, 2f, 0.41f, 500, 0.007f, 0f, 0f, 0f, -300, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20);
|
||||
public static EaxReverb DrivingIncarSports = new EaxReverb(26, 1.1f, 0.800f, -1000, -400, 0, 0.17f, 0.75f, 0.41f, 0, 0.010f, 0f, 0f, 0f, -500, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20);
|
||||
public static EaxReverb DrivingIncarLuxury = new EaxReverb(26, 1.6f, 1f, -1000, -2000, -600, 0.13f, 0.41f, 0.46f, -200, 0.010f, 0f, 0f, 0f, 400, 0.010f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20);
|
||||
public static EaxReverb DrivingFullgrandstand = new EaxReverb(26, 8.3f, 1f, -1000, -1100, -400, 3.01f, 1.37f, 1.28f, -900, 0.090f, 0f, 0f, 0f, -1500, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb DrivingEmptygrandstand = new EaxReverb(26, 8.3f, 1f, -1000, 0, -200, 4.62f, 1.75f, 1.40f, -1363, 0.090f, 0f, 0f, 0f, -1200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb DrivingTunnel = new EaxReverb(26, 3.1f, 0.810f, -1000, -800, -100, 3.42f, 0.94f, 1.31f, -300, 0.051f, 0f, 0f, 0f, -300, 0.047f, 0f, 0f, 0f, 0.214f, 0.050f, 0.250f, 0f, -5f, 5000f, 155.3f, 0f, 0x20);
|
||||
|
||||
// CITY PRESETS
|
||||
|
||||
public static EaxReverb CityStreets = new EaxReverb(26, 3f, 0.780f, -1000, -300, -100, 1.79f, 1.12f, 0.91f, -1100, 0.046f, 0f, 0f, 0f, -1400, 0.028f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
|
||||
public static EaxReverb CitySubway = new EaxReverb(26, 3f, 0.740f, -1000, -300, -100, 3.01f, 1.23f, 0.91f, -300, 0.046f, 0f, 0f, 0f, 200, 0.028f, 0f, 0f, 0f, 0.125f, 0.210f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
|
||||
public static EaxReverb CityMuseum = new EaxReverb(26, 80.3f, 0.820f, -1000, -1500, -1500, 3.28f, 1.40f, 0.57f, -1200, 0.039f, 0f, 0f, -0f, -100, 0.034f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
|
||||
public static EaxReverb CityLibrary = new EaxReverb(26, 80.3f, 0.820f, -1000, -1100, -2100, 2.76f, 0.89f, 0.41f, -900, 0.029f, 0f, 0f, -0f, -100, 0.020f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
|
||||
public static EaxReverb CityUnderpass = new EaxReverb(26, 3f, 0.820f, -1000, -700, -100, 3.57f, 1.12f, 0.91f, -800, 0.059f, 0f, 0f, 0f, -100, 0.037f, 0f, 0f, 0f, 0.250f, 0.140f, 0.250f, 0f, -7f, 5000f, 250f, 0f, 0x20);
|
||||
public static EaxReverb CityAbandoned = new EaxReverb(26, 3f, 0.690f, -1000, -200, -100, 3.28f, 1.17f, 0.91f, -700, 0.044f, 0f, 0f, 0f, -1100, 0.024f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -3f, 5000f, 250f, 0f, 0x20);
|
||||
|
||||
// MISC ROOMS
|
||||
|
||||
public static EaxReverb Generic = new EaxReverb(0, 7.5f, 1f, -1000, -100, 0, 1.49f, 0.83f, 1f, -2602, 0.007f, 0f, 0f, 0f, 200, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Paddedcell = new EaxReverb(1, 1.4f, 1f, -1000, -6000, 0, 0.17f, 0.10f, 1f, -1204, 0.001f, 0f, 0f, 0f, 207, 0.002f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Room = new EaxReverb(2, 1.9f, 1f, -1000, -454, 0, 0.40f, 0.83f, 1f, -1646, 0.002f, 0f, 0f, 0f, 53, 0.003f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Bathroom = new EaxReverb(3, 1.4f, 1f, -1000, -1200, 0, 1.49f, 0.54f, 1f, -370, 0.007f, 0f, 0f, 0f, 1030, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Livingroom = new EaxReverb(4, 2.5f, 1f, -1000, -6000, 0, 0.50f, 0.10f, 1f, -1376, 0.003f, 0f, 0f, 0f, -1104, 0.004f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Stoneroom = new EaxReverb(5, 11.6f, 1f, -1000, -300, 0, 2.31f, 0.64f, 1f, -711, 0.012f, 0f, 0f, 0f, 83, 0.017f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Auditorium = new EaxReverb(6, 21.6f, 1f, -1000, -476, 0, 4.32f, 0.59f, 1f, -789, 0.020f, 0f, 0f, 0f, -289, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Concerthall = new EaxReverb(7, 19.6f, 1f, -1000, -500, 0, 3.92f, 0.70f, 1f, -1230, 0.020f, 0f, 0f, 0f, -02, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Cave = new EaxReverb(8, 14.6f, 1f, -1000, 0, 0, 2.91f, 1.30f, 1f, -602, 0.015f, 0f, 0f, 0f, -302, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb Arena = new EaxReverb(9, 36.2f, 1f, -1000, -698, 0, 7.24f, 0.33f, 1f, -1166, 0.020f, 0f, 0f, 0f, 16, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Hangar = new EaxReverb(10, 50.3f, 1f, -1000, -1000, 0, 10.05f, 0.23f, 1f, -602, 0.020f, 0f, 0f, 0f, 198, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Carpettedhallway = new EaxReverb(11, 1.9f, 1f, -1000, -4000, 0, 0.30f, 0.10f, 1f, -1831, 0.002f, 0f, 0f, 0f, -1630, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Hallway = new EaxReverb(12, 1.8f, 1f, -1000, -300, 0, 1.49f, 0.59f, 1f, -1219, 0.007f, 0f, 0f, 0f, 441, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Stonecorridor = new EaxReverb(13, 13.5f, 1f, -1000, -237, 0, 2.70f, 0.79f, 1f, -1214, 0.013f, 0f, 0f, 0f, 395, 0.020f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Alley = new EaxReverb(14, 7.5f, 0.300f, -1000, -270, 0, 1.49f, 0.86f, 1f, -1204, 0.007f, 0f, 0f, 0f, -4, 0.011f, 0f, 0f, 0f, 0.125f, 0.950f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Forest = new EaxReverb(15, 38f, 0.300f, -1000, -3300, 0, 1.49f, 0.54f, 1f, -2560, 0.162f, 0f, 0f, 0f, -229, 0.088f, 0f, 0f, 0f, 0.125f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb City = new EaxReverb(16, 7.5f, 0.500f, -1000, -800, 0, 1.49f, 0.67f, 1f, -2273, 0.007f, 0f, 0f, 0f, -1691, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Mountains = new EaxReverb(17, 100f, 0.270f, -1000, -2500, 0, 1.49f, 0.21f, 1f, -2780, 0.300f, 0f, 0f, 0f, -1434, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb Quarry = new EaxReverb(18, 17.5f, 1f, -1000, -1000, 0, 1.49f, 0.83f, 1f, -10000, 0.061f, 0f, 0f, 0f, 500, 0.025f, 0f, 0f, 0f, 0.125f, 0.700f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Plain = new EaxReverb(19, 42.5f, 0.210f, -1000, -2000, 0, 1.49f, 0.50f, 1f, -2466, 0.179f, 0f, 0f, 0f, -1926, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Parkinglot = new EaxReverb(20, 8.3f, 1f, -1000, 0, 0, 1.65f, 1.50f, 1f, -1363, 0.008f, 0f, 0f, 0f, -1153, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb Sewerpipe = new EaxReverb(21, 1.7f, 0.800f, -1000, -1000, 0, 2.81f, 0.14f, 1f, 429, 0.014f, 0f, 0f, 0f, 1023, 0.021f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Underwater = new EaxReverb(22, 1.8f, 1f, -1000, -4000, 0, 1.49f, 0.10f, 1f, -449, 0.007f, 0f, 0f, 0f, 1700, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 1.180f, 0.348f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Drugged = new EaxReverb(23, 1.9f, 0.500f, -1000, 0, 0, 8.39f, 1.39f, 1f, -115, 0.002f, 0f, 0f, 0f, 985, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 1f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb Dizzy = new EaxReverb(24, 1.8f, 0.600f, -1000, -400, 0, 17.23f, 0.56f, 1f, -1713, 0.020f, 0f, 0f, 0f, -613, 0.030f, 0f, 0f, 0f, 0.250f, 1f, 0.810f, 0.310f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb Psychotic = new EaxReverb(25, 1f, 0.500f, -1000, -151, 0, 7.56f, 0.91f, 1f, -626, 0.020f, 0f, 0f, 0f, 774, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 4f, 1f, -5f, 5000f, 250f, 0f, 0x1f);
|
||||
public static EaxReverb Dustyroom = new EaxReverb(26, 1.8f, 0.560f, -1000, -200, -300, 1.79f, 0.38f, 0.21f, -600, 0.002f, 0f, 0f, 0f, 200, 0.006f, 0f, 0f, 0f, 0.202f, 0.050f, 0.250f, 0f, -10f, 13046f, 163.3f, 0f, 0x20);
|
||||
public static EaxReverb Chapel = new EaxReverb(26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f);
|
||||
public static EaxReverb Smallwaterroom = new EaxReverb(26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
}
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
|
@ -0,0 +1,208 @@
|
|||
#region --- OpenTK.OpenAL License ---
|
||||
/* XRamExtension.cs
|
||||
* C header: \OpenAL 1.1 SDK\include\xram.h
|
||||
* Spec: ?
|
||||
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
|
||||
* See license.txt for license details (MIT)
|
||||
* http://www.OpenTK.net */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
#pragma warning disable 3014
|
||||
#pragma warning disable 3003
|
||||
|
||||
namespace OpenTK.Audio.OpenAL
|
||||
{
|
||||
|
||||
///<summary>
|
||||
///The X-Ram Extension is provided on the top-end Sound Blaster X-Fi solutions (Sound Blaster X-Fi Fatal1ty, Sound Blaster X-Fi Elite Pro, or later).
|
||||
///These products feature 64MB of X-Ram that can only be used for audio purposes, which can be controlled by this Extension.
|
||||
///</summary>
|
||||
[CLSCompliant(true)]
|
||||
public sealed class XRamExtension
|
||||
{
|
||||
#region Instance state
|
||||
|
||||
private bool _valid = false;
|
||||
|
||||
/// <summary>Returns True if the X-Ram Extension has been found and could be initialized.</summary>
|
||||
public bool IsInitialized
|
||||
{
|
||||
get { return _valid; }
|
||||
}
|
||||
|
||||
#endregion Instance state
|
||||
|
||||
#region X-RAM Function pointer definitions
|
||||
|
||||
// [CLSCompliant(false)]
|
||||
private delegate bool Delegate_SetBufferMode(int n, ref uint buffers, int value);
|
||||
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
|
||||
|
||||
// [CLSCompliant( false )]
|
||||
private delegate int Delegate_GetBufferMode(uint buffer, IntPtr value);
|
||||
//typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
|
||||
|
||||
//[CLSCompliant(false)]
|
||||
private Delegate_SetBufferMode Imported_SetBufferMode;
|
||||
//[CLSCompliant(false)]
|
||||
private Delegate_GetBufferMode Imported_GetBufferMode;
|
||||
|
||||
#endregion X-RAM Function pointer definitions
|
||||
|
||||
#region X-RAM Tokens
|
||||
|
||||
private int AL_EAX_RAM_SIZE, AL_EAX_RAM_FREE,
|
||||
AL_STORAGE_AUTOMATIC, AL_STORAGE_HARDWARE, AL_STORAGE_ACCESSIBLE;
|
||||
|
||||
#endregion X-RAM Tokens
|
||||
|
||||
#region Constructor / Extension Loading
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new XRamExtension instance.
|
||||
/// </summary>
|
||||
public XRamExtension()
|
||||
{ // Query if Extension supported and retrieve Tokens/Pointers if it is.
|
||||
_valid = false;
|
||||
if (AL.IsExtensionPresent("EAX-RAM") == false)
|
||||
return;
|
||||
|
||||
AL_EAX_RAM_SIZE = AL.GetEnumValue("AL_EAX_RAM_SIZE");
|
||||
AL_EAX_RAM_FREE = AL.GetEnumValue("AL_EAX_RAM_FREE");
|
||||
AL_STORAGE_AUTOMATIC = AL.GetEnumValue("AL_STORAGE_AUTOMATIC");
|
||||
AL_STORAGE_HARDWARE = AL.GetEnumValue("AL_STORAGE_HARDWARE");
|
||||
AL_STORAGE_ACCESSIBLE = AL.GetEnumValue("AL_STORAGE_ACCESSIBLE");
|
||||
|
||||
// Console.WriteLine("RamSize: {0} RamFree: {1} StorageAuto: {2} StorageHW: {3} StorageAccess: {4}",AL_EAX_RAM_SIZE,AL_EAX_RAM_FREE,AL_STORAGE_AUTOMATIC,AL_STORAGE_HARDWARE,AL_STORAGE_ACCESSIBLE);
|
||||
|
||||
if (AL_EAX_RAM_SIZE == 0 ||
|
||||
AL_EAX_RAM_FREE == 0 ||
|
||||
AL_STORAGE_AUTOMATIC == 0 ||
|
||||
AL_STORAGE_HARDWARE == 0 ||
|
||||
AL_STORAGE_ACCESSIBLE == 0)
|
||||
{
|
||||
Debug.WriteLine("X-Ram: Token values could not be retrieved.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Console.WriteLine("Free Ram: {0} / {1}",GetRamFree( ),GetRamSize( ));
|
||||
|
||||
try
|
||||
{
|
||||
Imported_GetBufferMode = (Delegate_GetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXGetBufferMode"), typeof(Delegate_GetBufferMode));
|
||||
Imported_SetBufferMode = (Delegate_SetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXSetBufferMode"), typeof(Delegate_SetBufferMode));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.WriteLine("X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
#endregion Constructor / Extension Loading
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>Query total amount of X-RAM in bytes.</summary>
|
||||
public int GetRamSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return AL.Get((ALGetInteger)AL_EAX_RAM_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Query free X-RAM available in bytes.</summary>
|
||||
public int GetRamFree
|
||||
{
|
||||
get
|
||||
{
|
||||
return AL.Get((ALGetInteger)AL_EAX_RAM_FREE);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens!</summary>
|
||||
public enum XRamStorage : byte
|
||||
{
|
||||
/// <summary>Put an Open AL Buffer into X-RAM if memory is available, otherwise use host RAM. This is the default mode.</summary>
|
||||
Automatic = 0,
|
||||
/// <summary>Force an Open AL Buffer into X-RAM, good for non-streaming buffers.</summary>
|
||||
Hardware = 1,
|
||||
/// <summary>Force an Open AL Buffer into 'accessible' (currently host) RAM, good for streaming buffers.</summary>
|
||||
Accessible = 2,
|
||||
}
|
||||
|
||||
/// <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
|
||||
/// <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
|
||||
/// <param name="buffer">An array of OpenAL Buffer handles.</param>
|
||||
/// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
|
||||
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
|
||||
[CLSCompliant(false)]
|
||||
public bool SetBufferMode(int n, ref uint buffer, XRamStorage mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case XRamStorage.Accessible:
|
||||
return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_ACCESSIBLE);
|
||||
case XRamStorage.Hardware:
|
||||
return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_HARDWARE);
|
||||
default:
|
||||
return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_AUTOMATIC);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
|
||||
/// <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
|
||||
/// <param name="buffer">An array of OpenAL Buffer handles.</param>
|
||||
/// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
|
||||
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
|
||||
[CLSCompliant(true)]
|
||||
public bool SetBufferMode(int n, ref int buffer, XRamStorage mode)
|
||||
{
|
||||
uint temp = (uint)buffer;
|
||||
return SetBufferMode(n, ref temp, mode);
|
||||
}
|
||||
|
||||
/// <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
|
||||
/// <param name="buffer">The handle of an OpenAL Buffer.</param>
|
||||
/// <returns>The current Mode of the Buffer.</returns>
|
||||
[CLSCompliant(false)]
|
||||
public XRamStorage GetBufferMode(ref uint buffer)
|
||||
{
|
||||
int tempresult = Imported_GetBufferMode(buffer, IntPtr.Zero); // IntPtr.Zero due to the parameter being unused/reserved atm
|
||||
|
||||
if (tempresult == AL_STORAGE_ACCESSIBLE)
|
||||
return XRamStorage.Accessible;
|
||||
if (tempresult == AL_STORAGE_HARDWARE)
|
||||
return XRamStorage.Hardware;
|
||||
// default:
|
||||
return XRamStorage.Automatic;
|
||||
}
|
||||
|
||||
/// <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
|
||||
/// <param name="buffer">The handle of an OpenAL Buffer.</param>
|
||||
/// <returns>The current Mode of the Buffer.</returns>
|
||||
[CLSCompliant(true)]
|
||||
public XRamStorage GetBufferMode(ref int buffer)
|
||||
{
|
||||
uint temp = (uint)buffer;
|
||||
return GetBufferMode(ref temp);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
||||
#pragma warning restore 3014
|
||||
#pragma warning restore 3003
|
|
@ -0,0 +1,448 @@
|
|||
#region --- OpenTK.OpenAL License ---
|
||||
/* AlcFunctions.cs
|
||||
* C header: \OpenAL 1.1 SDK\include\Alc.h
|
||||
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
|
||||
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
|
||||
* See license.txt for license details
|
||||
* http://www.OpenTK.net */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
/* Type Mapping
|
||||
// 8-bit boolean
|
||||
typedef char ALCboolean;
|
||||
* byte
|
||||
// character
|
||||
typedef char ALCchar;
|
||||
* byte
|
||||
// signed 8-bit 2's complement integer
|
||||
typedef char ALCbyte;
|
||||
* byte
|
||||
|
||||
// unsigned 8-bit integer
|
||||
typedef unsigned char ALCubyte;
|
||||
* ubyte
|
||||
|
||||
// signed 16-bit 2's complement integer
|
||||
typedef short ALCshort;
|
||||
* short
|
||||
|
||||
// unsigned 16-bit integer
|
||||
typedef unsigned short ALCushort;
|
||||
* ushort
|
||||
|
||||
// unsigned 32-bit integer
|
||||
typedef unsigned int ALCuint;
|
||||
* uint
|
||||
|
||||
// signed 32-bit 2's complement integer
|
||||
typedef int ALCint;
|
||||
* int
|
||||
// non-negative 32-bit binary integer size
|
||||
typedef int ALCsizei;
|
||||
* int
|
||||
// enumerated 32-bit value
|
||||
typedef int ALCenum;
|
||||
* int
|
||||
|
||||
// 32-bit IEEE754 floating-point
|
||||
typedef float ALCfloat;
|
||||
* float
|
||||
|
||||
// 64-bit IEEE754 floating-point
|
||||
typedef double ALCdouble;
|
||||
* double
|
||||
|
||||
// void type (for opaque pointers only)
|
||||
typedef void ALCvoid;
|
||||
* void
|
||||
|
||||
* ALCdevice
|
||||
* ALCcontext *context
|
||||
* IntPtr
|
||||
*/
|
||||
|
||||
namespace OpenTK.Audio.OpenAL
|
||||
{
|
||||
|
||||
/// <summary>Alc = Audio Library Context</summary>
|
||||
public static class Alc
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const string Lib = AL.Lib;
|
||||
private const CallingConvention Style = CallingConvention.Cdecl;
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region Context Management
|
||||
|
||||
#region CreateContext
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCreateContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity]
|
||||
unsafe static extern IntPtr sys_CreateContext([In] IntPtr device, [In] int* attrlist);
|
||||
|
||||
/// <summary>This function creates a context using a specified device.</summary>
|
||||
/// <param name="device">a pointer to a device</param>
|
||||
/// <param name="attrlist">a pointer to a set of attributes: ALC_FREQUENCY, ALC_MONO_SOURCES, ALC_REFRESH, ALC_STEREO_SOURCES, ALC_SYNC</param>
|
||||
/// <returns>Returns a pointer to the new context (NULL on failure). The attribute list can be NULL, or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values.</returns>
|
||||
[CLSCompliant(false)]
|
||||
unsafe public static ContextHandle CreateContext([In] IntPtr device, [In] int* attrlist)
|
||||
{
|
||||
return new ContextHandle(sys_CreateContext(device, attrlist));
|
||||
}
|
||||
|
||||
// ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
|
||||
|
||||
/// <summary>This function creates a context using a specified device.</summary>
|
||||
/// <param name="device">a pointer to a device</param>
|
||||
/// <param name="attriblist">an array of a set of attributes: ALC_FREQUENCY, ALC_MONO_SOURCES, ALC_REFRESH, ALC_STEREO_SOURCES, ALC_SYNC</param>
|
||||
/// <returns>Returns a pointer to the new context (NULL on failure).</returns>
|
||||
/// <remarks>The attribute list can be NULL, or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values.</remarks>
|
||||
public static ContextHandle CreateContext(IntPtr device, int[] attriblist)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (int* attriblist_ptr = attriblist)
|
||||
{
|
||||
return CreateContext(device, attriblist_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcMakeContextCurrent", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
static extern bool MakeContextCurrent(IntPtr context);
|
||||
|
||||
/// <summary>This function makes a specified context the current context.</summary>
|
||||
/// <param name="context">A pointer to the new context.</param>
|
||||
/// <returns>Returns True on success, or False on failure.</returns>
|
||||
public static bool MakeContextCurrent(ContextHandle context)
|
||||
{
|
||||
return MakeContextCurrent(context.Handle);
|
||||
}
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcProcessContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
static extern void ProcessContext(IntPtr context);
|
||||
|
||||
/// <summary>This function tells a context to begin processing. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. alcSuspendContext can be used to suspend a context, and then all the OpenAL state changes can be applied at once, followed by a call to alcProcessContext to apply all the state changes immediately. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary>
|
||||
/// <param name="context">a pointer to the new context</param>
|
||||
public static void ProcessContext(ContextHandle context)
|
||||
{
|
||||
ProcessContext(context.Handle);
|
||||
}
|
||||
// ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcSuspendContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
static extern void SuspendContext(IntPtr context);
|
||||
|
||||
/// <summary>This function suspends processing on a specified context. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. A typical use of alcSuspendContext would be to suspend a context, apply all the OpenAL state changes at once, and then call alcProcessContext to apply all the state changes at once. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary>
|
||||
/// <param name="context">a pointer to the context to be suspended.</param>
|
||||
public static void SuspendContext(ContextHandle context)
|
||||
{
|
||||
SuspendContext(context.Handle);
|
||||
}
|
||||
// ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcDestroyContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
static extern void DestroyContext(IntPtr context);
|
||||
|
||||
/// <summary>This function destroys a context.</summary>
|
||||
/// <param name="context">a pointer to the new context.</param>
|
||||
public static void DestroyContext(ContextHandle context)
|
||||
{
|
||||
DestroyContext(context.Handle);
|
||||
}
|
||||
// ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetCurrentContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
private static extern IntPtr sys_GetCurrentContext();
|
||||
|
||||
/// <summary>This function retrieves the current context.</summary>
|
||||
/// <returns>Returns a pointer to the current context.</returns>
|
||||
public static ContextHandle GetCurrentContext()
|
||||
{
|
||||
return new ContextHandle(sys_GetCurrentContext());
|
||||
}
|
||||
// ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetContextsDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
static extern IntPtr GetContextsDevice(IntPtr context);
|
||||
|
||||
/// <summary>This function retrieves a context's device pointer.</summary>
|
||||
/// <param name="context">a pointer to a context.</param>
|
||||
/// <returns>Returns a pointer to the specified context's device.</returns>
|
||||
public static IntPtr GetContextsDevice(ContextHandle context)
|
||||
{
|
||||
return GetContextsDevice(context.Handle);
|
||||
}
|
||||
// ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
|
||||
|
||||
#endregion Context Management
|
||||
|
||||
#region Device Management
|
||||
|
||||
/// <summary>This function opens a device by name.</summary>
|
||||
/// <param name="devicename">a null-terminated string describing a device.</param>
|
||||
/// <returns>Returns a pointer to the opened device. The return value will be NULL if there is an error.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern IntPtr OpenDevice([In] string devicename);
|
||||
// ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
|
||||
|
||||
/// <summary>This function closes a device by name.</summary>
|
||||
/// <param name="device">a pointer to an opened device</param>
|
||||
/// <returns>True will be returned on success or False on failure. Closing a device will fail if the device contains any contexts or buffers.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern bool CloseDevice([In] IntPtr device);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
|
||||
|
||||
#endregion Device Management
|
||||
|
||||
#region Error support.
|
||||
|
||||
/// <summary>This function retrieves the current context error state.</summary>
|
||||
/// <param name="device">a pointer to the device to retrieve the error state from</param>
|
||||
/// <returns>Errorcode Int32.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetError", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AlcError GetError([In] IntPtr device);
|
||||
// ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
|
||||
|
||||
#endregion Error support.
|
||||
|
||||
#region Extension support.
|
||||
|
||||
/// <summary>This function queries if a specified context extension is available.</summary>
|
||||
/// <param name="device">a pointer to the device to be queried for an extension.</param>
|
||||
/// <param name="extname">a null-terminated string describing the extension.</param>
|
||||
/// <returns>Returns True if the extension is available, False if the extension is not available.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcIsExtensionPresent", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern bool IsExtensionPresent([In] IntPtr device, [In] string extname);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
|
||||
|
||||
/// <summary>This function retrieves the address of a specified context extension function.</summary>
|
||||
/// <param name="device">a pointer to the device to be queried for the function.</param>
|
||||
/// <param name="funcname">a null-terminated string describing the function.</param>
|
||||
/// <returns>Returns the address of the function, or NULL if it is not found.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetProcAddress", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern IntPtr GetProcAddress([In] IntPtr device, [In] string funcname);
|
||||
// ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
|
||||
|
||||
/// <summary>This function retrieves the enum value for a specified enumeration name.</summary>
|
||||
/// <param name="device">a pointer to the device to be queried.</param>
|
||||
/// <param name="enumname">a null terminated string describing the enum value.</param>
|
||||
/// <returns>Returns the enum value described by the enumName string. This is most often used for querying an enum value for an ALC extension.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetEnumValue", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern int GetEnumValue([In] IntPtr device, [In] string enumname);
|
||||
// ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
|
||||
|
||||
#endregion Extension support.
|
||||
|
||||
#region Query functions
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetString", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
private static extern IntPtr GetStringPrivate([In] IntPtr device, AlcGetString param);
|
||||
// ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
|
||||
|
||||
/// <summary>This function returns pointers to strings related to the context.</summary>
|
||||
/// <remarks>
|
||||
/// ALC_DEFAULT_DEVICE_SPECIFIER will return the name of the default output device.
|
||||
/// ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER will return the name of the default capture device.
|
||||
/// ALC_DEVICE_SPECIFIER will return the name of the specified output device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied. A list is a pointer to a series of strings separated by NULL characters, with the list terminated by two NULL characters. See Enumeration Extension for more details.
|
||||
/// ALC_CAPTURE_DEVICE_SPECIFIER will return the name of the specified capture device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied.
|
||||
/// ALC_EXTENSIONS returns a list of available context extensions, with each extension separated by a space and the list terminated by a NULL character.
|
||||
/// </remarks>
|
||||
/// <param name="device">a pointer to the device to be queried.</param>
|
||||
/// <param name="param">an attribute to be retrieved: ALC_DEFAULT_DEVICE_SPECIFIER, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER, ALC_DEVICE_SPECIFIER, ALC_CAPTURE_DEVICE_SPECIFIER, ALC_EXTENSIONS</param>
|
||||
/// <returns>A string containing the name of the Device.</returns>
|
||||
public static string GetString(IntPtr device, AlcGetString param)
|
||||
{
|
||||
return Marshal.PtrToStringAnsi(GetStringPrivate(device, param));
|
||||
}
|
||||
|
||||
/// <summary>This function returns a List of strings related to the context.</summary>
|
||||
/// <remarks>
|
||||
/// ALC_DEVICE_SPECIFIER will return the name of the specified output device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied. A list is a pointer to a series of strings separated by NULL characters, with the list terminated by two NULL characters. See Enumeration Extension for more details.
|
||||
/// ALC_CAPTURE_DEVICE_SPECIFIER will return the name of the specified capture device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied.
|
||||
/// ALC_EXTENSIONS returns a list of available context extensions, with each extension separated by a space and the list terminated by a NULL character.
|
||||
/// </remarks>
|
||||
/// <param name="device">a pointer to the device to be queried.</param>
|
||||
/// <param name="param">an attribute to be retrieved: ALC_DEVICE_SPECIFIER, ALC_CAPTURE_DEVICE_SPECIFIER, ALC_ALL_DEVICES_SPECIFIER</param>
|
||||
/// <returns>A List of strings containing the names of the Devices.</returns>
|
||||
public static IList<string> GetString(IntPtr device, AlcGetStringList param)
|
||||
{
|
||||
List<string> result = new List<string>();
|
||||
IntPtr t = GetStringPrivate(IntPtr.Zero, (AlcGetString)param);
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
byte b;
|
||||
int offset = 0;
|
||||
do
|
||||
{
|
||||
b = Marshal.ReadByte(t, offset++);
|
||||
if (b != 0)
|
||||
sb.Append((char)b);
|
||||
if (b == 0)
|
||||
{
|
||||
result.Add(sb.ToString());
|
||||
if (Marshal.ReadByte(t, offset) == 0) // offset already properly increased through ++
|
||||
break; // 2x null
|
||||
else
|
||||
sb.Remove(0, sb.Length); // 1x null
|
||||
}
|
||||
} while (true);
|
||||
|
||||
return (IList<string>)result;
|
||||
}
|
||||
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcGetIntegerv", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
unsafe static extern void GetInteger(IntPtr device, AlcGetInteger param, int size, int* data);
|
||||
// ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer );
|
||||
|
||||
/// <summary>This function returns integers related to the context.</summary>
|
||||
/// <param name="device">a pointer to the device to be queried.</param>
|
||||
/// <param name="param">an attribute to be retrieved: ALC_MAJOR_VERSION, ALC_MINOR_VERSION, ALC_ATTRIBUTES_SIZE, ALC_ALL_ATTRIBUTES</param>
|
||||
/// <param name="size">the size of the destination buffer provided, in number of integers.</param>
|
||||
/// <param name="data">a pointer to the buffer to be returned</param>
|
||||
public static void GetInteger(IntPtr device, AlcGetInteger param, int size, out int data)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (int* data_ptr = &data)
|
||||
{
|
||||
GetInteger(device, param, size, data_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>This function returns integers related to the context.</summary>
|
||||
/// <param name="device">a pointer to the device to be queried.</param>
|
||||
/// <param name="param">an attribute to be retrieved: ALC_MAJOR_VERSION, ALC_MINOR_VERSION, ALC_ATTRIBUTES_SIZE, ALC_ALL_ATTRIBUTES</param>
|
||||
/// <param name="size">the size of the destination buffer provided, in number of integers.</param>
|
||||
/// <param name="data">a pointer to the buffer to be returned</param>
|
||||
public static void GetInteger(IntPtr device, AlcGetInteger param, int size, int[] data)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (int* data_ptr = data)
|
||||
{
|
||||
GetInteger(device, param, size, data_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Query functions
|
||||
|
||||
#region Capture functions
|
||||
|
||||
/// <summary>This function opens a capture device by name. </summary>
|
||||
/// <param name="devicename">a pointer to a device name string.</param>
|
||||
/// <param name="frequency">the frequency that the buffer should be captured at.</param>
|
||||
/// <param name="format">the requested capture buffer format.</param>
|
||||
/// <param name="buffersize">the size of the capture buffer in samples, not bytes.</param>
|
||||
/// <returns>Returns the capture device pointer, or NULL on failure.</returns>
|
||||
[CLSCompliant(false), DllImport(Alc.Lib, EntryPoint = "alcCaptureOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern IntPtr CaptureOpenDevice(string devicename, uint frequency, ALFormat format, int buffersize);
|
||||
|
||||
/// <summary>This function opens a capture device by name. </summary>
|
||||
/// <param name="devicename">a pointer to a device name string.</param>
|
||||
/// <param name="frequency">the frequency that the buffer should be captured at.</param>
|
||||
/// <param name="format">the requested capture buffer format.</param>
|
||||
/// <param name="buffersize">the size of the capture buffer in samples, not bytes.</param>
|
||||
/// <returns>Returns the capture device pointer, or NULL on failure.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCaptureOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern IntPtr CaptureOpenDevice(string devicename, int frequency, ALFormat format, int buffersize);
|
||||
|
||||
// ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
|
||||
|
||||
/// <summary>This function closes the specified capture device.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <returns>Returns True if the close operation was successful, False on failure.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCaptureCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern bool CaptureCloseDevice([In] IntPtr device);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
|
||||
|
||||
/// <summary>This function begins a capture operation.</summary>
|
||||
/// <remarks>alcCaptureStart will begin recording to an internal ring buffer of the size specified when opening the capture device. The application can then retrieve the number of samples currently available using the ALC_CAPTURE_SAPMPLES token with alcGetIntegerv. When the application determines that enough samples are available for processing, then it can obtain them with a call to alcCaptureSamples.</remarks>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCaptureStart", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern void CaptureStart([In] IntPtr device);
|
||||
// ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
|
||||
|
||||
/// <summary>This function stops a capture operation.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCaptureStop", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern void CaptureStop([In] IntPtr device);
|
||||
// ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
|
||||
|
||||
/// <summary>This function completes a capture operation, and does not block.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <param name="buffer">a pointer to a buffer, which must be large enough to accommodate the number of samples.</param>
|
||||
/// <param name="samples">the number of samples to be retrieved.</param>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCaptureSamples", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern void CaptureSamples(IntPtr device, IntPtr buffer, int samples);
|
||||
// ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
|
||||
|
||||
/// <summary>This function completes a capture operation, and does not block.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <param name="buffer">a reference to a buffer, which must be large enough to accommodate the number of samples.</param>
|
||||
/// <param name="samples">the number of samples to be retrieved.</param>
|
||||
public static void CaptureSamples<T>(IntPtr device, ref T buffer, int samples)
|
||||
where T : struct
|
||||
{
|
||||
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
|
||||
try
|
||||
{
|
||||
CaptureSamples(device, handle.AddrOfPinnedObject(), samples);
|
||||
}
|
||||
finally
|
||||
{
|
||||
handle.Free();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>This function completes a capture operation, and does not block.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <param name="buffer">a buffer, which must be large enough to accommodate the number of samples.</param>
|
||||
/// <param name="samples">the number of samples to be retrieved.</param>
|
||||
public static void CaptureSamples<T>(IntPtr device, T[] buffer, int samples)
|
||||
where T : struct
|
||||
{
|
||||
CaptureSamples(device, ref buffer[0], samples);
|
||||
}
|
||||
|
||||
/// <summary>This function completes a capture operation, and does not block.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <param name="buffer">a buffer, which must be large enough to accommodate the number of samples.</param>
|
||||
/// <param name="samples">the number of samples to be retrieved.</param>
|
||||
public static void CaptureSamples<T>(IntPtr device, T[,] buffer, int samples)
|
||||
where T : struct
|
||||
{
|
||||
CaptureSamples(device, ref buffer[0, 0], samples);
|
||||
}
|
||||
|
||||
/// <summary>This function completes a capture operation, and does not block.</summary>
|
||||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <param name="buffer">a buffer, which must be large enough to accommodate the number of samples.</param>
|
||||
/// <param name="samples">the number of samples to be retrieved.</param>
|
||||
public static void CaptureSamples<T>(IntPtr device, T[, ,] buffer, int samples)
|
||||
where T : struct
|
||||
{
|
||||
CaptureSamples(device, ref buffer[0, 0, 0], samples);
|
||||
}
|
||||
|
||||
#endregion Capture functions
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
|
@ -0,0 +1,135 @@
|
|||
#region --- OpenTK.OpenAL License ---
|
||||
/* AlcTokens.cs
|
||||
* C header: \OpenAL 1.1 SDK\include\Alc.h
|
||||
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
|
||||
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
|
||||
* See license.txt for license details
|
||||
* http://www.OpenTK.net */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenTK.Audio.OpenAL
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines available context attributes.
|
||||
/// </summary>
|
||||
public enum AlcContextAttributes : int
|
||||
{
|
||||
///<summary>Followed by System.Int32 Hz</summary>
|
||||
Frequency = 0x1007,
|
||||
|
||||
///<summary>Followed by System.Int32 Hz</summary>
|
||||
Refresh = 0x1008,
|
||||
|
||||
///<summary>Followed by AlBoolean.True, or AlBoolean.False</summary>
|
||||
Sync = 0x1009,
|
||||
|
||||
///<summary>Followed by System.Int32 Num of requested Mono (3D) Sources</summary>
|
||||
MonoSources = 0x1010,
|
||||
|
||||
///<summary>Followed by System.Int32 Num of requested Stereo Sources</summary>
|
||||
StereoSources = 0x1011,
|
||||
|
||||
/// <summary>(EFX Extension) This Context property can be passed to OpenAL during Context creation (alcCreateContext) to request a maximum number of Auxiliary Sends desired on each Source. It is not guaranteed that the desired number of sends will be available, so an application should query this property after creating the context using alcGetIntergerv. Default: 2</summary>
|
||||
EfxMaxAuxiliarySends = 0x20003,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines OpenAL context errors.
|
||||
/// </summary>
|
||||
public enum AlcError : int
|
||||
{
|
||||
///<summary>There is no current error.</summary>
|
||||
NoError = 0,
|
||||
|
||||
///<summary>No Device. The device handle or specifier names an inaccessible driver/server.</summary>
|
||||
InvalidDevice = 0xA001,
|
||||
|
||||
///<summary>Invalid context ID. The Context argument does not name a valid context.</summary>
|
||||
InvalidContext = 0xA002,
|
||||
|
||||
///<summary>Bad enum. A token used is not valid, or not applicable.</summary>
|
||||
InvalidEnum = 0xA003,
|
||||
|
||||
///<summary>Bad value. A value (e.g. Attribute) is not valid, or not applicable.</summary>
|
||||
InvalidValue = 0xA004,
|
||||
|
||||
///<summary>Out of memory. Unable to allocate memory.</summary>
|
||||
OutOfMemory = 0xA005,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines available parameters for <see cref="OpenTK.Audio.OpenAL.Alc.GetString(IntPtr, AlcGetString)"/>.
|
||||
/// </summary>
|
||||
public enum AlcGetString : int
|
||||
{
|
||||
///<summary>The specifier string for the default device.</summary>
|
||||
DefaultDeviceSpecifier = 0x1004,
|
||||
|
||||
///<summary>A list of available context extensions separated by spaces.</summary>
|
||||
Extensions = 0x1006,
|
||||
|
||||
///<summary>The name of the default capture device</summary>
|
||||
CaptureDefaultDeviceSpecifier = 0x311, // ALC_EXT_CAPTURE extension.
|
||||
|
||||
/// <summary>a list of the default devices.</summary>
|
||||
DefaultAllDevicesSpecifier = 0x1012,
|
||||
|
||||
// duplicates from AlcGetStringList:
|
||||
|
||||
///<summary>Will only return the first Device, not a list. Use AlcGetStringList.CaptureDeviceSpecifier. ALC_EXT_CAPTURE_EXT </summary>
|
||||
CaptureDeviceSpecifier = 0x310,
|
||||
|
||||
///<summary>Will only return the first Device, not a list. Use AlcGetStringList.DeviceSpecifier</summary>
|
||||
DeviceSpecifier = 0x1005,
|
||||
|
||||
/// <summary>Will only return the first Device, not a list. Use AlcGetStringList.AllDevicesSpecifier</summary>
|
||||
AllDevicesSpecifier = 0x1013,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines available parameters for <see cref="Alc.GetString(IntPtr, AlcGetStringList)"/>.
|
||||
/// </summary>
|
||||
public enum AlcGetStringList : int
|
||||
{
|
||||
///<summary>The name of the specified capture device, or a list of all available capture devices if no capture device is specified. ALC_EXT_CAPTURE_EXT </summary>
|
||||
CaptureDeviceSpecifier = 0x310,
|
||||
|
||||
///<summary>The specifier strings for all available devices. ALC_ENUMERATION_EXT</summary>
|
||||
DeviceSpecifier = 0x1005,
|
||||
|
||||
/// <summary>The specifier strings for all available devices. ALC_ENUMERATE_ALL_EXT</summary>
|
||||
AllDevicesSpecifier = 0x1013,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines available parameters for <see cref="Alc.GetInteger(IntPtr, AlcGetInteger, int, int[])"/>.
|
||||
/// </summary>
|
||||
public enum AlcGetInteger : int
|
||||
{
|
||||
///<summary>The specification revision for this implementation (major version). NULL is an acceptable device.</summary>
|
||||
MajorVersion = 0x1000,
|
||||
|
||||
///<summary>The specification revision for this implementation (minor version). NULL is an acceptable device.</summary>
|
||||
MinorVersion = 0x1001,
|
||||
|
||||
///<summary>The size (number of ALCint values) required for a zero-terminated attributes list, for the current context. NULL is an invalid device.</summary>
|
||||
AttributesSize = 0x1002,
|
||||
|
||||
///<summary>Expects a destination of ALC_ATTRIBUTES_SIZE, and provides an attribute list for the current context of the specified device. NULL is an invalid device.</summary>
|
||||
AllAttributes = 0x1003,
|
||||
|
||||
///<summary>The number of capture samples available. NULL is an invalid device.</summary>
|
||||
CaptureSamples = 0x312,
|
||||
|
||||
/// <summary>(EFX Extension) This property can be used by the application to retrieve the Major version number of the Effects Extension supported by this OpenAL implementation. As this is a Context property is should be retrieved using alcGetIntegerv.</summary>
|
||||
EfxMajorVersion = 0x20001,
|
||||
|
||||
/// <summary>(EFX Extension) This property can be used by the application to retrieve the Minor version number of the Effects Extension supported by this OpenAL implementation. As this is a Context property is should be retrieved using alcGetIntegerv.</summary>
|
||||
EfxMinorVersion = 0x20002,
|
||||
|
||||
/// <summary>(EFX Extension) This Context property can be passed to OpenAL during Context creation (alcCreateContext) to request a maximum number of Auxiliary Sends desired on each Source. It is not guaranteed that the desired number of sends will be available, so an application should query this property after creating the context using alcGetIntergerv. Default: 2</summary>
|
||||
EfxMaxAuxiliarySends = 0x20003,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2008 the Open Toolkit library, except where noted.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that this function is generated automatically by a tool.
|
||||
/// </summary>
|
||||
public sealed class AutoGeneratedAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the category of this OpenGL function.
|
||||
/// </summary>
|
||||
public string Category;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the version of this OpenGL function.
|
||||
/// </summary>
|
||||
public string Version;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the entry point of the OpenGL function.
|
||||
/// </summary>
|
||||
public string EntryPoint;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new AutoGeneratedAttribute instance.
|
||||
/// </summary>
|
||||
public AutoGeneratedAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,230 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a common foundation for all flat API bindings and implements the extension loading interface.
|
||||
/// </summary>
|
||||
public abstract class BindingsBase
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// A reflection handle to the nested type that contains the function delegates.
|
||||
/// </summary>
|
||||
readonly protected Type DelegatesClass;
|
||||
|
||||
/// <summary>
|
||||
/// A refection handle to the nested type that contains core functions (i.e. not extensions).
|
||||
/// </summary>
|
||||
readonly protected Type CoreClass;
|
||||
|
||||
/// <summary>
|
||||
/// A mapping of core function names to MethodInfo handles.
|
||||
/// </summary>
|
||||
readonly protected SortedList<string, MethodInfo> CoreFunctionMap = new SortedList<string, MethodInfo>();
|
||||
|
||||
bool rebuildExtensionList = true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new BindingsBase instance.
|
||||
/// </summary>
|
||||
public BindingsBase()
|
||||
{
|
||||
DelegatesClass = this.GetType().GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
CoreClass = this.GetType().GetNestedType("Core", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
|
||||
if (CoreClass != null)
|
||||
{
|
||||
MethodInfo[] methods = CoreClass.GetMethods(BindingFlags.Static | BindingFlags.NonPublic);
|
||||
CoreFunctionMap = new SortedList<string, MethodInfo>(methods.Length); // Avoid resizing
|
||||
foreach (MethodInfo m in methods)
|
||||
{
|
||||
CoreFunctionMap.Add(m.Name, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="System.Boolean"/> that indicates whether the list of supported extensions may have changed.
|
||||
/// </summary>
|
||||
protected bool RebuildExtensionList
|
||||
{
|
||||
get { return rebuildExtensionList; }
|
||||
set { rebuildExtensionList = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves an unmanaged function pointer to the specified function.
|
||||
/// </summary>
|
||||
/// <param name="funcname">
|
||||
/// A <see cref="System.String"/> that defines the name of the function.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="IntPtr"/> that contains the address of funcname or IntPtr.Zero,
|
||||
/// if the function is not supported by the drivers.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// Note: some drivers are known to return non-zero values for unsupported functions.
|
||||
/// Typical values include 1 and 2 - inheritors are advised to check for and ignore these
|
||||
/// values.
|
||||
/// </remarks>
|
||||
protected abstract IntPtr GetAddress(string funcname);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an object that can be used to synchronize access to the bindings implementation.
|
||||
/// </summary>
|
||||
/// <remarks>This object should be unique across bindings but consistent between bindings
|
||||
/// of the same type. For example, ES10.GL, OpenGL.GL and CL10.CL should all return
|
||||
/// unique objects, but all instances of ES10.GL should return the same object.</remarks>
|
||||
protected abstract object SyncRoot { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Members
|
||||
|
||||
#region LoadEntryPoints
|
||||
|
||||
internal void LoadEntryPoints()
|
||||
{
|
||||
// Using reflection is more than 3 times faster than directly loading delegates on the first
|
||||
// run, probably due to code generation overhead. Subsequent runs are faster with direct loading
|
||||
// than with reflection, but the first time is more significant.
|
||||
|
||||
int supported = 0;
|
||||
|
||||
FieldInfo[] delegates = DelegatesClass.GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
|
||||
if (delegates == null)
|
||||
throw new InvalidOperationException("The specified type does not have any loadable extensions.");
|
||||
|
||||
Debug.Write("Loading extensions for " + this.GetType().FullName + "... ");
|
||||
|
||||
Stopwatch time = new Stopwatch();
|
||||
time.Reset();
|
||||
time.Start();
|
||||
|
||||
foreach (FieldInfo f in delegates)
|
||||
{
|
||||
Delegate d = LoadDelegate(f.Name, f.FieldType);
|
||||
if (d != null)
|
||||
++supported;
|
||||
|
||||
lock (SyncRoot)
|
||||
{
|
||||
f.SetValue(null, d);
|
||||
}
|
||||
}
|
||||
|
||||
rebuildExtensionList = true;
|
||||
|
||||
time.Stop();
|
||||
Debug.Print("{0} extensions loaded in {1} ms.", supported, time.Elapsed.TotalMilliseconds);
|
||||
time.Reset();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region LoadEntryPoint
|
||||
|
||||
internal bool LoadEntryPoint(string function)
|
||||
{
|
||||
FieldInfo f = DelegatesClass.GetField(function, BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (f == null)
|
||||
return false;
|
||||
|
||||
Delegate old = f.GetValue(null) as Delegate;
|
||||
Delegate @new = LoadDelegate(f.Name, f.FieldType);
|
||||
lock (SyncRoot)
|
||||
{
|
||||
if (old.Target != @new.Target)
|
||||
{
|
||||
f.SetValue(null, @new);
|
||||
}
|
||||
}
|
||||
return @new != null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Members
|
||||
|
||||
#region LoadDelegate
|
||||
|
||||
// Tries to load the specified core or extension function.
|
||||
Delegate LoadDelegate(string name, Type signature)
|
||||
{
|
||||
MethodInfo m;
|
||||
return
|
||||
GetExtensionDelegate(name, signature) ??
|
||||
(CoreFunctionMap.TryGetValue((name.Substring(2)), out m) ?
|
||||
Delegate.CreateDelegate(signature, m) : null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GetExtensionDelegate
|
||||
|
||||
// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
|
||||
internal Delegate GetExtensionDelegate(string name, Type signature)
|
||||
{
|
||||
IntPtr address = GetAddress(name);
|
||||
|
||||
if (address == IntPtr.Zero ||
|
||||
address == new IntPtr(1) || // Workaround for buggy nvidia drivers which return
|
||||
address == new IntPtr(2)) // 1 or 2 instead of IntPtr.Zero for some extensions.
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Marshal.GetDelegateForFunctionPointer(address, signature);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,291 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2010 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
#region BlittableValueType<T>
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the specified type parameter is a blittable value type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A blittable value type is a struct that only references other value types recursively,
|
||||
/// which allows it to be passed to unmanaged code directly.
|
||||
/// </remarks>
|
||||
public static class BlittableValueType<T>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
static readonly Type Type;
|
||||
static readonly int stride;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
static BlittableValueType()
|
||||
{
|
||||
Type = typeof(T);
|
||||
if (Type.IsValueType && !Type.IsGenericType)
|
||||
{
|
||||
// Does this support generic types? On Mono 2.4.3 it does
|
||||
// On .Net it doesn't.
|
||||
// http://msdn.microsoft.com/en-us/library/5s4920fa.aspx
|
||||
stride = Marshal.SizeOf(typeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the type in bytes or 0 for non-blittable types.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property returns 0 for non-blittable types.
|
||||
/// </remarks>
|
||||
public static int Stride { get { return stride; } }
|
||||
|
||||
#region Check
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the current typename T is blittable.
|
||||
/// </summary>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
public static bool Check()
|
||||
{
|
||||
return Check(Type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether type is a blittable value type.
|
||||
/// </summary>
|
||||
/// <param name="type">A System.Type to check.</param>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
public static bool Check(Type type)
|
||||
{
|
||||
if (!CheckStructLayoutAttribute(type))
|
||||
Debug.Print("Warning: type {0} does not specify a StructLayoutAttribute with Pack=1. The memory layout of the struct may change between platforms.", type.Name);
|
||||
|
||||
return CheckType(type);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Members
|
||||
|
||||
// Checks whether the parameter is a primitive type or consists of primitive types recursively.
|
||||
// Throws a NotSupportedException if it is not.
|
||||
static bool CheckType(Type type)
|
||||
{
|
||||
//Debug.Print("Checking type {0} (size: {1} bytes).", type.Name, Marshal.SizeOf(type));
|
||||
if (type.IsPrimitive)
|
||||
return true;
|
||||
|
||||
if (!type.IsValueType)
|
||||
return false;
|
||||
|
||||
FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
Debug.Indent();
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
if (!CheckType(field.FieldType))
|
||||
return false;
|
||||
}
|
||||
Debug.Unindent();
|
||||
|
||||
return Stride != 0;
|
||||
}
|
||||
|
||||
// Checks whether the specified struct defines [StructLayout(LayoutKind.Sequential, Pack=1)]
|
||||
// or [StructLayout(LayoutKind.Explicit)]
|
||||
static bool CheckStructLayoutAttribute(Type type)
|
||||
{
|
||||
StructLayoutAttribute[] attr = (StructLayoutAttribute[])
|
||||
type.GetCustomAttributes(typeof(StructLayoutAttribute), true);
|
||||
|
||||
if ((attr == null) ||
|
||||
(attr != null && attr.Length > 0 && attr[0].Value != LayoutKind.Explicit && attr[0].Pack != 1))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region BlittableValueType
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the specified type parameter is a blittable value type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A blittable value type is a struct that only references other value types recursively,
|
||||
/// which allows it to be passed to unmanaged code directly.
|
||||
/// </remarks>
|
||||
public static class BlittableValueType
|
||||
{
|
||||
#region Check
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether type is a blittable value type.
|
||||
/// </summary>
|
||||
/// <param name="type">An instance of the type to check.</param>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
public static bool Check<T>(T type)
|
||||
{
|
||||
return BlittableValueType<T>.Check();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether type is a blittable value type.
|
||||
/// </summary>
|
||||
/// <param name="type">An instance of the type to check.</param>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
public static bool Check<T>(T[] type)
|
||||
{
|
||||
return BlittableValueType<T>.Check();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether type is a blittable value type.
|
||||
/// </summary>
|
||||
/// <param name="type">An instance of the type to check.</param>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
public static bool Check<T>(T[,] type)
|
||||
{
|
||||
return BlittableValueType<T>.Check();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether type is a blittable value type.
|
||||
/// </summary>
|
||||
/// <param name="type">An instance of the type to check.</param>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
public static bool Check<T>(T[, ,] type)
|
||||
{
|
||||
return BlittableValueType<T>.Check();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether type is a blittable value type.
|
||||
/// </summary>
|
||||
/// <param name="type">An instance of the type to check.</param>
|
||||
/// <returns>True if T is blittable; false otherwise.</returns>
|
||||
[CLSCompliant(false)]
|
||||
public static bool Check<T>(T[][] type)
|
||||
{
|
||||
return BlittableValueType<T>.Check();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region StrideOf
|
||||
|
||||
/// <summary>
|
||||
/// Returns the size of the specified value type in bytes or 0 if the type is not blittable.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The value type. Must be blittable.</typeparam>
|
||||
/// <param name="type">An instance of the value type.</param>
|
||||
/// <returns>An integer, specifying the size of the type in bytes.</returns>
|
||||
/// <exception cref="System.ArgumentException">Occurs when type is not blittable.</exception>
|
||||
public static int StrideOf<T>(T type)
|
||||
{
|
||||
if (!Check(type))
|
||||
throw new ArgumentException("type");
|
||||
|
||||
return BlittableValueType<T>.Stride;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the size of a single array element in bytes or 0 if the element is not blittable.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The value type.</typeparam>
|
||||
/// <param name="type">An instance of the value type.</param>
|
||||
/// <returns>An integer, specifying the size of the type in bytes.</returns>
|
||||
/// <exception cref="System.ArgumentException">Occurs when type is not blittable.</exception>
|
||||
public static int StrideOf<T>(T[] type)
|
||||
{
|
||||
if (!Check(type))
|
||||
throw new ArgumentException("type");
|
||||
|
||||
return BlittableValueType<T>.Stride;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the size of a single array element in bytes or 0 if the element is not blittable.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The value type.</typeparam>
|
||||
/// <param name="type">An instance of the value type.</param>
|
||||
/// <returns>An integer, specifying the size of the type in bytes.</returns>
|
||||
/// <exception cref="System.ArgumentException">Occurs when type is not blittable.</exception>
|
||||
public static int StrideOf<T>(T[,] type)
|
||||
{
|
||||
if (!Check(type))
|
||||
throw new ArgumentException("type");
|
||||
|
||||
return BlittableValueType<T>.Stride;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the size of a single array element in bytes or 0 if the element is not blittable.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The value type.</typeparam>
|
||||
/// <param name="type">An instance of the value type.</param>
|
||||
/// <returns>An integer, specifying the size of the type in bytes.</returns>
|
||||
/// <exception cref="System.ArgumentException">Occurs when type is not blittable.</exception>
|
||||
public static int StrideOf<T>(T[, ,] type)
|
||||
{
|
||||
if (!Check(type))
|
||||
throw new ArgumentException("type");
|
||||
|
||||
return BlittableValueType<T>.Stride;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
|
@ -0,0 +1,177 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||
* This notice may not be removed from any source distribution.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a handle to an OpenGL or OpenAL context.
|
||||
/// </summary>
|
||||
public struct ContextHandle : IComparable<ContextHandle>, IEquatable<ContextHandle>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
IntPtr handle;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.IntPtr that represents the handle of this ContextHandle.
|
||||
/// </summary>
|
||||
public IntPtr Handle { get { return handle; } }
|
||||
|
||||
/// <summary>A read-only field that represents a handle that has been initialized to zero.</summary>
|
||||
public static readonly ContextHandle Zero = new ContextHandle(IntPtr.Zero);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance with the specified handle.
|
||||
/// </summary>
|
||||
/// <param name="h">A System.IntPtr containing the value for this instance.</param>
|
||||
public ContextHandle(IntPtr h) { handle = h; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
#region ToString
|
||||
|
||||
/// <summary>
|
||||
/// Converts this instance to its equivalent string representation.
|
||||
/// </summary>
|
||||
/// <returns>A System.String that contains the string representation of this instance.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return Handle.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Equals
|
||||
|
||||
/// <summary>
|
||||
/// Compares this instance to the specified object.
|
||||
/// </summary>
|
||||
/// <param name="obj">The System.Object to compare to.</param>
|
||||
/// <returns>True if obj is a ContextHandle that is equal to this instance; false otherwise.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is ContextHandle)
|
||||
return this.Equals((ContextHandle)obj);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GetHashCode
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A System.Int32 with the hash code of this instance.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Handle.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static explicit operator IntPtr(ContextHandle c)
|
||||
|
||||
/// <summary>
|
||||
/// Converts the specified ContextHandle to the equivalent IntPtr.
|
||||
/// </summary>
|
||||
/// <param name="c">The ContextHandle to convert.</param>
|
||||
/// <returns>A System.IntPtr equivalent to the specified ContextHandle.</returns>
|
||||
public static explicit operator IntPtr(ContextHandle c)
|
||||
{
|
||||
return c != ContextHandle.Zero ? c.handle : IntPtr.Zero;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static explicit operator ContextHandle(IntPtr p)
|
||||
|
||||
/// <summary>
|
||||
/// Converts the specified IntPtr to the equivalent ContextHandle.
|
||||
/// </summary>
|
||||
/// <param name="p">The System.IntPtr to convert.</param>
|
||||
/// <returns>A ContextHandle equivalent to the specified IntPtr.</returns>
|
||||
public static explicit operator ContextHandle(IntPtr p)
|
||||
{
|
||||
return new ContextHandle(p);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static bool operator ==(ContextHandle left, ContextHandle right)
|
||||
|
||||
/// <summary>
|
||||
/// Compares two ContextHandles for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The ContextHandle to compare.</param>
|
||||
/// <param name="right">The ContextHandle to compare to.</param>
|
||||
/// <returns>True if left is equal to right; false otherwise.</returns>
|
||||
public static bool operator ==(ContextHandle left, ContextHandle right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static bool operator !=(ContextHandle left, ContextHandle right)
|
||||
|
||||
/// <summary>
|
||||
/// Compares two ContextHandles for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The ContextHandle to compare.</param>
|
||||
/// <param name="right">The ContextHandle to compare to.</param>
|
||||
/// <returns>True if left is not equal to right; false otherwise.</returns>
|
||||
public static bool operator !=(ContextHandle left, ContextHandle right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region IComparable<ContextHandle> Members
|
||||
|
||||
/// <summary>
|
||||
/// Compares the numerical value of this instance to the specified ContextHandle and
|
||||
/// returns a value indicating their relative order.
|
||||
/// </summary>
|
||||
/// <param name="other">The ContextHandle to compare to.</param>
|
||||
/// <returns>Less than 0, if this instance is less than other; 0 if both are equal; Greater than 0 if other is greater than this instance.</returns>
|
||||
public int CompareTo(ContextHandle other)
|
||||
{
|
||||
unsafe { return (int)((int*)other.handle.ToPointer() - (int*)this.handle.ToPointer()); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEquatable<ContextHandle> Members
|
||||
|
||||
/// <summary>
|
||||
/// Compares this instance to the specified ContextHandle for equality.
|
||||
/// </summary>
|
||||
/// <param name="other">The ContextHandle to compare to.</param>
|
||||
/// <returns>True if this instance is equal to other; false otherwise.</returns>
|
||||
public bool Equals(ContextHandle other)
|
||||
{
|
||||
return Handle == other.Handle;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,935 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2008 the Open Toolkit library, except where noted.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !MINIMAL
|
||||
using System.Drawing;
|
||||
#endif
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace OpenTK.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a color with 4 floating-point components (R, G, B, A).
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct Color4 : IEquatable<Color4>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// The red component of this Color4 structure.
|
||||
/// </summary>
|
||||
public float R;
|
||||
|
||||
/// <summary>
|
||||
/// The green component of this Color4 structure.
|
||||
/// </summary>
|
||||
public float G;
|
||||
|
||||
/// <summary>
|
||||
/// The blue component of this Color4 structure.
|
||||
/// </summary>
|
||||
public float B;
|
||||
|
||||
/// <summary>
|
||||
/// The alpha component of this Color4 structure.
|
||||
/// </summary>
|
||||
public float A;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Color4 structure from the specified components.
|
||||
/// </summary>
|
||||
/// <param name="r">The red component of the new Color4 structure.</param>
|
||||
/// <param name="g">The green component of the new Color4 structure.</param>
|
||||
/// <param name="b">The blue component of the new Color4 structure.</param>
|
||||
/// <param name="a">The alpha component of the new Color4 structure.</param>
|
||||
public Color4(float r, float g, float b, float a)
|
||||
{
|
||||
R = r;
|
||||
G = g;
|
||||
B = b;
|
||||
A = a;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Color4 structure from the specified components.
|
||||
/// </summary>
|
||||
/// <param name="r">The red component of the new Color4 structure.</param>
|
||||
/// <param name="g">The green component of the new Color4 structure.</param>
|
||||
/// <param name="b">The blue component of the new Color4 structure.</param>
|
||||
/// <param name="a">The alpha component of the new Color4 structure.</param>
|
||||
public Color4(byte r, byte g, byte b, byte a)
|
||||
{
|
||||
R = r / (float)Byte.MaxValue;
|
||||
G = g / (float)Byte.MaxValue;
|
||||
B = b / (float)Byte.MaxValue;
|
||||
A = a / (float)Byte.MaxValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Color4 structure from the specified System.Drawing.Color.
|
||||
/// </summary>
|
||||
/// <param name="color">The System.Drawing.Color containing the component values.</param>
|
||||
[Obsolete("Use new Color4(r, g, b, a) instead.")]
|
||||
public Color4(Color color)
|
||||
: this(color.R, color.G, color.B, color.A)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
/// <summary>
|
||||
/// Converts this color to an integer representation with 8 bits per channel.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.Int32"/> that represents this instance.</returns>
|
||||
/// <remarks>This method is intended only for compatibility with System.Drawing. It compresses the color into 8 bits per channel, which means color information is lost.</remarks>
|
||||
public int ToArgb()
|
||||
{
|
||||
uint value =
|
||||
(uint)(A * Byte.MaxValue) << 24 |
|
||||
(uint)(R * Byte.MaxValue) << 16 |
|
||||
(uint)(G * Byte.MaxValue) << 8 |
|
||||
(uint)(B * Byte.MaxValue);
|
||||
|
||||
return unchecked((int)value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified Color4 structures for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The left-hand side of the comparison.</param>
|
||||
/// <param name="right">The right-hand side of the comparison.</param>
|
||||
/// <returns>True if left is equal to right; false otherwise.</returns>
|
||||
public static bool operator ==(Color4 left, Color4 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified Color4 structures for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The left-hand side of the comparison.</param>
|
||||
/// <param name="right">The right-hand side of the comparison.</param>
|
||||
/// <returns>True if left is not equal to right; false otherwise.</returns>
|
||||
public static bool operator !=(Color4 left, Color4 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the specified System.Drawing.Color to a Color4 structure.
|
||||
/// </summary>
|
||||
/// <param name="color">The System.Drawing.Color to convert.</param>
|
||||
/// <returns>A new Color4 structure containing the converted components.</returns>
|
||||
public static implicit operator Color4(Color color)
|
||||
{
|
||||
return new Color4(color.R, color.G, color.B, color.A);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the specified Color4 to a System.Drawing.Color structure.
|
||||
/// </summary>
|
||||
/// <param name="color">The Color4 to convert.</param>
|
||||
/// <returns>A new System.Drawing.Color structure containing the converted components.</returns>
|
||||
public static explicit operator Color(Color4 color)
|
||||
{
|
||||
return Color.FromArgb(
|
||||
(int)(color.A * Byte.MaxValue),
|
||||
(int)(color.R * Byte.MaxValue),
|
||||
(int)(color.G * Byte.MaxValue),
|
||||
(int)(color.B * Byte.MaxValue));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares whether this Color4 structure is equal to the specified object.
|
||||
/// </summary>
|
||||
/// <param name="obj">An object to compare to.</param>
|
||||
/// <returns>True obj is a Color4 structure with the same components as this Color4; false otherwise.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is Color4))
|
||||
return false;
|
||||
|
||||
return Equals((Color4)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the hash code for this Color4 structure.
|
||||
/// </summary>
|
||||
/// <returns>A System.Int32 containing the hashcode of this Color4 structure.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ToArgb();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a System.String that describes this Color4 structure.
|
||||
/// </summary>
|
||||
/// <returns>A System.String that describes this Color4 structure.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{{(R, G, B, A) = ({0}, {1}, {2}, {3})}}", R.ToString(), G.ToString(), B.ToString(), A.ToString());
|
||||
}
|
||||
|
||||
#region System colors
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 255, 255, 0).
|
||||
/// </summary>
|
||||
public static Color4 Transparent { get { return new Color4(255, 255, 255, 0); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (240, 248, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 AliceBlue { get { return new Color4(240, 248, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (250, 235, 215, 255).
|
||||
/// </summary>
|
||||
public static Color4 AntiqueWhite { get { return new Color4(250, 235, 215, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 255, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 Aqua { get { return new Color4(0, 255, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (127, 255, 212, 255).
|
||||
/// </summary>
|
||||
public static Color4 Aquamarine { get { return new Color4(127, 255, 212, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (240, 255, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 Azure { get { return new Color4(240, 255, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (245, 245, 220, 255).
|
||||
/// </summary>
|
||||
public static Color4 Beige { get { return new Color4(245, 245, 220, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 228, 196, 255).
|
||||
/// </summary>
|
||||
public static Color4 Bisque { get { return new Color4(255, 228, 196, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 0, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Black { get { return new Color4(0, 0, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 235, 205, 255).
|
||||
/// </summary>
|
||||
public static Color4 BlanchedAlmond { get { return new Color4(255, 235, 205, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 0, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 Blue { get { return new Color4(0, 0, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (138, 43, 226, 255).
|
||||
/// </summary>
|
||||
public static Color4 BlueViolet { get { return new Color4(138, 43, 226, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (165, 42, 42, 255).
|
||||
/// </summary>
|
||||
public static Color4 Brown { get { return new Color4(165, 42, 42, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (222, 184, 135, 255).
|
||||
/// </summary>
|
||||
public static Color4 BurlyWood { get { return new Color4(222, 184, 135, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (95, 158, 160, 255).
|
||||
/// </summary>
|
||||
public static Color4 CadetBlue { get { return new Color4(95, 158, 160, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (127, 255, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Chartreuse { get { return new Color4(127, 255, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (210, 105, 30, 255).
|
||||
/// </summary>
|
||||
public static Color4 Chocolate { get { return new Color4(210, 105, 30, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 127, 80, 255).
|
||||
/// </summary>
|
||||
public static Color4 Coral { get { return new Color4(255, 127, 80, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (100, 149, 237, 255).
|
||||
/// </summary>
|
||||
public static Color4 CornflowerBlue { get { return new Color4(100, 149, 237, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 248, 220, 255).
|
||||
/// </summary>
|
||||
public static Color4 Cornsilk { get { return new Color4(255, 248, 220, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (220, 20, 60, 255).
|
||||
/// </summary>
|
||||
public static Color4 Crimson { get { return new Color4(220, 20, 60, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 255, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 Cyan { get { return new Color4(0, 255, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 0, 139, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkBlue { get { return new Color4(0, 0, 139, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 139, 139, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkCyan { get { return new Color4(0, 139, 139, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (184, 134, 11, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkGoldenrod { get { return new Color4(184, 134, 11, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (169, 169, 169, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkGray { get { return new Color4(169, 169, 169, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 100, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkGreen { get { return new Color4(0, 100, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (189, 183, 107, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkKhaki { get { return new Color4(189, 183, 107, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (139, 0, 139, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkMagenta { get { return new Color4(139, 0, 139, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (85, 107, 47, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkOliveGreen { get { return new Color4(85, 107, 47, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 140, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkOrange { get { return new Color4(255, 140, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (153, 50, 204, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkOrchid { get { return new Color4(153, 50, 204, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (139, 0, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkRed { get { return new Color4(139, 0, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (233, 150, 122, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkSalmon { get { return new Color4(233, 150, 122, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (143, 188, 139, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkSeaGreen { get { return new Color4(143, 188, 139, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (72, 61, 139, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkSlateBlue { get { return new Color4(72, 61, 139, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (47, 79, 79, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkSlateGray { get { return new Color4(47, 79, 79, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 206, 209, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkTurquoise { get { return new Color4(0, 206, 209, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (148, 0, 211, 255).
|
||||
/// </summary>
|
||||
public static Color4 DarkViolet { get { return new Color4(148, 0, 211, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 20, 147, 255).
|
||||
/// </summary>
|
||||
public static Color4 DeepPink { get { return new Color4(255, 20, 147, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 191, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 DeepSkyBlue { get { return new Color4(0, 191, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (105, 105, 105, 255).
|
||||
/// </summary>
|
||||
public static Color4 DimGray { get { return new Color4(105, 105, 105, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (30, 144, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 DodgerBlue { get { return new Color4(30, 144, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (178, 34, 34, 255).
|
||||
/// </summary>
|
||||
public static Color4 Firebrick { get { return new Color4(178, 34, 34, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 250, 240, 255).
|
||||
/// </summary>
|
||||
public static Color4 FloralWhite { get { return new Color4(255, 250, 240, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (34, 139, 34, 255).
|
||||
/// </summary>
|
||||
public static Color4 ForestGreen { get { return new Color4(34, 139, 34, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 0, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 Fuchsia { get { return new Color4(255, 0, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (220, 220, 220, 255).
|
||||
/// </summary>
|
||||
public static Color4 Gainsboro { get { return new Color4(220, 220, 220, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (248, 248, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 GhostWhite { get { return new Color4(248, 248, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 215, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Gold { get { return new Color4(255, 215, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (218, 165, 32, 255).
|
||||
/// </summary>
|
||||
public static Color4 Goldenrod { get { return new Color4(218, 165, 32, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (128, 128, 128, 255).
|
||||
/// </summary>
|
||||
public static Color4 Gray { get { return new Color4(128, 128, 128, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 128, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Green { get { return new Color4(0, 128, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (173, 255, 47, 255).
|
||||
/// </summary>
|
||||
public static Color4 GreenYellow { get { return new Color4(173, 255, 47, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (240, 255, 240, 255).
|
||||
/// </summary>
|
||||
public static Color4 Honeydew { get { return new Color4(240, 255, 240, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 105, 180, 255).
|
||||
/// </summary>
|
||||
public static Color4 HotPink { get { return new Color4(255, 105, 180, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (205, 92, 92, 255).
|
||||
/// </summary>
|
||||
public static Color4 IndianRed { get { return new Color4(205, 92, 92, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (75, 0, 130, 255).
|
||||
/// </summary>
|
||||
public static Color4 Indigo { get { return new Color4(75, 0, 130, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 255, 240, 255).
|
||||
/// </summary>
|
||||
public static Color4 Ivory { get { return new Color4(255, 255, 240, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (240, 230, 140, 255).
|
||||
/// </summary>
|
||||
public static Color4 Khaki { get { return new Color4(240, 230, 140, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (230, 230, 250, 255).
|
||||
/// </summary>
|
||||
public static Color4 Lavender { get { return new Color4(230, 230, 250, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 240, 245, 255).
|
||||
/// </summary>
|
||||
public static Color4 LavenderBlush { get { return new Color4(255, 240, 245, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (124, 252, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 LawnGreen { get { return new Color4(124, 252, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 250, 205, 255).
|
||||
/// </summary>
|
||||
public static Color4 LemonChiffon { get { return new Color4(255, 250, 205, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (173, 216, 230, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightBlue { get { return new Color4(173, 216, 230, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (240, 128, 128, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightCoral { get { return new Color4(240, 128, 128, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (224, 255, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightCyan { get { return new Color4(224, 255, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (250, 250, 210, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightGoldenrodYellow { get { return new Color4(250, 250, 210, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (144, 238, 144, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightGreen { get { return new Color4(144, 238, 144, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (211, 211, 211, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightGray { get { return new Color4(211, 211, 211, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 182, 193, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightPink { get { return new Color4(255, 182, 193, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 160, 122, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightSalmon { get { return new Color4(255, 160, 122, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (32, 178, 170, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightSeaGreen { get { return new Color4(32, 178, 170, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (135, 206, 250, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightSkyBlue { get { return new Color4(135, 206, 250, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (119, 136, 153, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightSlateGray { get { return new Color4(119, 136, 153, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (176, 196, 222, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightSteelBlue { get { return new Color4(176, 196, 222, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 255, 224, 255).
|
||||
/// </summary>
|
||||
public static Color4 LightYellow { get { return new Color4(255, 255, 224, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 255, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Lime { get { return new Color4(0, 255, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (50, 205, 50, 255).
|
||||
/// </summary>
|
||||
public static Color4 LimeGreen { get { return new Color4(50, 205, 50, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (250, 240, 230, 255).
|
||||
/// </summary>
|
||||
public static Color4 Linen { get { return new Color4(250, 240, 230, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 0, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 Magenta { get { return new Color4(255, 0, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (128, 0, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Maroon { get { return new Color4(128, 0, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (102, 205, 170, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumAquamarine { get { return new Color4(102, 205, 170, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 0, 205, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumBlue { get { return new Color4(0, 0, 205, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (186, 85, 211, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumOrchid { get { return new Color4(186, 85, 211, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (147, 112, 219, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumPurple { get { return new Color4(147, 112, 219, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (60, 179, 113, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumSeaGreen { get { return new Color4(60, 179, 113, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (123, 104, 238, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumSlateBlue { get { return new Color4(123, 104, 238, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 250, 154, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumSpringGreen { get { return new Color4(0, 250, 154, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (72, 209, 204, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumTurquoise { get { return new Color4(72, 209, 204, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (199, 21, 133, 255).
|
||||
/// </summary>
|
||||
public static Color4 MediumVioletRed { get { return new Color4(199, 21, 133, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (25, 25, 112, 255).
|
||||
/// </summary>
|
||||
public static Color4 MidnightBlue { get { return new Color4(25, 25, 112, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (245, 255, 250, 255).
|
||||
/// </summary>
|
||||
public static Color4 MintCream { get { return new Color4(245, 255, 250, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 228, 225, 255).
|
||||
/// </summary>
|
||||
public static Color4 MistyRose { get { return new Color4(255, 228, 225, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 228, 181, 255).
|
||||
/// </summary>
|
||||
public static Color4 Moccasin { get { return new Color4(255, 228, 181, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 222, 173, 255).
|
||||
/// </summary>
|
||||
public static Color4 NavajoWhite { get { return new Color4(255, 222, 173, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 0, 128, 255).
|
||||
/// </summary>
|
||||
public static Color4 Navy { get { return new Color4(0, 0, 128, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (253, 245, 230, 255).
|
||||
/// </summary>
|
||||
public static Color4 OldLace { get { return new Color4(253, 245, 230, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (128, 128, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Olive { get { return new Color4(128, 128, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (107, 142, 35, 255).
|
||||
/// </summary>
|
||||
public static Color4 OliveDrab { get { return new Color4(107, 142, 35, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 165, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Orange { get { return new Color4(255, 165, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 69, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 OrangeRed { get { return new Color4(255, 69, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (218, 112, 214, 255).
|
||||
/// </summary>
|
||||
public static Color4 Orchid { get { return new Color4(218, 112, 214, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (238, 232, 170, 255).
|
||||
/// </summary>
|
||||
public static Color4 PaleGoldenrod { get { return new Color4(238, 232, 170, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (152, 251, 152, 255).
|
||||
/// </summary>
|
||||
public static Color4 PaleGreen { get { return new Color4(152, 251, 152, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (175, 238, 238, 255).
|
||||
/// </summary>
|
||||
public static Color4 PaleTurquoise { get { return new Color4(175, 238, 238, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (219, 112, 147, 255).
|
||||
/// </summary>
|
||||
public static Color4 PaleVioletRed { get { return new Color4(219, 112, 147, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 239, 213, 255).
|
||||
/// </summary>
|
||||
public static Color4 PapayaWhip { get { return new Color4(255, 239, 213, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 218, 185, 255).
|
||||
/// </summary>
|
||||
public static Color4 PeachPuff { get { return new Color4(255, 218, 185, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (205, 133, 63, 255).
|
||||
/// </summary>
|
||||
public static Color4 Peru { get { return new Color4(205, 133, 63, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 192, 203, 255).
|
||||
/// </summary>
|
||||
public static Color4 Pink { get { return new Color4(255, 192, 203, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (221, 160, 221, 255).
|
||||
/// </summary>
|
||||
public static Color4 Plum { get { return new Color4(221, 160, 221, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (176, 224, 230, 255).
|
||||
/// </summary>
|
||||
public static Color4 PowderBlue { get { return new Color4(176, 224, 230, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (128, 0, 128, 255).
|
||||
/// </summary>
|
||||
public static Color4 Purple { get { return new Color4(128, 0, 128, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 0, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Red { get { return new Color4(255, 0, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (188, 143, 143, 255).
|
||||
/// </summary>
|
||||
public static Color4 RosyBrown { get { return new Color4(188, 143, 143, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (65, 105, 225, 255).
|
||||
/// </summary>
|
||||
public static Color4 RoyalBlue { get { return new Color4(65, 105, 225, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (139, 69, 19, 255).
|
||||
/// </summary>
|
||||
public static Color4 SaddleBrown { get { return new Color4(139, 69, 19, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (250, 128, 114, 255).
|
||||
/// </summary>
|
||||
public static Color4 Salmon { get { return new Color4(250, 128, 114, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (244, 164, 96, 255).
|
||||
/// </summary>
|
||||
public static Color4 SandyBrown { get { return new Color4(244, 164, 96, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (46, 139, 87, 255).
|
||||
/// </summary>
|
||||
public static Color4 SeaGreen { get { return new Color4(46, 139, 87, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 245, 238, 255).
|
||||
/// </summary>
|
||||
public static Color4 SeaShell { get { return new Color4(255, 245, 238, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (160, 82, 45, 255).
|
||||
/// </summary>
|
||||
public static Color4 Sienna { get { return new Color4(160, 82, 45, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (192, 192, 192, 255).
|
||||
/// </summary>
|
||||
public static Color4 Silver { get { return new Color4(192, 192, 192, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (135, 206, 235, 255).
|
||||
/// </summary>
|
||||
public static Color4 SkyBlue { get { return new Color4(135, 206, 235, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (106, 90, 205, 255).
|
||||
/// </summary>
|
||||
public static Color4 SlateBlue { get { return new Color4(106, 90, 205, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (112, 128, 144, 255).
|
||||
/// </summary>
|
||||
public static Color4 SlateGray { get { return new Color4(112, 128, 144, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 250, 250, 255).
|
||||
/// </summary>
|
||||
public static Color4 Snow { get { return new Color4(255, 250, 250, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 255, 127, 255).
|
||||
/// </summary>
|
||||
public static Color4 SpringGreen { get { return new Color4(0, 255, 127, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (70, 130, 180, 255).
|
||||
/// </summary>
|
||||
public static Color4 SteelBlue { get { return new Color4(70, 130, 180, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (210, 180, 140, 255).
|
||||
/// </summary>
|
||||
public static Color4 Tan { get { return new Color4(210, 180, 140, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (0, 128, 128, 255).
|
||||
/// </summary>
|
||||
public static Color4 Teal { get { return new Color4(0, 128, 128, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (216, 191, 216, 255).
|
||||
/// </summary>
|
||||
public static Color4 Thistle { get { return new Color4(216, 191, 216, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 99, 71, 255).
|
||||
/// </summary>
|
||||
public static Color4 Tomato { get { return new Color4(255, 99, 71, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (64, 224, 208, 255).
|
||||
/// </summary>
|
||||
public static Color4 Turquoise { get { return new Color4(64, 224, 208, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (238, 130, 238, 255).
|
||||
/// </summary>
|
||||
public static Color4 Violet { get { return new Color4(238, 130, 238, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (245, 222, 179, 255).
|
||||
/// </summary>
|
||||
public static Color4 Wheat { get { return new Color4(245, 222, 179, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 255, 255, 255).
|
||||
/// </summary>
|
||||
public static Color4 White { get { return new Color4(255, 255, 255, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (245, 245, 245, 255).
|
||||
/// </summary>
|
||||
public static Color4 WhiteSmoke { get { return new Color4(245, 245, 245, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (255, 255, 0, 255).
|
||||
/// </summary>
|
||||
public static Color4 Yellow { get { return new Color4(255, 255, 0, 255); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system color with (R, G, B, A) = (154, 205, 50, 255).
|
||||
/// </summary>
|
||||
public static Color4 YellowGreen { get { return new Color4(154, 205, 50, 255); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEquatable<Color4> Members
|
||||
|
||||
/// <summary>
|
||||
/// Compares whether this Color4 structure is equal to the specified Color4.
|
||||
/// </summary>
|
||||
/// <param name="other">The Color4 structure to compare to.</param>
|
||||
/// <returns>True if both Color4 structures contain the same components; false otherwise.</returns>
|
||||
public bool Equals(Color4 other)
|
||||
{
|
||||
return
|
||||
this.R == other.R &&
|
||||
this.G == other.G &&
|
||||
this.B == other.B &&
|
||||
this.A == other.A;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,362 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
namespace OpenTK.Graphics.ES10
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
|
||||
partial class GL
|
||||
{
|
||||
|
||||
internal static partial class Core
|
||||
{
|
||||
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glActiveTexture", ExactSpelling = true)]
|
||||
internal extern static void ActiveTexture(OpenTK.Graphics.ES10.All texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glAlphaFunc", ExactSpelling = true)]
|
||||
internal extern static void AlphaFunc(OpenTK.Graphics.ES10.All func, Single @ref);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glAlphaFuncx", ExactSpelling = true)]
|
||||
internal extern static void AlphaFuncx(OpenTK.Graphics.ES10.All func, int @ref);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindTexture", ExactSpelling = true)]
|
||||
internal extern static void BindTexture(OpenTK.Graphics.ES10.All target, UInt32 texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendFunc", ExactSpelling = true)]
|
||||
internal extern static void BlendFunc(OpenTK.Graphics.ES10.All sfactor, OpenTK.Graphics.ES10.All dfactor);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClear", ExactSpelling = true)]
|
||||
internal extern static void Clear(UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearColor", ExactSpelling = true)]
|
||||
internal extern static void ClearColor(Single red, Single green, Single blue, Single alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearColorx", ExactSpelling = true)]
|
||||
internal extern static void ClearColorx(int red, int green, int blue, int alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthf", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthf(Single depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthx", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthx(int depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearStencil", ExactSpelling = true)]
|
||||
internal extern static void ClearStencil(Int32 s);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClientActiveTexture", ExactSpelling = true)]
|
||||
internal extern static void ClientActiveTexture(OpenTK.Graphics.ES10.All texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColor4f", ExactSpelling = true)]
|
||||
internal extern static void Color4f(Single red, Single green, Single blue, Single alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColor4x", ExactSpelling = true)]
|
||||
internal extern static void Color4x(int red, int green, int blue, int alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColorMask", ExactSpelling = true)]
|
||||
internal extern static void ColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColorPointer", ExactSpelling = true)]
|
||||
internal extern static void ColorPointer(Int32 size, OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexImage2D(OpenTK.Graphics.ES10.All target, Int32 level, OpenTK.Graphics.ES10.All internalformat, Int32 width, Int32 height, Int32 border, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexSubImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES10.All format, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void CopyTexImage2D(OpenTK.Graphics.ES10.All target, Int32 level, OpenTK.Graphics.ES10.All internalformat, Int32 x, Int32 y, Int32 width, Int32 height, Int32 border);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void CopyTexSubImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCullFace", ExactSpelling = true)]
|
||||
internal extern static void CullFace(OpenTK.Graphics.ES10.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteTextures", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteTextures(Int32 n, UInt32* textures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthFunc", ExactSpelling = true)]
|
||||
internal extern static void DepthFunc(OpenTK.Graphics.ES10.All func);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthMask", ExactSpelling = true)]
|
||||
internal extern static void DepthMask(bool flag);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangef", ExactSpelling = true)]
|
||||
internal extern static void DepthRangef(Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangex", ExactSpelling = true)]
|
||||
internal extern static void DepthRangex(int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisable", ExactSpelling = true)]
|
||||
internal extern static void Disable(OpenTK.Graphics.ES10.All cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisableClientState", ExactSpelling = true)]
|
||||
internal extern static void DisableClientState(OpenTK.Graphics.ES10.All array);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawArrays", ExactSpelling = true)]
|
||||
internal extern static void DrawArrays(OpenTK.Graphics.ES10.All mode, Int32 first, Int32 count);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawElements", ExactSpelling = true)]
|
||||
internal extern static void DrawElements(OpenTK.Graphics.ES10.All mode, Int32 count, OpenTK.Graphics.ES10.All type, IntPtr indices);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnable", ExactSpelling = true)]
|
||||
internal extern static void Enable(OpenTK.Graphics.ES10.All cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnableClientState", ExactSpelling = true)]
|
||||
internal extern static void EnableClientState(OpenTK.Graphics.ES10.All array);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFinish", ExactSpelling = true)]
|
||||
internal extern static void Finish();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFlush", ExactSpelling = true)]
|
||||
internal extern static void Flush();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogf", ExactSpelling = true)]
|
||||
internal extern static void Fogf(OpenTK.Graphics.ES10.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Fogfv(OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogx", ExactSpelling = true)]
|
||||
internal extern static void Fogx(OpenTK.Graphics.ES10.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Fogxv(OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrontFace", ExactSpelling = true)]
|
||||
internal extern static void FrontFace(OpenTK.Graphics.ES10.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrustumf", ExactSpelling = true)]
|
||||
internal extern static void Frustumf(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrustumx", ExactSpelling = true)]
|
||||
internal extern static void Frustumx(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenTextures", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenTextures(Int32 n, UInt32* textures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetError", ExactSpelling = true)]
|
||||
internal extern static OpenTK.Graphics.ES10.All GetError();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetIntegerv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetIntegerv(OpenTK.Graphics.ES10.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetString", ExactSpelling = true)]
|
||||
internal extern static unsafe System.IntPtr GetString(OpenTK.Graphics.ES10.All name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glHint", ExactSpelling = true)]
|
||||
internal extern static void Hint(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightf", ExactSpelling = true)]
|
||||
internal extern static void Lightf(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Lightfv(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelf", ExactSpelling = true)]
|
||||
internal extern static void LightModelf(OpenTK.Graphics.ES10.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void LightModelfv(OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelx", ExactSpelling = true)]
|
||||
internal extern static void LightModelx(OpenTK.Graphics.ES10.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void LightModelxv(OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightx", ExactSpelling = true)]
|
||||
internal extern static void Lightx(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Lightxv(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLineWidth", ExactSpelling = true)]
|
||||
internal extern static void LineWidth(Single width);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLineWidthx", ExactSpelling = true)]
|
||||
internal extern static void LineWidthx(int width);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadIdentity", ExactSpelling = true)]
|
||||
internal extern static void LoadIdentity();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadMatrixf", ExactSpelling = true)]
|
||||
internal extern static unsafe void LoadMatrixf(Single* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadMatrixx", ExactSpelling = true)]
|
||||
internal extern static unsafe void LoadMatrixx(int* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLogicOp", ExactSpelling = true)]
|
||||
internal extern static void LogicOp(OpenTK.Graphics.ES10.All opcode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialf", ExactSpelling = true)]
|
||||
internal extern static void Materialf(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Materialfv(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialx", ExactSpelling = true)]
|
||||
internal extern static void Materialx(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Materialxv(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMatrixMode", ExactSpelling = true)]
|
||||
internal extern static void MatrixMode(OpenTK.Graphics.ES10.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiTexCoord4f", ExactSpelling = true)]
|
||||
internal extern static void MultiTexCoord4f(OpenTK.Graphics.ES10.All target, Single s, Single t, Single r, Single q);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiTexCoord4x", ExactSpelling = true)]
|
||||
internal extern static void MultiTexCoord4x(OpenTK.Graphics.ES10.All target, int s, int t, int r, int q);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultMatrixf", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultMatrixf(Single* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultMatrixx", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultMatrixx(int* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormal3f", ExactSpelling = true)]
|
||||
internal extern static void Normal3f(Single nx, Single ny, Single nz);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormal3x", ExactSpelling = true)]
|
||||
internal extern static void Normal3x(int nx, int ny, int nz);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormalPointer", ExactSpelling = true)]
|
||||
internal extern static void NormalPointer(OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glOrthof", ExactSpelling = true)]
|
||||
internal extern static void Orthof(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glOrthox", ExactSpelling = true)]
|
||||
internal extern static void Orthox(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPixelStorei", ExactSpelling = true)]
|
||||
internal extern static void PixelStorei(OpenTK.Graphics.ES10.All pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointSize", ExactSpelling = true)]
|
||||
internal extern static void PointSize(Single size);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointSizex", ExactSpelling = true)]
|
||||
internal extern static void PointSizex(int size);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPolygonOffset", ExactSpelling = true)]
|
||||
internal extern static void PolygonOffset(Single factor, Single units);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPolygonOffsetx", ExactSpelling = true)]
|
||||
internal extern static void PolygonOffsetx(int factor, int units);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPopMatrix", ExactSpelling = true)]
|
||||
internal extern static void PopMatrix();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPushMatrix", ExactSpelling = true)]
|
||||
internal extern static void PushMatrix();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glReadPixels", ExactSpelling = true)]
|
||||
internal extern static void ReadPixels(Int32 x, Int32 y, Int32 width, Int32 height, OpenTK.Graphics.ES10.All format, OpenTK.Graphics.ES10.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRotatef", ExactSpelling = true)]
|
||||
internal extern static void Rotatef(Single angle, Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRotatex", ExactSpelling = true)]
|
||||
internal extern static void Rotatex(int angle, int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSampleCoverage", ExactSpelling = true)]
|
||||
internal extern static void SampleCoverage(Single value, bool invert);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSampleCoveragex", ExactSpelling = true)]
|
||||
internal extern static void SampleCoveragex(int value, bool invert);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScalef", ExactSpelling = true)]
|
||||
internal extern static void Scalef(Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScalex", ExactSpelling = true)]
|
||||
internal extern static void Scalex(int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScissor", ExactSpelling = true)]
|
||||
internal extern static void Scissor(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glShadeModel", ExactSpelling = true)]
|
||||
internal extern static void ShadeModel(OpenTK.Graphics.ES10.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilFunc", ExactSpelling = true)]
|
||||
internal extern static void StencilFunc(OpenTK.Graphics.ES10.All func, Int32 @ref, UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilMask", ExactSpelling = true)]
|
||||
internal extern static void StencilMask(UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilOp", ExactSpelling = true)]
|
||||
internal extern static void StencilOp(OpenTK.Graphics.ES10.All fail, OpenTK.Graphics.ES10.All zfail, OpenTK.Graphics.ES10.All zpass);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexCoordPointer", ExactSpelling = true)]
|
||||
internal extern static void TexCoordPointer(Int32 size, OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvf", ExactSpelling = true)]
|
||||
internal extern static void TexEnvf(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexEnvfv(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvx", ExactSpelling = true)]
|
||||
internal extern static void TexEnvx(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexEnvxv(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void TexImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 internalformat, Int32 width, Int32 height, Int32 border, OpenTK.Graphics.ES10.All format, OpenTK.Graphics.ES10.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterf", ExactSpelling = true)]
|
||||
internal extern static void TexParameterf(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterx", ExactSpelling = true)]
|
||||
internal extern static void TexParameterx(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void TexSubImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES10.All format, OpenTK.Graphics.ES10.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTranslatef", ExactSpelling = true)]
|
||||
internal extern static void Translatef(Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTranslatex", ExactSpelling = true)]
|
||||
internal extern static void Translatex(int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexPointer", ExactSpelling = true)]
|
||||
internal extern static void VertexPointer(Int32 size, OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glViewport", ExactSpelling = true)]
|
||||
internal extern static void Viewport(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,361 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
namespace OpenTK.Graphics.ES10
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma warning disable 0649
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
|
||||
partial class GL
|
||||
{
|
||||
internal static partial class Delegates
|
||||
{
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ActiveTexture(OpenTK.Graphics.ES10.All texture);
|
||||
internal static ActiveTexture glActiveTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void AlphaFunc(OpenTK.Graphics.ES10.All func, Single @ref);
|
||||
internal static AlphaFunc glAlphaFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void AlphaFuncx(OpenTK.Graphics.ES10.All func, int @ref);
|
||||
internal static AlphaFuncx glAlphaFuncx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindTexture(OpenTK.Graphics.ES10.All target, UInt32 texture);
|
||||
internal static BindTexture glBindTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendFunc(OpenTK.Graphics.ES10.All sfactor, OpenTK.Graphics.ES10.All dfactor);
|
||||
internal static BlendFunc glBlendFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Clear(UInt32 mask);
|
||||
internal static Clear glClear;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearColor(Single red, Single green, Single blue, Single alpha);
|
||||
internal static ClearColor glClearColor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearColorx(int red, int green, int blue, int alpha);
|
||||
internal static ClearColorx glClearColorx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthf(Single depth);
|
||||
internal static ClearDepthf glClearDepthf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthx(int depth);
|
||||
internal static ClearDepthx glClearDepthx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearStencil(Int32 s);
|
||||
internal static ClearStencil glClearStencil;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClientActiveTexture(OpenTK.Graphics.ES10.All texture);
|
||||
internal static ClientActiveTexture glClientActiveTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Color4f(Single red, Single green, Single blue, Single alpha);
|
||||
internal static Color4f glColor4f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Color4x(int red, int green, int blue, int alpha);
|
||||
internal static Color4x glColor4x;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
internal static ColorMask glColorMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ColorPointer(Int32 size, OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
internal static ColorPointer glColorPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexImage2D(OpenTK.Graphics.ES10.All target, Int32 level, OpenTK.Graphics.ES10.All internalformat, Int32 width, Int32 height, Int32 border, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexImage2D glCompressedTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexSubImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES10.All format, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexSubImage2D glCompressedTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexImage2D(OpenTK.Graphics.ES10.All target, Int32 level, OpenTK.Graphics.ES10.All internalformat, Int32 x, Int32 y, Int32 width, Int32 height, Int32 border);
|
||||
internal static CopyTexImage2D glCopyTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexSubImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static CopyTexSubImage2D glCopyTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CullFace(OpenTK.Graphics.ES10.All mode);
|
||||
internal static CullFace glCullFace;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteTextures(Int32 n, UInt32* textures);
|
||||
internal unsafe static DeleteTextures glDeleteTextures;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthFunc(OpenTK.Graphics.ES10.All func);
|
||||
internal static DepthFunc glDepthFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthMask(bool flag);
|
||||
internal static DepthMask glDepthMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangef(Single zNear, Single zFar);
|
||||
internal static DepthRangef glDepthRangef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangex(int zNear, int zFar);
|
||||
internal static DepthRangex glDepthRangex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Disable(OpenTK.Graphics.ES10.All cap);
|
||||
internal static Disable glDisable;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DisableClientState(OpenTK.Graphics.ES10.All array);
|
||||
internal static DisableClientState glDisableClientState;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawArrays(OpenTK.Graphics.ES10.All mode, Int32 first, Int32 count);
|
||||
internal static DrawArrays glDrawArrays;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawElements(OpenTK.Graphics.ES10.All mode, Int32 count, OpenTK.Graphics.ES10.All type, IntPtr indices);
|
||||
internal static DrawElements glDrawElements;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Enable(OpenTK.Graphics.ES10.All cap);
|
||||
internal static Enable glEnable;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EnableClientState(OpenTK.Graphics.ES10.All array);
|
||||
internal static EnableClientState glEnableClientState;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Finish();
|
||||
internal static Finish glFinish;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Flush();
|
||||
internal static Flush glFlush;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Fogf(OpenTK.Graphics.ES10.All pname, Single param);
|
||||
internal static Fogf glFogf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Fogfv(OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
internal unsafe static Fogfv glFogfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Fogx(OpenTK.Graphics.ES10.All pname, int param);
|
||||
internal static Fogx glFogx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Fogxv(OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
internal unsafe static Fogxv glFogxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FrontFace(OpenTK.Graphics.ES10.All mode);
|
||||
internal static FrontFace glFrontFace;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Frustumf(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
internal static Frustumf glFrustumf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Frustumx(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
internal static Frustumx glFrustumx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenTextures(Int32 n, UInt32* textures);
|
||||
internal unsafe static GenTextures glGenTextures;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate OpenTK.Graphics.ES10.All GetError();
|
||||
internal static GetError glGetError;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetIntegerv(OpenTK.Graphics.ES10.All pname, Int32* @params);
|
||||
internal unsafe static GetIntegerv glGetIntegerv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate System.IntPtr GetString(OpenTK.Graphics.ES10.All name);
|
||||
internal unsafe static GetString glGetString;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Hint(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All mode);
|
||||
internal static Hint glHint;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Lightf(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
internal static Lightf glLightf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Lightfv(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
internal unsafe static Lightfv glLightfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LightModelf(OpenTK.Graphics.ES10.All pname, Single param);
|
||||
internal static LightModelf glLightModelf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LightModelfv(OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
internal unsafe static LightModelfv glLightModelfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LightModelx(OpenTK.Graphics.ES10.All pname, int param);
|
||||
internal static LightModelx glLightModelx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LightModelxv(OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
internal unsafe static LightModelxv glLightModelxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Lightx(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, int param);
|
||||
internal static Lightx glLightx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Lightxv(OpenTK.Graphics.ES10.All light, OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
internal unsafe static Lightxv glLightxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LineWidth(Single width);
|
||||
internal static LineWidth glLineWidth;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LineWidthx(int width);
|
||||
internal static LineWidthx glLineWidthx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LoadIdentity();
|
||||
internal static LoadIdentity glLoadIdentity;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LoadMatrixf(Single* m);
|
||||
internal unsafe static LoadMatrixf glLoadMatrixf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LoadMatrixx(int* m);
|
||||
internal unsafe static LoadMatrixx glLoadMatrixx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LogicOp(OpenTK.Graphics.ES10.All opcode);
|
||||
internal static LogicOp glLogicOp;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Materialf(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
internal static Materialf glMaterialf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Materialfv(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
internal unsafe static Materialfv glMaterialfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Materialx(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, int param);
|
||||
internal static Materialx glMaterialx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Materialxv(OpenTK.Graphics.ES10.All face, OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
internal unsafe static Materialxv glMaterialxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MatrixMode(OpenTK.Graphics.ES10.All mode);
|
||||
internal static MatrixMode glMatrixMode;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MultiTexCoord4f(OpenTK.Graphics.ES10.All target, Single s, Single t, Single r, Single q);
|
||||
internal static MultiTexCoord4f glMultiTexCoord4f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MultiTexCoord4x(OpenTK.Graphics.ES10.All target, int s, int t, int r, int q);
|
||||
internal static MultiTexCoord4x glMultiTexCoord4x;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultMatrixf(Single* m);
|
||||
internal unsafe static MultMatrixf glMultMatrixf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultMatrixx(int* m);
|
||||
internal unsafe static MultMatrixx glMultMatrixx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Normal3f(Single nx, Single ny, Single nz);
|
||||
internal static Normal3f glNormal3f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Normal3x(int nx, int ny, int nz);
|
||||
internal static Normal3x glNormal3x;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void NormalPointer(OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
internal static NormalPointer glNormalPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Orthof(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
internal static Orthof glOrthof;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Orthox(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
internal static Orthox glOrthox;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PixelStorei(OpenTK.Graphics.ES10.All pname, Int32 param);
|
||||
internal static PixelStorei glPixelStorei;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointSize(Single size);
|
||||
internal static PointSize glPointSize;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointSizex(int size);
|
||||
internal static PointSizex glPointSizex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PolygonOffset(Single factor, Single units);
|
||||
internal static PolygonOffset glPolygonOffset;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PolygonOffsetx(int factor, int units);
|
||||
internal static PolygonOffsetx glPolygonOffsetx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PopMatrix();
|
||||
internal static PopMatrix glPopMatrix;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PushMatrix();
|
||||
internal static PushMatrix glPushMatrix;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ReadPixels(Int32 x, Int32 y, Int32 width, Int32 height, OpenTK.Graphics.ES10.All format, OpenTK.Graphics.ES10.All type, IntPtr pixels);
|
||||
internal static ReadPixels glReadPixels;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Rotatef(Single angle, Single x, Single y, Single z);
|
||||
internal static Rotatef glRotatef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Rotatex(int angle, int x, int y, int z);
|
||||
internal static Rotatex glRotatex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SampleCoverage(Single value, bool invert);
|
||||
internal static SampleCoverage glSampleCoverage;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SampleCoveragex(int value, bool invert);
|
||||
internal static SampleCoveragex glSampleCoveragex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scalef(Single x, Single y, Single z);
|
||||
internal static Scalef glScalef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scalex(int x, int y, int z);
|
||||
internal static Scalex glScalex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scissor(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static Scissor glScissor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ShadeModel(OpenTK.Graphics.ES10.All mode);
|
||||
internal static ShadeModel glShadeModel;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilFunc(OpenTK.Graphics.ES10.All func, Int32 @ref, UInt32 mask);
|
||||
internal static StencilFunc glStencilFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilMask(UInt32 mask);
|
||||
internal static StencilMask glStencilMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilOp(OpenTK.Graphics.ES10.All fail, OpenTK.Graphics.ES10.All zfail, OpenTK.Graphics.ES10.All zpass);
|
||||
internal static StencilOp glStencilOp;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexCoordPointer(Int32 size, OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
internal static TexCoordPointer glTexCoordPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexEnvf(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
internal static TexEnvf glTexEnvf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexEnvfv(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, Single* @params);
|
||||
internal unsafe static TexEnvfv glTexEnvfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexEnvx(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, int param);
|
||||
internal static TexEnvx glTexEnvx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexEnvxv(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, int* @params);
|
||||
internal unsafe static TexEnvxv glTexEnvxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 internalformat, Int32 width, Int32 height, Int32 border, OpenTK.Graphics.ES10.All format, OpenTK.Graphics.ES10.All type, IntPtr pixels);
|
||||
internal static TexImage2D glTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameterf(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, Single param);
|
||||
internal static TexParameterf glTexParameterf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameterx(OpenTK.Graphics.ES10.All target, OpenTK.Graphics.ES10.All pname, int param);
|
||||
internal static TexParameterx glTexParameterx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexSubImage2D(OpenTK.Graphics.ES10.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES10.All format, OpenTK.Graphics.ES10.All type, IntPtr pixels);
|
||||
internal static TexSubImage2D glTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Translatef(Single x, Single y, Single z);
|
||||
internal static Translatef glTranslatef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Translatex(int x, int y, int z);
|
||||
internal static Translatex glTranslatex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexPointer(Int32 size, OpenTK.Graphics.ES10.All type, Int32 stride, IntPtr pointer);
|
||||
internal static VertexPointer glVertexPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Viewport(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static Viewport glViewport;
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,667 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenTK.Graphics.ES10
|
||||
{
|
||||
#pragma warning disable 1591
|
||||
|
||||
public enum All : int
|
||||
{
|
||||
False = ((int)0),
|
||||
NoError = ((int)0),
|
||||
Zero = ((int)0),
|
||||
Points = ((int)0x0000),
|
||||
DepthBufferBit = ((int)0x00000100),
|
||||
StencilBufferBit = ((int)0x00000400),
|
||||
ColorBufferBit = ((int)0x00004000),
|
||||
Lines = ((int)0x0001),
|
||||
LineLoop = ((int)0x0002),
|
||||
LineStrip = ((int)0x0003),
|
||||
Triangles = ((int)0x0004),
|
||||
TriangleStrip = ((int)0x0005),
|
||||
TriangleFan = ((int)0x0006),
|
||||
Add = ((int)0x0104),
|
||||
Never = ((int)0x0200),
|
||||
Less = ((int)0x0201),
|
||||
Equal = ((int)0x0202),
|
||||
Lequal = ((int)0x0203),
|
||||
Greater = ((int)0x0204),
|
||||
Notequal = ((int)0x0205),
|
||||
Gequal = ((int)0x0206),
|
||||
Always = ((int)0x0207),
|
||||
SrcColor = ((int)0x0300),
|
||||
OneMinusSrcColor = ((int)0x0301),
|
||||
SrcAlpha = ((int)0x0302),
|
||||
OneMinusSrcAlpha = ((int)0x0303),
|
||||
DstAlpha = ((int)0x0304),
|
||||
OneMinusDstAlpha = ((int)0x0305),
|
||||
DstColor = ((int)0x0306),
|
||||
OneMinusDstColor = ((int)0x0307),
|
||||
SrcAlphaSaturate = ((int)0x0308),
|
||||
Front = ((int)0x0404),
|
||||
Back = ((int)0x0405),
|
||||
FrontAndBack = ((int)0x0408),
|
||||
InvalidEnum = ((int)0x0500),
|
||||
InvalidValue = ((int)0x0501),
|
||||
InvalidOperation = ((int)0x0502),
|
||||
StackOverflow = ((int)0x0503),
|
||||
StackUnderflow = ((int)0x0504),
|
||||
OutOfMemory = ((int)0x0505),
|
||||
Exp = ((int)0x0800),
|
||||
Exp2 = ((int)0x0801),
|
||||
Cw = ((int)0x0900),
|
||||
Ccw = ((int)0x0901),
|
||||
PointSmooth = ((int)0x0B10),
|
||||
SmoothPointSizeRange = ((int)0x0B12),
|
||||
LineSmooth = ((int)0x0B20),
|
||||
SmoothLineWidthRange = ((int)0x0B22),
|
||||
CullFace = ((int)0x0B44),
|
||||
Lighting = ((int)0x0B50),
|
||||
LightModelTwoSide = ((int)0x0B52),
|
||||
LightModelAmbient = ((int)0x0B53),
|
||||
ColorMaterial = ((int)0x0B57),
|
||||
Fog = ((int)0x0B60),
|
||||
FogDensity = ((int)0x0B62),
|
||||
FogStart = ((int)0x0B63),
|
||||
FogEnd = ((int)0x0B64),
|
||||
FogMode = ((int)0x0B65),
|
||||
FogColor = ((int)0x0B66),
|
||||
DepthTest = ((int)0x0B71),
|
||||
StencilTest = ((int)0x0B90),
|
||||
Normalize = ((int)0x0BA1),
|
||||
AlphaTest = ((int)0x0BC0),
|
||||
Dither = ((int)0x0BD0),
|
||||
Blend = ((int)0x0BE2),
|
||||
ColorLogicOp = ((int)0x0BF2),
|
||||
ScissorTest = ((int)0x0C11),
|
||||
PerspectiveCorrectionHint = ((int)0x0C50),
|
||||
PointSmoothHint = ((int)0x0C51),
|
||||
LineSmoothHint = ((int)0x0C52),
|
||||
PolygonSmoothHint = ((int)0x0C53),
|
||||
FogHint = ((int)0x0C54),
|
||||
UnpackAlignment = ((int)0x0CF5),
|
||||
PackAlignment = ((int)0x0D05),
|
||||
MaxLights = ((int)0x0D31),
|
||||
MaxTextureSize = ((int)0x0D33),
|
||||
MaxModelviewStackDepth = ((int)0x0D36),
|
||||
MaxProjectionStackDepth = ((int)0x0D38),
|
||||
MaxTextureStackDepth = ((int)0x0D39),
|
||||
MaxViewportDims = ((int)0x0D3A),
|
||||
SubpixelBits = ((int)0x0D50),
|
||||
RedBits = ((int)0x0D52),
|
||||
GreenBits = ((int)0x0D53),
|
||||
BlueBits = ((int)0x0D54),
|
||||
AlphaBits = ((int)0x0D55),
|
||||
DepthBits = ((int)0x0D56),
|
||||
StencilBits = ((int)0x0D57),
|
||||
Texture2D = ((int)0x0DE1),
|
||||
DontCare = ((int)0x1100),
|
||||
Fastest = ((int)0x1101),
|
||||
Nicest = ((int)0x1102),
|
||||
Ambient = ((int)0x1200),
|
||||
Diffuse = ((int)0x1201),
|
||||
Specular = ((int)0x1202),
|
||||
Position = ((int)0x1203),
|
||||
SpotDirection = ((int)0x1204),
|
||||
SpotExponent = ((int)0x1205),
|
||||
SpotCutoff = ((int)0x1206),
|
||||
ConstantAttenuation = ((int)0x1207),
|
||||
LinearAttenuation = ((int)0x1208),
|
||||
QuadraticAttenuation = ((int)0x1209),
|
||||
Byte = ((int)0x1400),
|
||||
UnsignedByte = ((int)0x1401),
|
||||
Short = ((int)0x1402),
|
||||
UnsignedShort = ((int)0x1403),
|
||||
Float = ((int)0x1406),
|
||||
Fixed = ((int)0x140C),
|
||||
Clear = ((int)0x1500),
|
||||
And = ((int)0x1501),
|
||||
AndReverse = ((int)0x1502),
|
||||
Copy = ((int)0x1503),
|
||||
AndInverted = ((int)0x1504),
|
||||
Noop = ((int)0x1505),
|
||||
Xor = ((int)0x1506),
|
||||
Or = ((int)0x1507),
|
||||
Nor = ((int)0x1508),
|
||||
Equiv = ((int)0x1509),
|
||||
Invert = ((int)0x150A),
|
||||
OrReverse = ((int)0x150B),
|
||||
CopyInverted = ((int)0x150C),
|
||||
OrInverted = ((int)0x150D),
|
||||
Nand = ((int)0x150E),
|
||||
Set = ((int)0x150F),
|
||||
Emission = ((int)0x1600),
|
||||
Shininess = ((int)0x1601),
|
||||
AmbientAndDiffuse = ((int)0x1602),
|
||||
Modelview = ((int)0x1700),
|
||||
Projection = ((int)0x1701),
|
||||
Texture = ((int)0x1702),
|
||||
Alpha = ((int)0x1906),
|
||||
Rgb = ((int)0x1907),
|
||||
Rgba = ((int)0x1908),
|
||||
Luminance = ((int)0x1909),
|
||||
LuminanceAlpha = ((int)0x190A),
|
||||
Flat = ((int)0x1D00),
|
||||
Smooth = ((int)0x1D01),
|
||||
Keep = ((int)0x1E00),
|
||||
Replace = ((int)0x1E01),
|
||||
Incr = ((int)0x1E02),
|
||||
Decr = ((int)0x1E03),
|
||||
Vendor = ((int)0x1F00),
|
||||
Renderer = ((int)0x1F01),
|
||||
Version = ((int)0x1F02),
|
||||
Extensions = ((int)0x1F03),
|
||||
Modulate = ((int)0x2100),
|
||||
Decal = ((int)0x2101),
|
||||
TextureEnvMode = ((int)0x2200),
|
||||
TextureEnvColor = ((int)0x2201),
|
||||
TextureEnv = ((int)0x2300),
|
||||
Nearest = ((int)0x2600),
|
||||
Linear = ((int)0x2601),
|
||||
NearestMipmapNearest = ((int)0x2700),
|
||||
LinearMipmapNearest = ((int)0x2701),
|
||||
NearestMipmapLinear = ((int)0x2702),
|
||||
LinearMipmapLinear = ((int)0x2703),
|
||||
TextureMagFilter = ((int)0x2800),
|
||||
TextureMinFilter = ((int)0x2801),
|
||||
TextureWrapS = ((int)0x2802),
|
||||
TextureWrapT = ((int)0x2803),
|
||||
Repeat = ((int)0x2901),
|
||||
Light0 = ((int)0x4000),
|
||||
Light1 = ((int)0x4001),
|
||||
Light2 = ((int)0x4002),
|
||||
Light3 = ((int)0x4003),
|
||||
Light4 = ((int)0x4004),
|
||||
Light5 = ((int)0x4005),
|
||||
Light6 = ((int)0x4006),
|
||||
Light7 = ((int)0x4007),
|
||||
UnsignedShort4444 = ((int)0x8033),
|
||||
UnsignedShort5551 = ((int)0x8034),
|
||||
PolygonOffsetFill = ((int)0x8037),
|
||||
RescaleNormal = ((int)0x803A),
|
||||
VertexArray = ((int)0x8074),
|
||||
NormalArray = ((int)0x8075),
|
||||
ColorArray = ((int)0x8076),
|
||||
TextureCoordArray = ((int)0x8078),
|
||||
Multisample = ((int)0x809D),
|
||||
SampleAlphaToCoverage = ((int)0x809E),
|
||||
SampleAlphaToOne = ((int)0x809F),
|
||||
SampleCoverage = ((int)0x80A0),
|
||||
MaxElementsVertices = ((int)0x80E8),
|
||||
MaxElementsIndices = ((int)0x80E9),
|
||||
ClampToEdge = ((int)0x812F),
|
||||
UnsignedShort565 = ((int)0x8363),
|
||||
AliasedPointSizeRange = ((int)0x846D),
|
||||
AliasedLineWidthRange = ((int)0x846E),
|
||||
Texture0 = ((int)0x84C0),
|
||||
Texture1 = ((int)0x84C1),
|
||||
Texture2 = ((int)0x84C2),
|
||||
Texture3 = ((int)0x84C3),
|
||||
Texture4 = ((int)0x84C4),
|
||||
Texture5 = ((int)0x84C5),
|
||||
Texture6 = ((int)0x84C6),
|
||||
Texture7 = ((int)0x84C7),
|
||||
Texture8 = ((int)0x84C8),
|
||||
Texture9 = ((int)0x84C9),
|
||||
Texture10 = ((int)0x84CA),
|
||||
Texture11 = ((int)0x84CB),
|
||||
Texture12 = ((int)0x84CC),
|
||||
Texture13 = ((int)0x84CD),
|
||||
Texture14 = ((int)0x84CE),
|
||||
Texture15 = ((int)0x84CF),
|
||||
Texture16 = ((int)0x84D0),
|
||||
Texture17 = ((int)0x84D1),
|
||||
Texture18 = ((int)0x84D2),
|
||||
Texture19 = ((int)0x84D3),
|
||||
Texture20 = ((int)0x84D4),
|
||||
Texture21 = ((int)0x84D5),
|
||||
Texture22 = ((int)0x84D6),
|
||||
Texture23 = ((int)0x84D7),
|
||||
Texture24 = ((int)0x84D8),
|
||||
Texture25 = ((int)0x84D9),
|
||||
Texture26 = ((int)0x84DA),
|
||||
Texture27 = ((int)0x84DB),
|
||||
Texture28 = ((int)0x84DC),
|
||||
Texture29 = ((int)0x84DD),
|
||||
Texture30 = ((int)0x84DE),
|
||||
Texture31 = ((int)0x84DF),
|
||||
MaxTextureUnits = ((int)0x84E2),
|
||||
NumCompressedTextureFormats = ((int)0x86A2),
|
||||
CompressedTextureFormats = ((int)0x86A3),
|
||||
Palette4Rgb8Oes = ((int)0x8B90),
|
||||
Palette4Rgba8Oes = ((int)0x8B91),
|
||||
Palette4R5G6B5Oes = ((int)0x8B92),
|
||||
Palette4Rgba4Oes = ((int)0x8B93),
|
||||
Palette4Rgb5A1Oes = ((int)0x8B94),
|
||||
Palette8Rgb8Oes = ((int)0x8B95),
|
||||
Palette8Rgba8Oes = ((int)0x8B96),
|
||||
Palette8R5G6B5Oes = ((int)0x8B97),
|
||||
Palette8Rgba4Oes = ((int)0x8B98),
|
||||
Palette8Rgb5A1Oes = ((int)0x8B99),
|
||||
ImplementationColorReadTypeOes = ((int)0x8B9A),
|
||||
ImplementationColorReadFormatOes = ((int)0x8B9B),
|
||||
OesCompressedPalettedTexture = ((int)1),
|
||||
OesReadFormat = ((int)1),
|
||||
OesVersion10 = ((int)1),
|
||||
One = ((int)1),
|
||||
True = ((int)1),
|
||||
}
|
||||
|
||||
public enum AlphaFunction : int
|
||||
{
|
||||
Never = ((int)0x0200),
|
||||
Less = ((int)0x0201),
|
||||
Equal = ((int)0x0202),
|
||||
Lequal = ((int)0x0203),
|
||||
Greater = ((int)0x0204),
|
||||
Notequal = ((int)0x0205),
|
||||
Gequal = ((int)0x0206),
|
||||
Always = ((int)0x0207),
|
||||
}
|
||||
|
||||
public enum BeginMode : int
|
||||
{
|
||||
Points = ((int)0x0000),
|
||||
Lines = ((int)0x0001),
|
||||
LineLoop = ((int)0x0002),
|
||||
LineStrip = ((int)0x0003),
|
||||
Triangles = ((int)0x0004),
|
||||
TriangleStrip = ((int)0x0005),
|
||||
TriangleFan = ((int)0x0006),
|
||||
}
|
||||
|
||||
public enum BlendingFactorDest : int
|
||||
{
|
||||
Zero = ((int)0),
|
||||
SrcColor = ((int)0x0300),
|
||||
OneMinusSrcColor = ((int)0x0301),
|
||||
SrcAlpha = ((int)0x0302),
|
||||
OneMinusSrcAlpha = ((int)0x0303),
|
||||
DstAlpha = ((int)0x0304),
|
||||
OneMinusDstAlpha = ((int)0x0305),
|
||||
One = ((int)1),
|
||||
}
|
||||
|
||||
public enum BlendingFactorSrc : int
|
||||
{
|
||||
DstColor = ((int)0x0306),
|
||||
OneMinusDstColor = ((int)0x0307),
|
||||
SrcAlphaSaturate = ((int)0x0308),
|
||||
}
|
||||
|
||||
public enum Boolean : int
|
||||
{
|
||||
False = ((int)0),
|
||||
True = ((int)1),
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ClearBufferMask : int
|
||||
{
|
||||
DepthBufferBit = ((int)0x00000100),
|
||||
StencilBufferBit = ((int)0x00000400),
|
||||
ColorBufferBit = ((int)0x00004000),
|
||||
}
|
||||
|
||||
public enum CullFaceMode : int
|
||||
{
|
||||
Front = ((int)0x0404),
|
||||
Back = ((int)0x0405),
|
||||
FrontAndBack = ((int)0x0408),
|
||||
}
|
||||
|
||||
public enum DataType : int
|
||||
{
|
||||
Byte = ((int)0x1400),
|
||||
UnsignedByte = ((int)0x1401),
|
||||
Short = ((int)0x1402),
|
||||
UnsignedShort = ((int)0x1403),
|
||||
Float = ((int)0x1406),
|
||||
Fixed = ((int)0x140C),
|
||||
}
|
||||
|
||||
public enum EnableCap : int
|
||||
{
|
||||
PointSmooth = ((int)0x0B10),
|
||||
LineSmooth = ((int)0x0B20),
|
||||
CullFace = ((int)0x0B44),
|
||||
Lighting = ((int)0x0B50),
|
||||
ColorMaterial = ((int)0x0B57),
|
||||
Fog = ((int)0x0B60),
|
||||
DepthTest = ((int)0x0B71),
|
||||
StencilTest = ((int)0x0B90),
|
||||
Normalize = ((int)0x0BA1),
|
||||
AlphaTest = ((int)0x0BC0),
|
||||
Dither = ((int)0x0BD0),
|
||||
Blend = ((int)0x0BE2),
|
||||
ColorLogicOp = ((int)0x0BF2),
|
||||
ScissorTest = ((int)0x0C11),
|
||||
Texture2D = ((int)0x0DE1),
|
||||
PolygonOffsetFill = ((int)0x8037),
|
||||
RescaleNormal = ((int)0x803A),
|
||||
VertexArray = ((int)0x8074),
|
||||
NormalArray = ((int)0x8075),
|
||||
ColorArray = ((int)0x8076),
|
||||
TextureCoordArray = ((int)0x8078),
|
||||
Multisample = ((int)0x809D),
|
||||
SampleAlphaToCoverage = ((int)0x809E),
|
||||
SampleAlphaToOne = ((int)0x809F),
|
||||
SampleCoverage = ((int)0x80A0),
|
||||
}
|
||||
|
||||
public enum ErrorCode : int
|
||||
{
|
||||
NoError = ((int)0),
|
||||
InvalidEnum = ((int)0x0500),
|
||||
InvalidValue = ((int)0x0501),
|
||||
InvalidOperation = ((int)0x0502),
|
||||
StackOverflow = ((int)0x0503),
|
||||
StackUnderflow = ((int)0x0504),
|
||||
OutOfMemory = ((int)0x0505),
|
||||
}
|
||||
|
||||
public enum Extensions : int
|
||||
{
|
||||
OesCompressedPalettedTexture = ((int)1),
|
||||
OesReadFormat = ((int)1),
|
||||
OesVersion10 = ((int)1),
|
||||
}
|
||||
|
||||
public enum FogMode : int
|
||||
{
|
||||
Exp = ((int)0x0800),
|
||||
Exp2 = ((int)0x0801),
|
||||
}
|
||||
|
||||
public enum FogParameter : int
|
||||
{
|
||||
FogDensity = ((int)0x0B62),
|
||||
FogStart = ((int)0x0B63),
|
||||
FogEnd = ((int)0x0B64),
|
||||
FogMode = ((int)0x0B65),
|
||||
FogColor = ((int)0x0B66),
|
||||
}
|
||||
|
||||
public enum FrontFaceDirection : int
|
||||
{
|
||||
Cw = ((int)0x0900),
|
||||
Ccw = ((int)0x0901),
|
||||
}
|
||||
|
||||
public enum GetPName : int
|
||||
{
|
||||
SmoothPointSizeRange = ((int)0x0B12),
|
||||
SmoothLineWidthRange = ((int)0x0B22),
|
||||
MaxLights = ((int)0x0D31),
|
||||
MaxTextureSize = ((int)0x0D33),
|
||||
MaxModelviewStackDepth = ((int)0x0D36),
|
||||
MaxProjectionStackDepth = ((int)0x0D38),
|
||||
MaxTextureStackDepth = ((int)0x0D39),
|
||||
MaxViewportDims = ((int)0x0D3A),
|
||||
SubpixelBits = ((int)0x0D50),
|
||||
RedBits = ((int)0x0D52),
|
||||
GreenBits = ((int)0x0D53),
|
||||
BlueBits = ((int)0x0D54),
|
||||
AlphaBits = ((int)0x0D55),
|
||||
DepthBits = ((int)0x0D56),
|
||||
StencilBits = ((int)0x0D57),
|
||||
MaxElementsVertices = ((int)0x80E8),
|
||||
MaxElementsIndices = ((int)0x80E9),
|
||||
AliasedPointSizeRange = ((int)0x846D),
|
||||
AliasedLineWidthRange = ((int)0x846E),
|
||||
MaxTextureUnits = ((int)0x84E2),
|
||||
NumCompressedTextureFormats = ((int)0x86A2),
|
||||
CompressedTextureFormats = ((int)0x86A3),
|
||||
ImplementationColorReadTypeOes = ((int)0x8B9A),
|
||||
ImplementationColorReadFormatOes = ((int)0x8B9B),
|
||||
}
|
||||
|
||||
public enum HintMode : int
|
||||
{
|
||||
DontCare = ((int)0x1100),
|
||||
Fastest = ((int)0x1101),
|
||||
Nicest = ((int)0x1102),
|
||||
}
|
||||
|
||||
public enum HintTarget : int
|
||||
{
|
||||
PerspectiveCorrectionHint = ((int)0x0C50),
|
||||
PointSmoothHint = ((int)0x0C51),
|
||||
LineSmoothHint = ((int)0x0C52),
|
||||
PolygonSmoothHint = ((int)0x0C53),
|
||||
FogHint = ((int)0x0C54),
|
||||
}
|
||||
|
||||
public enum LightModelParameter : int
|
||||
{
|
||||
LightModelTwoSide = ((int)0x0B52),
|
||||
LightModelAmbient = ((int)0x0B53),
|
||||
}
|
||||
|
||||
public enum LightName : int
|
||||
{
|
||||
Light0 = ((int)0x4000),
|
||||
Light1 = ((int)0x4001),
|
||||
Light2 = ((int)0x4002),
|
||||
Light3 = ((int)0x4003),
|
||||
Light4 = ((int)0x4004),
|
||||
Light5 = ((int)0x4005),
|
||||
Light6 = ((int)0x4006),
|
||||
Light7 = ((int)0x4007),
|
||||
}
|
||||
|
||||
public enum LightParameter : int
|
||||
{
|
||||
Ambient = ((int)0x1200),
|
||||
Diffuse = ((int)0x1201),
|
||||
Specular = ((int)0x1202),
|
||||
Position = ((int)0x1203),
|
||||
SpotDirection = ((int)0x1204),
|
||||
SpotExponent = ((int)0x1205),
|
||||
SpotCutoff = ((int)0x1206),
|
||||
ConstantAttenuation = ((int)0x1207),
|
||||
LinearAttenuation = ((int)0x1208),
|
||||
QuadraticAttenuation = ((int)0x1209),
|
||||
}
|
||||
|
||||
public enum LogicOp : int
|
||||
{
|
||||
Clear = ((int)0x1500),
|
||||
And = ((int)0x1501),
|
||||
AndReverse = ((int)0x1502),
|
||||
Copy = ((int)0x1503),
|
||||
AndInverted = ((int)0x1504),
|
||||
Noop = ((int)0x1505),
|
||||
Xor = ((int)0x1506),
|
||||
Or = ((int)0x1507),
|
||||
Nor = ((int)0x1508),
|
||||
Equiv = ((int)0x1509),
|
||||
Invert = ((int)0x150A),
|
||||
OrReverse = ((int)0x150B),
|
||||
CopyInverted = ((int)0x150C),
|
||||
OrInverted = ((int)0x150D),
|
||||
Nand = ((int)0x150E),
|
||||
Set = ((int)0x150F),
|
||||
}
|
||||
|
||||
public enum MaterialParameter : int
|
||||
{
|
||||
Emission = ((int)0x1600),
|
||||
Shininess = ((int)0x1601),
|
||||
AmbientAndDiffuse = ((int)0x1602),
|
||||
}
|
||||
|
||||
public enum MatrixMode : int
|
||||
{
|
||||
Modelview = ((int)0x1700),
|
||||
Projection = ((int)0x1701),
|
||||
Texture = ((int)0x1702),
|
||||
}
|
||||
|
||||
public enum PixelFormat : int
|
||||
{
|
||||
Alpha = ((int)0x1906),
|
||||
Rgb = ((int)0x1907),
|
||||
Rgba = ((int)0x1908),
|
||||
Luminance = ((int)0x1909),
|
||||
LuminanceAlpha = ((int)0x190A),
|
||||
}
|
||||
|
||||
public enum PixelInternalFormat : int
|
||||
{
|
||||
Palette4Rgb8Oes = ((int)0x8B90),
|
||||
Palette4Rgba8Oes = ((int)0x8B91),
|
||||
Palette4R5G6B5Oes = ((int)0x8B92),
|
||||
Palette4Rgba4Oes = ((int)0x8B93),
|
||||
Palette4Rgb5A1Oes = ((int)0x8B94),
|
||||
Palette8Rgb8Oes = ((int)0x8B95),
|
||||
Palette8Rgba8Oes = ((int)0x8B96),
|
||||
Palette8R5G6B5Oes = ((int)0x8B97),
|
||||
Palette8Rgba4Oes = ((int)0x8B98),
|
||||
Palette8Rgb5A1Oes = ((int)0x8B99),
|
||||
}
|
||||
|
||||
public enum PixelStoreParameter : int
|
||||
{
|
||||
UnpackAlignment = ((int)0x0CF5),
|
||||
PackAlignment = ((int)0x0D05),
|
||||
}
|
||||
|
||||
public enum PixelType : int
|
||||
{
|
||||
UnsignedShort4444 = ((int)0x8033),
|
||||
UnsignedShort5551 = ((int)0x8034),
|
||||
UnsignedShort565 = ((int)0x8363),
|
||||
}
|
||||
|
||||
public enum ShadingModel : int
|
||||
{
|
||||
Flat = ((int)0x1D00),
|
||||
Smooth = ((int)0x1D01),
|
||||
}
|
||||
|
||||
public enum StencilOp : int
|
||||
{
|
||||
Keep = ((int)0x1E00),
|
||||
Replace = ((int)0x1E01),
|
||||
Incr = ((int)0x1E02),
|
||||
Decr = ((int)0x1E03),
|
||||
}
|
||||
|
||||
public enum StringName : int
|
||||
{
|
||||
Vendor = ((int)0x1F00),
|
||||
Renderer = ((int)0x1F01),
|
||||
Version = ((int)0x1F02),
|
||||
Extensions = ((int)0x1F03),
|
||||
}
|
||||
|
||||
public enum TextureEnvMode : int
|
||||
{
|
||||
Add = ((int)0x0104),
|
||||
Modulate = ((int)0x2100),
|
||||
Decal = ((int)0x2101),
|
||||
}
|
||||
|
||||
public enum TextureEnvParameter : int
|
||||
{
|
||||
TextureEnvMode = ((int)0x2200),
|
||||
TextureEnvColor = ((int)0x2201),
|
||||
}
|
||||
|
||||
public enum TextureEnvTarget : int
|
||||
{
|
||||
TextureEnv = ((int)0x2300),
|
||||
}
|
||||
|
||||
public enum TextureMagFilter : int
|
||||
{
|
||||
Nearest = ((int)0x2600),
|
||||
Linear = ((int)0x2601),
|
||||
}
|
||||
|
||||
public enum TextureMinFilter : int
|
||||
{
|
||||
NearestMipmapNearest = ((int)0x2700),
|
||||
LinearMipmapNearest = ((int)0x2701),
|
||||
NearestMipmapLinear = ((int)0x2702),
|
||||
LinearMipmapLinear = ((int)0x2703),
|
||||
}
|
||||
|
||||
public enum TextureParameterName : int
|
||||
{
|
||||
TextureMagFilter = ((int)0x2800),
|
||||
TextureMinFilter = ((int)0x2801),
|
||||
TextureWrapS = ((int)0x2802),
|
||||
TextureWrapT = ((int)0x2803),
|
||||
}
|
||||
|
||||
public enum TextureUnit : int
|
||||
{
|
||||
Texture0 = ((int)0x84C0),
|
||||
Texture1 = ((int)0x84C1),
|
||||
Texture2 = ((int)0x84C2),
|
||||
Texture3 = ((int)0x84C3),
|
||||
Texture4 = ((int)0x84C4),
|
||||
Texture5 = ((int)0x84C5),
|
||||
Texture6 = ((int)0x84C6),
|
||||
Texture7 = ((int)0x84C7),
|
||||
Texture8 = ((int)0x84C8),
|
||||
Texture9 = ((int)0x84C9),
|
||||
Texture10 = ((int)0x84CA),
|
||||
Texture11 = ((int)0x84CB),
|
||||
Texture12 = ((int)0x84CC),
|
||||
Texture13 = ((int)0x84CD),
|
||||
Texture14 = ((int)0x84CE),
|
||||
Texture15 = ((int)0x84CF),
|
||||
Texture16 = ((int)0x84D0),
|
||||
Texture17 = ((int)0x84D1),
|
||||
Texture18 = ((int)0x84D2),
|
||||
Texture19 = ((int)0x84D3),
|
||||
Texture20 = ((int)0x84D4),
|
||||
Texture21 = ((int)0x84D5),
|
||||
Texture22 = ((int)0x84D6),
|
||||
Texture23 = ((int)0x84D7),
|
||||
Texture24 = ((int)0x84D8),
|
||||
Texture25 = ((int)0x84D9),
|
||||
Texture26 = ((int)0x84DA),
|
||||
Texture27 = ((int)0x84DB),
|
||||
Texture28 = ((int)0x84DC),
|
||||
Texture29 = ((int)0x84DD),
|
||||
Texture30 = ((int)0x84DE),
|
||||
Texture31 = ((int)0x84DF),
|
||||
}
|
||||
|
||||
public enum TextureWrapMode : int
|
||||
{
|
||||
Repeat = ((int)0x2901),
|
||||
ClampToEdge = ((int)0x812F),
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
/* flibit Changes GraphicsContext stuff to IntPtr, an SDL_GLContext. */
|
||||
|
||||
namespace OpenTK.Graphics.ES10
|
||||
{
|
||||
// Used in debug-mode only, for automatic OpenGL error-checking.
|
||||
//
|
||||
// Works like this: an instance is created before each OpenGL function is called.
|
||||
// The constructor resets the OpenGL error state. Once the native function returns,
|
||||
// the error state is checked again, raising the relevant exceptions.
|
||||
//
|
||||
// A using-region is used to ensure Dispose() is called.
|
||||
//
|
||||
// Make sure that no error checking is added to the GetError function,
|
||||
// as that would cause infinite recursion!
|
||||
struct ErrorHelper : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
static readonly object SyncRoot = new object();
|
||||
static readonly Dictionary<IntPtr, List<ErrorCode>> ContextErrors =
|
||||
new Dictionary<IntPtr, List<ErrorCode>>();
|
||||
readonly IntPtr Context;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ErrorHelper(IntPtr context)
|
||||
{
|
||||
if (context == IntPtr.Zero)
|
||||
throw new GraphicsContextMissingException();
|
||||
|
||||
Context = context;
|
||||
lock (SyncRoot)
|
||||
{
|
||||
if (!ContextErrors.ContainsKey(Context))
|
||||
ContextErrors.Add(Context, new List<ErrorCode>());
|
||||
}
|
||||
ResetErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
// Retrieve all OpenGL errors to clear the error list.
|
||||
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
|
||||
[Conditional("DEBUG")]
|
||||
internal void ResetErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
while ((ErrorCode)GL.GetError() != ErrorCode.NoError)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve all OpenGL errors and throw an exception if anything other than NoError is returned.
|
||||
[Conditional("DEBUG")]
|
||||
internal void CheckErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
List<ErrorCode> error_list = ContextErrors[Context];
|
||||
error_list.Clear();
|
||||
ErrorCode error;
|
||||
do
|
||||
{
|
||||
error = (ErrorCode)GL.GetError();
|
||||
error_list.Add(error);
|
||||
} while (error != ErrorCode.NoError);
|
||||
|
||||
if (error_list.Count != 1)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (ErrorCode e in error_list)
|
||||
{
|
||||
if (e != ErrorCode.NoError)
|
||||
{
|
||||
sb.Append(e.ToString());
|
||||
sb.Append(", ");
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
sb.Remove(sb.Length - 2, 2); // Remove the last comma
|
||||
|
||||
throw new GraphicsErrorException(sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CheckErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Graphics.ES10
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides access to OpenGL ES 1.0 methods.
|
||||
/// </summary>
|
||||
public sealed partial class GL : GraphicsBindingsBase
|
||||
{
|
||||
const string Library = "libGLES.dll";
|
||||
static readonly object sync_root = new object();
|
||||
|
||||
#region --- Protected Members ---
|
||||
|
||||
/// <summary>
|
||||
/// Returns a synchronization token unique for the GL class.
|
||||
/// </summary>
|
||||
protected override object SyncRoot
|
||||
{
|
||||
get { return sync_root; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,788 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
namespace OpenTK.Graphics.ES11
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
|
||||
partial class GL
|
||||
{
|
||||
|
||||
internal static partial class Core
|
||||
{
|
||||
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glActiveTexture", ExactSpelling = true)]
|
||||
internal extern static void ActiveTexture(OpenTK.Graphics.ES11.All texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glAlphaFunc", ExactSpelling = true)]
|
||||
internal extern static void AlphaFunc(OpenTK.Graphics.ES11.All func, Single @ref);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glAlphaFuncx", ExactSpelling = true)]
|
||||
internal extern static void AlphaFuncx(OpenTK.Graphics.ES11.All func, int @ref);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glAlphaFuncxOES", ExactSpelling = true)]
|
||||
internal extern static void AlphaFuncxOES(OpenTK.Graphics.ES11.All func, int @ref);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindBuffer", ExactSpelling = true)]
|
||||
internal extern static void BindBuffer(OpenTK.Graphics.ES11.All target, UInt32 buffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindFramebufferOES", ExactSpelling = true)]
|
||||
internal extern static void BindFramebufferOES(OpenTK.Graphics.ES11.All target, UInt32 framebuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindRenderbufferOES", ExactSpelling = true)]
|
||||
internal extern static void BindRenderbufferOES(OpenTK.Graphics.ES11.All target, UInt32 renderbuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindTexture", ExactSpelling = true)]
|
||||
internal extern static void BindTexture(OpenTK.Graphics.ES11.All target, UInt32 texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendEquationOES", ExactSpelling = true)]
|
||||
internal extern static void BlendEquationOES(OpenTK.Graphics.ES11.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendEquationSeparateOES", ExactSpelling = true)]
|
||||
internal extern static void BlendEquationSeparateOES(OpenTK.Graphics.ES11.All modeRGB, OpenTK.Graphics.ES11.All modeAlpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendFunc", ExactSpelling = true)]
|
||||
internal extern static void BlendFunc(OpenTK.Graphics.ES11.All sfactor, OpenTK.Graphics.ES11.All dfactor);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendFuncSeparateOES", ExactSpelling = true)]
|
||||
internal extern static void BlendFuncSeparateOES(OpenTK.Graphics.ES11.All srcRGB, OpenTK.Graphics.ES11.All dstRGB, OpenTK.Graphics.ES11.All srcAlpha, OpenTK.Graphics.ES11.All dstAlpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBufferData", ExactSpelling = true)]
|
||||
internal extern static void BufferData(OpenTK.Graphics.ES11.All target, IntPtr size, IntPtr data, OpenTK.Graphics.ES11.All usage);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBufferSubData", ExactSpelling = true)]
|
||||
internal extern static void BufferSubData(OpenTK.Graphics.ES11.All target, IntPtr offset, IntPtr size, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCheckFramebufferStatusOES", ExactSpelling = true)]
|
||||
internal extern static OpenTK.Graphics.ES11.All CheckFramebufferStatusOES(OpenTK.Graphics.ES11.All target);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClear", ExactSpelling = true)]
|
||||
internal extern static void Clear(UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearColor", ExactSpelling = true)]
|
||||
internal extern static void ClearColor(Single red, Single green, Single blue, Single alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearColorx", ExactSpelling = true)]
|
||||
internal extern static void ClearColorx(int red, int green, int blue, int alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearColorxOES", ExactSpelling = true)]
|
||||
internal extern static void ClearColorxOES(int red, int green, int blue, int alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthf", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthf(Single depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthfOES", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthfOES(Single depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthx", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthx(int depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthxOES", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthxOES(int depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearStencil", ExactSpelling = true)]
|
||||
internal extern static void ClearStencil(Int32 s);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClientActiveTexture", ExactSpelling = true)]
|
||||
internal extern static void ClientActiveTexture(OpenTK.Graphics.ES11.All texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClipPlanef", ExactSpelling = true)]
|
||||
internal extern static unsafe void ClipPlanef(OpenTK.Graphics.ES11.All plane, Single* equation);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClipPlanefIMG", ExactSpelling = true)]
|
||||
internal extern static unsafe void ClipPlanefIMG(OpenTK.Graphics.ES11.All p, Single* eqn);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClipPlanefOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void ClipPlanefOES(OpenTK.Graphics.ES11.All plane, Single* equation);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClipPlanex", ExactSpelling = true)]
|
||||
internal extern static unsafe void ClipPlanex(OpenTK.Graphics.ES11.All plane, int* equation);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClipPlanexIMG", ExactSpelling = true)]
|
||||
internal extern static unsafe void ClipPlanexIMG(OpenTK.Graphics.ES11.All p, int* eqn);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClipPlanexOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void ClipPlanexOES(OpenTK.Graphics.ES11.All plane, int* equation);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColor4f", ExactSpelling = true)]
|
||||
internal extern static void Color4f(Single red, Single green, Single blue, Single alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColor4ub", ExactSpelling = true)]
|
||||
internal extern static void Color4ub(Byte red, Byte green, Byte blue, Byte alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColor4x", ExactSpelling = true)]
|
||||
internal extern static void Color4x(int red, int green, int blue, int alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColor4xOES", ExactSpelling = true)]
|
||||
internal extern static void Color4xOES(int red, int green, int blue, int alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColorMask", ExactSpelling = true)]
|
||||
internal extern static void ColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColorPointer", ExactSpelling = true)]
|
||||
internal extern static void ColorPointer(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexImage2D(OpenTK.Graphics.ES11.All target, Int32 level, OpenTK.Graphics.ES11.All internalformat, Int32 width, Int32 height, Int32 border, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexSubImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES11.All format, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void CopyTexImage2D(OpenTK.Graphics.ES11.All target, Int32 level, OpenTK.Graphics.ES11.All internalformat, Int32 x, Int32 y, Int32 width, Int32 height, Int32 border);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void CopyTexSubImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCullFace", ExactSpelling = true)]
|
||||
internal extern static void CullFace(OpenTK.Graphics.ES11.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCurrentPaletteMatrixOES", ExactSpelling = true)]
|
||||
internal extern static void CurrentPaletteMatrixOES(UInt32 matrixpaletteindex);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteBuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteBuffers(Int32 n, UInt32* buffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteFencesNV", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteFencesNV(Int32 n, UInt32* fences);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteFramebuffersOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteFramebuffersOES(Int32 n, UInt32* framebuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteRenderbuffersOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteRenderbuffersOES(Int32 n, UInt32* renderbuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteTextures", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteTextures(Int32 n, UInt32* textures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthFunc", ExactSpelling = true)]
|
||||
internal extern static void DepthFunc(OpenTK.Graphics.ES11.All func);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthMask", ExactSpelling = true)]
|
||||
internal extern static void DepthMask(bool flag);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangef", ExactSpelling = true)]
|
||||
internal extern static void DepthRangef(Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangefOES", ExactSpelling = true)]
|
||||
internal extern static void DepthRangefOES(Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangex", ExactSpelling = true)]
|
||||
internal extern static void DepthRangex(int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangexOES", ExactSpelling = true)]
|
||||
internal extern static void DepthRangexOES(int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisable", ExactSpelling = true)]
|
||||
internal extern static void Disable(OpenTK.Graphics.ES11.All cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisableClientState", ExactSpelling = true)]
|
||||
internal extern static void DisableClientState(OpenTK.Graphics.ES11.All array);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisableDriverControlQCOM", ExactSpelling = true)]
|
||||
internal extern static void DisableDriverControlQCOM(UInt32 driverControl);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawArrays", ExactSpelling = true)]
|
||||
internal extern static void DrawArrays(OpenTK.Graphics.ES11.All mode, Int32 first, Int32 count);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawElements", ExactSpelling = true)]
|
||||
internal extern static void DrawElements(OpenTK.Graphics.ES11.All mode, Int32 count, OpenTK.Graphics.ES11.All type, IntPtr indices);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexfOES", ExactSpelling = true)]
|
||||
internal extern static void DrawTexfOES(Single x, Single y, Single z, Single width, Single height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexfvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DrawTexfvOES(Single* coords);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexiOES", ExactSpelling = true)]
|
||||
internal extern static void DrawTexiOES(Int32 x, Int32 y, Int32 z, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexivOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DrawTexivOES(Int32* coords);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexsOES", ExactSpelling = true)]
|
||||
internal extern static void DrawTexsOES(Int16 x, Int16 y, Int16 z, Int16 width, Int16 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexsvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DrawTexsvOES(Int16* coords);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexxOES", ExactSpelling = true)]
|
||||
internal extern static void DrawTexxOES(int x, int y, int z, int width, int height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawTexxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DrawTexxvOES(int* coords);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEGLImageTargetRenderbufferStorageOES", ExactSpelling = true)]
|
||||
internal extern static void EGLImageTargetRenderbufferStorageOES(OpenTK.Graphics.ES11.All target, IntPtr image);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEGLImageTargetTexture2DOES", ExactSpelling = true)]
|
||||
internal extern static void EGLImageTargetTexture2DOES(OpenTK.Graphics.ES11.All target, IntPtr image);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnable", ExactSpelling = true)]
|
||||
internal extern static void Enable(OpenTK.Graphics.ES11.All cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnableClientState", ExactSpelling = true)]
|
||||
internal extern static void EnableClientState(OpenTK.Graphics.ES11.All array);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnableDriverControlQCOM", ExactSpelling = true)]
|
||||
internal extern static void EnableDriverControlQCOM(UInt32 driverControl);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFinish", ExactSpelling = true)]
|
||||
internal extern static void Finish();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFinishFenceNV", ExactSpelling = true)]
|
||||
internal extern static void FinishFenceNV(UInt32 fence);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFlush", ExactSpelling = true)]
|
||||
internal extern static void Flush();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogf", ExactSpelling = true)]
|
||||
internal extern static void Fogf(OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Fogfv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogx", ExactSpelling = true)]
|
||||
internal extern static void Fogx(OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogxOES", ExactSpelling = true)]
|
||||
internal extern static void FogxOES(OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Fogxv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFogxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void FogxvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFramebufferRenderbufferOES", ExactSpelling = true)]
|
||||
internal extern static void FramebufferRenderbufferOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All attachment, OpenTK.Graphics.ES11.All renderbuffertarget, UInt32 renderbuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFramebufferTexture2DOES", ExactSpelling = true)]
|
||||
internal extern static void FramebufferTexture2DOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All attachment, OpenTK.Graphics.ES11.All textarget, UInt32 texture, Int32 level);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrontFace", ExactSpelling = true)]
|
||||
internal extern static void FrontFace(OpenTK.Graphics.ES11.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrustumf", ExactSpelling = true)]
|
||||
internal extern static void Frustumf(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrustumfOES", ExactSpelling = true)]
|
||||
internal extern static void FrustumfOES(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrustumx", ExactSpelling = true)]
|
||||
internal extern static void Frustumx(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrustumxOES", ExactSpelling = true)]
|
||||
internal extern static void FrustumxOES(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenBuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenBuffers(Int32 n, UInt32* buffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenerateMipmapOES", ExactSpelling = true)]
|
||||
internal extern static void GenerateMipmapOES(OpenTK.Graphics.ES11.All target);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenFencesNV", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenFencesNV(Int32 n, UInt32* fences);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenFramebuffersOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenFramebuffersOES(Int32 n, UInt32* framebuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenRenderbuffersOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenRenderbuffersOES(Int32 n, UInt32* renderbuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenTextures", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenTextures(Int32 n, UInt32* textures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBooleanv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetBooleanv(OpenTK.Graphics.ES11.All pname, bool* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBufferParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetBufferParameteriv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBufferPointervOES", ExactSpelling = true)]
|
||||
internal extern static void GetBufferPointervOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, IntPtr @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetClipPlanef", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetClipPlanef(OpenTK.Graphics.ES11.All pname, Single* eqn);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetClipPlanefOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetClipPlanefOES(OpenTK.Graphics.ES11.All pname, Single* eqn);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetClipPlanex", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetClipPlanex(OpenTK.Graphics.ES11.All pname, int* eqn);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetClipPlanexOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetClipPlanexOES(OpenTK.Graphics.ES11.All pname, int* eqn);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetDriverControlsQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetDriverControlsQCOM(Int32* num, Int32 size, UInt32* driverControls);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetDriverControlStringQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetDriverControlStringQCOM(UInt32 driverControl, Int32 bufSize, Int32* length, String driverControlString);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetError", ExactSpelling = true)]
|
||||
internal extern static OpenTK.Graphics.ES11.All GetError();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFenceivNV", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFenceivNV(UInt32 fence, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFixedv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFixedv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFixedvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFixedvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFloatv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFloatv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFramebufferAttachmentParameterivOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFramebufferAttachmentParameterivOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All attachment, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetIntegerv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetIntegerv(OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetLightfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetLightfv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetLightxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetLightxv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetLightxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetLightxvOES(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetMaterialfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetMaterialfv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetMaterialxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetMaterialxv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetMaterialxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetMaterialxvOES(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPointerv", ExactSpelling = true)]
|
||||
internal extern static void GetPointerv(OpenTK.Graphics.ES11.All pname, IntPtr @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetRenderbufferParameterivOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetRenderbufferParameterivOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetString", ExactSpelling = true)]
|
||||
internal extern static unsafe System.IntPtr GetString(OpenTK.Graphics.ES11.All name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexEnvfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexEnvfv(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexEnviv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexEnviv(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexEnvxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexEnvxv(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexEnvxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexEnvxvOES(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexGenfvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexGenfvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexGenivOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexGenivOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexGenxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexGenxvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexParameterfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexParameterfv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexParameteriv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexParameterxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexParameterxv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexParameterxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexParameterxvOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glHint", ExactSpelling = true)]
|
||||
internal extern static void Hint(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsBuffer", ExactSpelling = true)]
|
||||
internal extern static bool IsBuffer(UInt32 buffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsEnabled", ExactSpelling = true)]
|
||||
internal extern static bool IsEnabled(OpenTK.Graphics.ES11.All cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsFenceNV", ExactSpelling = true)]
|
||||
internal extern static bool IsFenceNV(UInt32 fence);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsFramebufferOES", ExactSpelling = true)]
|
||||
internal extern static bool IsFramebufferOES(UInt32 framebuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsRenderbufferOES", ExactSpelling = true)]
|
||||
internal extern static bool IsRenderbufferOES(UInt32 renderbuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsTexture", ExactSpelling = true)]
|
||||
internal extern static bool IsTexture(UInt32 texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightf", ExactSpelling = true)]
|
||||
internal extern static void Lightf(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Lightfv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelf", ExactSpelling = true)]
|
||||
internal extern static void LightModelf(OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void LightModelfv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelx", ExactSpelling = true)]
|
||||
internal extern static void LightModelx(OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelxOES", ExactSpelling = true)]
|
||||
internal extern static void LightModelxOES(OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void LightModelxv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightModelxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void LightModelxvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightx", ExactSpelling = true)]
|
||||
internal extern static void Lightx(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightxOES", ExactSpelling = true)]
|
||||
internal extern static void LightxOES(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Lightxv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLightxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void LightxvOES(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLineWidth", ExactSpelling = true)]
|
||||
internal extern static void LineWidth(Single width);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLineWidthx", ExactSpelling = true)]
|
||||
internal extern static void LineWidthx(int width);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLineWidthxOES", ExactSpelling = true)]
|
||||
internal extern static void LineWidthxOES(int width);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadIdentity", ExactSpelling = true)]
|
||||
internal extern static void LoadIdentity();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadMatrixf", ExactSpelling = true)]
|
||||
internal extern static unsafe void LoadMatrixf(Single* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadMatrixx", ExactSpelling = true)]
|
||||
internal extern static unsafe void LoadMatrixx(int* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadMatrixxOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void LoadMatrixxOES(int* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLoadPaletteFromModelViewMatrixOES", ExactSpelling = true)]
|
||||
internal extern static void LoadPaletteFromModelViewMatrixOES();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLogicOp", ExactSpelling = true)]
|
||||
internal extern static void LogicOp(OpenTK.Graphics.ES11.All opcode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMapBufferOES", ExactSpelling = true)]
|
||||
internal extern static unsafe System.IntPtr MapBufferOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All access);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialf", ExactSpelling = true)]
|
||||
internal extern static void Materialf(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Materialfv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialx", ExactSpelling = true)]
|
||||
internal extern static void Materialx(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialxOES", ExactSpelling = true)]
|
||||
internal extern static void MaterialxOES(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Materialxv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMaterialxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void MaterialxvOES(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMatrixIndexPointerOES", ExactSpelling = true)]
|
||||
internal extern static void MatrixIndexPointerOES(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMatrixMode", ExactSpelling = true)]
|
||||
internal extern static void MatrixMode(OpenTK.Graphics.ES11.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiTexCoord4f", ExactSpelling = true)]
|
||||
internal extern static void MultiTexCoord4f(OpenTK.Graphics.ES11.All target, Single s, Single t, Single r, Single q);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiTexCoord4x", ExactSpelling = true)]
|
||||
internal extern static void MultiTexCoord4x(OpenTK.Graphics.ES11.All target, int s, int t, int r, int q);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiTexCoord4xOES", ExactSpelling = true)]
|
||||
internal extern static void MultiTexCoord4xOES(OpenTK.Graphics.ES11.All target, int s, int t, int r, int q);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultMatrixf", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultMatrixf(Single* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultMatrixx", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultMatrixx(int* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultMatrixxOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultMatrixxOES(int* m);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormal3f", ExactSpelling = true)]
|
||||
internal extern static void Normal3f(Single nx, Single ny, Single nz);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormal3x", ExactSpelling = true)]
|
||||
internal extern static void Normal3x(int nx, int ny, int nz);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormal3xOES", ExactSpelling = true)]
|
||||
internal extern static void Normal3xOES(int nx, int ny, int nz);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glNormalPointer", ExactSpelling = true)]
|
||||
internal extern static void NormalPointer(OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glOrthof", ExactSpelling = true)]
|
||||
internal extern static void Orthof(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glOrthofOES", ExactSpelling = true)]
|
||||
internal extern static void OrthofOES(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glOrthox", ExactSpelling = true)]
|
||||
internal extern static void Orthox(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glOrthoxOES", ExactSpelling = true)]
|
||||
internal extern static void OrthoxOES(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPixelStorei", ExactSpelling = true)]
|
||||
internal extern static void PixelStorei(OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointParameterf", ExactSpelling = true)]
|
||||
internal extern static void PointParameterf(OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointParameterfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void PointParameterfv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointParameterx", ExactSpelling = true)]
|
||||
internal extern static void PointParameterx(OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointParameterxOES", ExactSpelling = true)]
|
||||
internal extern static void PointParameterxOES(OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointParameterxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void PointParameterxv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointParameterxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void PointParameterxvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointSize", ExactSpelling = true)]
|
||||
internal extern static void PointSize(Single size);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointSizePointerOES", ExactSpelling = true)]
|
||||
internal extern static void PointSizePointerOES(OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointSizex", ExactSpelling = true)]
|
||||
internal extern static void PointSizex(int size);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPointSizexOES", ExactSpelling = true)]
|
||||
internal extern static void PointSizexOES(int size);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPolygonOffset", ExactSpelling = true)]
|
||||
internal extern static void PolygonOffset(Single factor, Single units);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPolygonOffsetx", ExactSpelling = true)]
|
||||
internal extern static void PolygonOffsetx(int factor, int units);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPolygonOffsetxOES", ExactSpelling = true)]
|
||||
internal extern static void PolygonOffsetxOES(int factor, int units);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPopMatrix", ExactSpelling = true)]
|
||||
internal extern static void PopMatrix();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPushMatrix", ExactSpelling = true)]
|
||||
internal extern static void PushMatrix();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glQueryMatrixxOES", ExactSpelling = true)]
|
||||
internal extern static unsafe Int32 QueryMatrixxOES(int* mantissa, Int32* exponent);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glReadPixels", ExactSpelling = true)]
|
||||
internal extern static void ReadPixels(Int32 x, Int32 y, Int32 width, Int32 height, OpenTK.Graphics.ES11.All format, OpenTK.Graphics.ES11.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRenderbufferStorageOES", ExactSpelling = true)]
|
||||
internal extern static void RenderbufferStorageOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All internalformat, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRotatef", ExactSpelling = true)]
|
||||
internal extern static void Rotatef(Single angle, Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRotatex", ExactSpelling = true)]
|
||||
internal extern static void Rotatex(int angle, int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRotatexOES", ExactSpelling = true)]
|
||||
internal extern static void RotatexOES(int angle, int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSampleCoverage", ExactSpelling = true)]
|
||||
internal extern static void SampleCoverage(Single value, bool invert);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSampleCoveragex", ExactSpelling = true)]
|
||||
internal extern static void SampleCoveragex(int value, bool invert);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSampleCoveragexOES", ExactSpelling = true)]
|
||||
internal extern static void SampleCoveragexOES(int value, bool invert);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScalef", ExactSpelling = true)]
|
||||
internal extern static void Scalef(Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScalex", ExactSpelling = true)]
|
||||
internal extern static void Scalex(int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScalexOES", ExactSpelling = true)]
|
||||
internal extern static void ScalexOES(int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScissor", ExactSpelling = true)]
|
||||
internal extern static void Scissor(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSetFenceNV", ExactSpelling = true)]
|
||||
internal extern static void SetFenceNV(UInt32 fence, OpenTK.Graphics.ES11.All condition);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glShadeModel", ExactSpelling = true)]
|
||||
internal extern static void ShadeModel(OpenTK.Graphics.ES11.All mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilFunc", ExactSpelling = true)]
|
||||
internal extern static void StencilFunc(OpenTK.Graphics.ES11.All func, Int32 @ref, UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilMask", ExactSpelling = true)]
|
||||
internal extern static void StencilMask(UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilOp", ExactSpelling = true)]
|
||||
internal extern static void StencilOp(OpenTK.Graphics.ES11.All fail, OpenTK.Graphics.ES11.All zfail, OpenTK.Graphics.ES11.All zpass);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTestFenceNV", ExactSpelling = true)]
|
||||
internal extern static bool TestFenceNV(UInt32 fence);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexCoordPointer", ExactSpelling = true)]
|
||||
internal extern static void TexCoordPointer(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvf", ExactSpelling = true)]
|
||||
internal extern static void TexEnvf(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexEnvfv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvi", ExactSpelling = true)]
|
||||
internal extern static void TexEnvi(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnviv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexEnviv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvx", ExactSpelling = true)]
|
||||
internal extern static void TexEnvx(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvxOES", ExactSpelling = true)]
|
||||
internal extern static void TexEnvxOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexEnvxv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexEnvxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexEnvxvOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexGenfOES", ExactSpelling = true)]
|
||||
internal extern static void TexGenfOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexGenfvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexGenfvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexGeniOES", ExactSpelling = true)]
|
||||
internal extern static void TexGeniOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexGenivOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexGenivOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexGenxOES", ExactSpelling = true)]
|
||||
internal extern static void TexGenxOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexGenxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexGenxvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void TexImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 internalformat, Int32 width, Int32 height, Int32 border, OpenTK.Graphics.ES11.All format, OpenTK.Graphics.ES11.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterf", ExactSpelling = true)]
|
||||
internal extern static void TexParameterf(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexParameterfv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameteri", ExactSpelling = true)]
|
||||
internal extern static void TexParameteri(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexParameteriv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterx", ExactSpelling = true)]
|
||||
internal extern static void TexParameterx(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterxOES", ExactSpelling = true)]
|
||||
internal extern static void TexParameterxOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterxv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexParameterxv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterxvOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexParameterxvOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void TexSubImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES11.All format, OpenTK.Graphics.ES11.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTranslatef", ExactSpelling = true)]
|
||||
internal extern static void Translatef(Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTranslatex", ExactSpelling = true)]
|
||||
internal extern static void Translatex(int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTranslatexOES", ExactSpelling = true)]
|
||||
internal extern static void TranslatexOES(int x, int y, int z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUnmapBufferOES", ExactSpelling = true)]
|
||||
internal extern static bool UnmapBufferOES(OpenTK.Graphics.ES11.All target);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexPointer", ExactSpelling = true)]
|
||||
internal extern static void VertexPointer(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glViewport", ExactSpelling = true)]
|
||||
internal extern static void Viewport(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glWeightPointerOES", ExactSpelling = true)]
|
||||
internal extern static void WeightPointerOES(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,787 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
namespace OpenTK.Graphics.ES11
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma warning disable 0649
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
|
||||
partial class GL
|
||||
{
|
||||
internal static partial class Delegates
|
||||
{
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ActiveTexture(OpenTK.Graphics.ES11.All texture);
|
||||
internal static ActiveTexture glActiveTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void AlphaFunc(OpenTK.Graphics.ES11.All func, Single @ref);
|
||||
internal static AlphaFunc glAlphaFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void AlphaFuncx(OpenTK.Graphics.ES11.All func, int @ref);
|
||||
internal static AlphaFuncx glAlphaFuncx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void AlphaFuncxOES(OpenTK.Graphics.ES11.All func, int @ref);
|
||||
internal static AlphaFuncxOES glAlphaFuncxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindBuffer(OpenTK.Graphics.ES11.All target, UInt32 buffer);
|
||||
internal static BindBuffer glBindBuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindFramebufferOES(OpenTK.Graphics.ES11.All target, UInt32 framebuffer);
|
||||
internal static BindFramebufferOES glBindFramebufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindRenderbufferOES(OpenTK.Graphics.ES11.All target, UInt32 renderbuffer);
|
||||
internal static BindRenderbufferOES glBindRenderbufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindTexture(OpenTK.Graphics.ES11.All target, UInt32 texture);
|
||||
internal static BindTexture glBindTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendEquationOES(OpenTK.Graphics.ES11.All mode);
|
||||
internal static BlendEquationOES glBlendEquationOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendEquationSeparateOES(OpenTK.Graphics.ES11.All modeRGB, OpenTK.Graphics.ES11.All modeAlpha);
|
||||
internal static BlendEquationSeparateOES glBlendEquationSeparateOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendFunc(OpenTK.Graphics.ES11.All sfactor, OpenTK.Graphics.ES11.All dfactor);
|
||||
internal static BlendFunc glBlendFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendFuncSeparateOES(OpenTK.Graphics.ES11.All srcRGB, OpenTK.Graphics.ES11.All dstRGB, OpenTK.Graphics.ES11.All srcAlpha, OpenTK.Graphics.ES11.All dstAlpha);
|
||||
internal static BlendFuncSeparateOES glBlendFuncSeparateOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BufferData(OpenTK.Graphics.ES11.All target, IntPtr size, IntPtr data, OpenTK.Graphics.ES11.All usage);
|
||||
internal static BufferData glBufferData;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BufferSubData(OpenTK.Graphics.ES11.All target, IntPtr offset, IntPtr size, IntPtr data);
|
||||
internal static BufferSubData glBufferSubData;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate OpenTK.Graphics.ES11.All CheckFramebufferStatusOES(OpenTK.Graphics.ES11.All target);
|
||||
internal static CheckFramebufferStatusOES glCheckFramebufferStatusOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Clear(UInt32 mask);
|
||||
internal static Clear glClear;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearColor(Single red, Single green, Single blue, Single alpha);
|
||||
internal static ClearColor glClearColor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearColorx(int red, int green, int blue, int alpha);
|
||||
internal static ClearColorx glClearColorx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearColorxOES(int red, int green, int blue, int alpha);
|
||||
internal static ClearColorxOES glClearColorxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthf(Single depth);
|
||||
internal static ClearDepthf glClearDepthf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthfOES(Single depth);
|
||||
internal static ClearDepthfOES glClearDepthfOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthx(int depth);
|
||||
internal static ClearDepthx glClearDepthx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthxOES(int depth);
|
||||
internal static ClearDepthxOES glClearDepthxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearStencil(Int32 s);
|
||||
internal static ClearStencil glClearStencil;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClientActiveTexture(OpenTK.Graphics.ES11.All texture);
|
||||
internal static ClientActiveTexture glClientActiveTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ClipPlanef(OpenTK.Graphics.ES11.All plane, Single* equation);
|
||||
internal unsafe static ClipPlanef glClipPlanef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ClipPlanefIMG(OpenTK.Graphics.ES11.All p, Single* eqn);
|
||||
internal unsafe static ClipPlanefIMG glClipPlanefIMG;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ClipPlanefOES(OpenTK.Graphics.ES11.All plane, Single* equation);
|
||||
internal unsafe static ClipPlanefOES glClipPlanefOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ClipPlanex(OpenTK.Graphics.ES11.All plane, int* equation);
|
||||
internal unsafe static ClipPlanex glClipPlanex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ClipPlanexIMG(OpenTK.Graphics.ES11.All p, int* eqn);
|
||||
internal unsafe static ClipPlanexIMG glClipPlanexIMG;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ClipPlanexOES(OpenTK.Graphics.ES11.All plane, int* equation);
|
||||
internal unsafe static ClipPlanexOES glClipPlanexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Color4f(Single red, Single green, Single blue, Single alpha);
|
||||
internal static Color4f glColor4f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Color4ub(Byte red, Byte green, Byte blue, Byte alpha);
|
||||
internal static Color4ub glColor4ub;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Color4x(int red, int green, int blue, int alpha);
|
||||
internal static Color4x glColor4x;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Color4xOES(int red, int green, int blue, int alpha);
|
||||
internal static Color4xOES glColor4xOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
internal static ColorMask glColorMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ColorPointer(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static ColorPointer glColorPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexImage2D(OpenTK.Graphics.ES11.All target, Int32 level, OpenTK.Graphics.ES11.All internalformat, Int32 width, Int32 height, Int32 border, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexImage2D glCompressedTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexSubImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES11.All format, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexSubImage2D glCompressedTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexImage2D(OpenTK.Graphics.ES11.All target, Int32 level, OpenTK.Graphics.ES11.All internalformat, Int32 x, Int32 y, Int32 width, Int32 height, Int32 border);
|
||||
internal static CopyTexImage2D glCopyTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexSubImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static CopyTexSubImage2D glCopyTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CullFace(OpenTK.Graphics.ES11.All mode);
|
||||
internal static CullFace glCullFace;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CurrentPaletteMatrixOES(UInt32 matrixpaletteindex);
|
||||
internal static CurrentPaletteMatrixOES glCurrentPaletteMatrixOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteBuffers(Int32 n, UInt32* buffers);
|
||||
internal unsafe static DeleteBuffers glDeleteBuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteFencesNV(Int32 n, UInt32* fences);
|
||||
internal unsafe static DeleteFencesNV glDeleteFencesNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteFramebuffersOES(Int32 n, UInt32* framebuffers);
|
||||
internal unsafe static DeleteFramebuffersOES glDeleteFramebuffersOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteRenderbuffersOES(Int32 n, UInt32* renderbuffers);
|
||||
internal unsafe static DeleteRenderbuffersOES glDeleteRenderbuffersOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteTextures(Int32 n, UInt32* textures);
|
||||
internal unsafe static DeleteTextures glDeleteTextures;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthFunc(OpenTK.Graphics.ES11.All func);
|
||||
internal static DepthFunc glDepthFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthMask(bool flag);
|
||||
internal static DepthMask glDepthMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangef(Single zNear, Single zFar);
|
||||
internal static DepthRangef glDepthRangef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangefOES(Single zNear, Single zFar);
|
||||
internal static DepthRangefOES glDepthRangefOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangex(int zNear, int zFar);
|
||||
internal static DepthRangex glDepthRangex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangexOES(int zNear, int zFar);
|
||||
internal static DepthRangexOES glDepthRangexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Disable(OpenTK.Graphics.ES11.All cap);
|
||||
internal static Disable glDisable;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DisableClientState(OpenTK.Graphics.ES11.All array);
|
||||
internal static DisableClientState glDisableClientState;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DisableDriverControlQCOM(UInt32 driverControl);
|
||||
internal static DisableDriverControlQCOM glDisableDriverControlQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawArrays(OpenTK.Graphics.ES11.All mode, Int32 first, Int32 count);
|
||||
internal static DrawArrays glDrawArrays;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawElements(OpenTK.Graphics.ES11.All mode, Int32 count, OpenTK.Graphics.ES11.All type, IntPtr indices);
|
||||
internal static DrawElements glDrawElements;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawTexfOES(Single x, Single y, Single z, Single width, Single height);
|
||||
internal static DrawTexfOES glDrawTexfOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DrawTexfvOES(Single* coords);
|
||||
internal unsafe static DrawTexfvOES glDrawTexfvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawTexiOES(Int32 x, Int32 y, Int32 z, Int32 width, Int32 height);
|
||||
internal static DrawTexiOES glDrawTexiOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DrawTexivOES(Int32* coords);
|
||||
internal unsafe static DrawTexivOES glDrawTexivOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawTexsOES(Int16 x, Int16 y, Int16 z, Int16 width, Int16 height);
|
||||
internal static DrawTexsOES glDrawTexsOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DrawTexsvOES(Int16* coords);
|
||||
internal unsafe static DrawTexsvOES glDrawTexsvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawTexxOES(int x, int y, int z, int width, int height);
|
||||
internal static DrawTexxOES glDrawTexxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DrawTexxvOES(int* coords);
|
||||
internal unsafe static DrawTexxvOES glDrawTexxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EGLImageTargetRenderbufferStorageOES(OpenTK.Graphics.ES11.All target, IntPtr image);
|
||||
internal static EGLImageTargetRenderbufferStorageOES glEGLImageTargetRenderbufferStorageOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EGLImageTargetTexture2DOES(OpenTK.Graphics.ES11.All target, IntPtr image);
|
||||
internal static EGLImageTargetTexture2DOES glEGLImageTargetTexture2DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Enable(OpenTK.Graphics.ES11.All cap);
|
||||
internal static Enable glEnable;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EnableClientState(OpenTK.Graphics.ES11.All array);
|
||||
internal static EnableClientState glEnableClientState;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EnableDriverControlQCOM(UInt32 driverControl);
|
||||
internal static EnableDriverControlQCOM glEnableDriverControlQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Finish();
|
||||
internal static Finish glFinish;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FinishFenceNV(UInt32 fence);
|
||||
internal static FinishFenceNV glFinishFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Flush();
|
||||
internal static Flush glFlush;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Fogf(OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static Fogf glFogf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Fogfv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static Fogfv glFogfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Fogx(OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static Fogx glFogx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FogxOES(OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static FogxOES glFogxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Fogxv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static Fogxv glFogxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void FogxvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static FogxvOES glFogxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FramebufferRenderbufferOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All attachment, OpenTK.Graphics.ES11.All renderbuffertarget, UInt32 renderbuffer);
|
||||
internal static FramebufferRenderbufferOES glFramebufferRenderbufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FramebufferTexture2DOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All attachment, OpenTK.Graphics.ES11.All textarget, UInt32 texture, Int32 level);
|
||||
internal static FramebufferTexture2DOES glFramebufferTexture2DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FrontFace(OpenTK.Graphics.ES11.All mode);
|
||||
internal static FrontFace glFrontFace;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Frustumf(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
internal static Frustumf glFrustumf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FrustumfOES(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
internal static FrustumfOES glFrustumfOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Frustumx(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
internal static Frustumx glFrustumx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FrustumxOES(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
internal static FrustumxOES glFrustumxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenBuffers(Int32 n, UInt32* buffers);
|
||||
internal unsafe static GenBuffers glGenBuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GenerateMipmapOES(OpenTK.Graphics.ES11.All target);
|
||||
internal static GenerateMipmapOES glGenerateMipmapOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenFencesNV(Int32 n, UInt32* fences);
|
||||
internal unsafe static GenFencesNV glGenFencesNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenFramebuffersOES(Int32 n, UInt32* framebuffers);
|
||||
internal unsafe static GenFramebuffersOES glGenFramebuffersOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenRenderbuffersOES(Int32 n, UInt32* renderbuffers);
|
||||
internal unsafe static GenRenderbuffersOES glGenRenderbuffersOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenTextures(Int32 n, UInt32* textures);
|
||||
internal unsafe static GenTextures glGenTextures;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetBooleanv(OpenTK.Graphics.ES11.All pname, bool* @params);
|
||||
internal unsafe static GetBooleanv glGetBooleanv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetBufferParameteriv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetBufferParameteriv glGetBufferParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GetBufferPointervOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, IntPtr @params);
|
||||
internal static GetBufferPointervOES glGetBufferPointervOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetClipPlanef(OpenTK.Graphics.ES11.All pname, Single* eqn);
|
||||
internal unsafe static GetClipPlanef glGetClipPlanef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetClipPlanefOES(OpenTK.Graphics.ES11.All pname, Single* eqn);
|
||||
internal unsafe static GetClipPlanefOES glGetClipPlanefOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetClipPlanex(OpenTK.Graphics.ES11.All pname, int* eqn);
|
||||
internal unsafe static GetClipPlanex glGetClipPlanex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetClipPlanexOES(OpenTK.Graphics.ES11.All pname, int* eqn);
|
||||
internal unsafe static GetClipPlanexOES glGetClipPlanexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetDriverControlsQCOM(Int32* num, Int32 size, UInt32* driverControls);
|
||||
internal unsafe static GetDriverControlsQCOM glGetDriverControlsQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetDriverControlStringQCOM(UInt32 driverControl, Int32 bufSize, Int32* length, String driverControlString);
|
||||
internal unsafe static GetDriverControlStringQCOM glGetDriverControlStringQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate OpenTK.Graphics.ES11.All GetError();
|
||||
internal static GetError glGetError;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFenceivNV(UInt32 fence, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetFenceivNV glGetFenceivNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFixedv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetFixedv glGetFixedv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFixedvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetFixedvOES glGetFixedvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFloatv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static GetFloatv glGetFloatv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFramebufferAttachmentParameterivOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All attachment, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetFramebufferAttachmentParameterivOES glGetFramebufferAttachmentParameterivOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetIntegerv(OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetIntegerv glGetIntegerv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetLightfv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static GetLightfv glGetLightfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetLightxv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetLightxv glGetLightxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetLightxvOES(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetLightxvOES glGetLightxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetMaterialfv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static GetMaterialfv glGetMaterialfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetMaterialxv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetMaterialxv glGetMaterialxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetMaterialxvOES(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetMaterialxvOES glGetMaterialxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GetPointerv(OpenTK.Graphics.ES11.All pname, IntPtr @params);
|
||||
internal static GetPointerv glGetPointerv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetRenderbufferParameterivOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetRenderbufferParameterivOES glGetRenderbufferParameterivOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate System.IntPtr GetString(OpenTK.Graphics.ES11.All name);
|
||||
internal unsafe static GetString glGetString;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexEnvfv(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static GetTexEnvfv glGetTexEnvfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexEnviv(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetTexEnviv glGetTexEnviv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexEnvxv(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetTexEnvxv glGetTexEnvxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexEnvxvOES(OpenTK.Graphics.ES11.All env, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetTexEnvxvOES glGetTexEnvxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexGenfvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static GetTexGenfvOES glGetTexGenfvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexGenivOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetTexGenivOES glGetTexGenivOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexGenxvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetTexGenxvOES glGetTexGenxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexParameterfv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static GetTexParameterfv glGetTexParameterfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexParameteriv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static GetTexParameteriv glGetTexParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexParameterxv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetTexParameterxv glGetTexParameterxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexParameterxvOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static GetTexParameterxvOES glGetTexParameterxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Hint(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All mode);
|
||||
internal static Hint glHint;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsBuffer(UInt32 buffer);
|
||||
internal static IsBuffer glIsBuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsEnabled(OpenTK.Graphics.ES11.All cap);
|
||||
internal static IsEnabled glIsEnabled;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsFenceNV(UInt32 fence);
|
||||
internal static IsFenceNV glIsFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsFramebufferOES(UInt32 framebuffer);
|
||||
internal static IsFramebufferOES glIsFramebufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsRenderbufferOES(UInt32 renderbuffer);
|
||||
internal static IsRenderbufferOES glIsRenderbufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsTexture(UInt32 texture);
|
||||
internal static IsTexture glIsTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Lightf(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static Lightf glLightf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Lightfv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static Lightfv glLightfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LightModelf(OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static LightModelf glLightModelf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LightModelfv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static LightModelfv glLightModelfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LightModelx(OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static LightModelx glLightModelx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LightModelxOES(OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static LightModelxOES glLightModelxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LightModelxv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static LightModelxv glLightModelxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LightModelxvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static LightModelxvOES glLightModelxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Lightx(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static Lightx glLightx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LightxOES(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static LightxOES glLightxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Lightxv(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static Lightxv glLightxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LightxvOES(OpenTK.Graphics.ES11.All light, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static LightxvOES glLightxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LineWidth(Single width);
|
||||
internal static LineWidth glLineWidth;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LineWidthx(int width);
|
||||
internal static LineWidthx glLineWidthx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LineWidthxOES(int width);
|
||||
internal static LineWidthxOES glLineWidthxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LoadIdentity();
|
||||
internal static LoadIdentity glLoadIdentity;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LoadMatrixf(Single* m);
|
||||
internal unsafe static LoadMatrixf glLoadMatrixf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LoadMatrixx(int* m);
|
||||
internal unsafe static LoadMatrixx glLoadMatrixx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void LoadMatrixxOES(int* m);
|
||||
internal unsafe static LoadMatrixxOES glLoadMatrixxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LoadPaletteFromModelViewMatrixOES();
|
||||
internal static LoadPaletteFromModelViewMatrixOES glLoadPaletteFromModelViewMatrixOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LogicOp(OpenTK.Graphics.ES11.All opcode);
|
||||
internal static LogicOp glLogicOp;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate System.IntPtr MapBufferOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All access);
|
||||
internal unsafe static MapBufferOES glMapBufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Materialf(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static Materialf glMaterialf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Materialfv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static Materialfv glMaterialfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Materialx(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static Materialx glMaterialx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MaterialxOES(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static MaterialxOES glMaterialxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Materialxv(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static Materialxv glMaterialxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MaterialxvOES(OpenTK.Graphics.ES11.All face, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static MaterialxvOES glMaterialxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MatrixIndexPointerOES(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static MatrixIndexPointerOES glMatrixIndexPointerOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MatrixMode(OpenTK.Graphics.ES11.All mode);
|
||||
internal static MatrixMode glMatrixMode;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MultiTexCoord4f(OpenTK.Graphics.ES11.All target, Single s, Single t, Single r, Single q);
|
||||
internal static MultiTexCoord4f glMultiTexCoord4f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MultiTexCoord4x(OpenTK.Graphics.ES11.All target, int s, int t, int r, int q);
|
||||
internal static MultiTexCoord4x glMultiTexCoord4x;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void MultiTexCoord4xOES(OpenTK.Graphics.ES11.All target, int s, int t, int r, int q);
|
||||
internal static MultiTexCoord4xOES glMultiTexCoord4xOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultMatrixf(Single* m);
|
||||
internal unsafe static MultMatrixf glMultMatrixf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultMatrixx(int* m);
|
||||
internal unsafe static MultMatrixx glMultMatrixx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultMatrixxOES(int* m);
|
||||
internal unsafe static MultMatrixxOES glMultMatrixxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Normal3f(Single nx, Single ny, Single nz);
|
||||
internal static Normal3f glNormal3f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Normal3x(int nx, int ny, int nz);
|
||||
internal static Normal3x glNormal3x;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Normal3xOES(int nx, int ny, int nz);
|
||||
internal static Normal3xOES glNormal3xOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void NormalPointer(OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static NormalPointer glNormalPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Orthof(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
internal static Orthof glOrthof;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void OrthofOES(Single left, Single right, Single bottom, Single top, Single zNear, Single zFar);
|
||||
internal static OrthofOES glOrthofOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Orthox(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
internal static Orthox glOrthox;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void OrthoxOES(int left, int right, int bottom, int top, int zNear, int zFar);
|
||||
internal static OrthoxOES glOrthoxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PixelStorei(OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
internal static PixelStorei glPixelStorei;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointParameterf(OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static PointParameterf glPointParameterf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void PointParameterfv(OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static PointParameterfv glPointParameterfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointParameterx(OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static PointParameterx glPointParameterx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointParameterxOES(OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static PointParameterxOES glPointParameterxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void PointParameterxv(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static PointParameterxv glPointParameterxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void PointParameterxvOES(OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static PointParameterxvOES glPointParameterxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointSize(Single size);
|
||||
internal static PointSize glPointSize;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointSizePointerOES(OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static PointSizePointerOES glPointSizePointerOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointSizex(int size);
|
||||
internal static PointSizex glPointSizex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PointSizexOES(int size);
|
||||
internal static PointSizexOES glPointSizexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PolygonOffset(Single factor, Single units);
|
||||
internal static PolygonOffset glPolygonOffset;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PolygonOffsetx(int factor, int units);
|
||||
internal static PolygonOffsetx glPolygonOffsetx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PolygonOffsetxOES(int factor, int units);
|
||||
internal static PolygonOffsetxOES glPolygonOffsetxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PopMatrix();
|
||||
internal static PopMatrix glPopMatrix;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PushMatrix();
|
||||
internal static PushMatrix glPushMatrix;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate Int32 QueryMatrixxOES(int* mantissa, Int32* exponent);
|
||||
internal unsafe static QueryMatrixxOES glQueryMatrixxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ReadPixels(Int32 x, Int32 y, Int32 width, Int32 height, OpenTK.Graphics.ES11.All format, OpenTK.Graphics.ES11.All type, IntPtr pixels);
|
||||
internal static ReadPixels glReadPixels;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void RenderbufferStorageOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All internalformat, Int32 width, Int32 height);
|
||||
internal static RenderbufferStorageOES glRenderbufferStorageOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Rotatef(Single angle, Single x, Single y, Single z);
|
||||
internal static Rotatef glRotatef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Rotatex(int angle, int x, int y, int z);
|
||||
internal static Rotatex glRotatex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void RotatexOES(int angle, int x, int y, int z);
|
||||
internal static RotatexOES glRotatexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SampleCoverage(Single value, bool invert);
|
||||
internal static SampleCoverage glSampleCoverage;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SampleCoveragex(int value, bool invert);
|
||||
internal static SampleCoveragex glSampleCoveragex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SampleCoveragexOES(int value, bool invert);
|
||||
internal static SampleCoveragexOES glSampleCoveragexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scalef(Single x, Single y, Single z);
|
||||
internal static Scalef glScalef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scalex(int x, int y, int z);
|
||||
internal static Scalex glScalex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ScalexOES(int x, int y, int z);
|
||||
internal static ScalexOES glScalexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scissor(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static Scissor glScissor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SetFenceNV(UInt32 fence, OpenTK.Graphics.ES11.All condition);
|
||||
internal static SetFenceNV glSetFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ShadeModel(OpenTK.Graphics.ES11.All mode);
|
||||
internal static ShadeModel glShadeModel;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilFunc(OpenTK.Graphics.ES11.All func, Int32 @ref, UInt32 mask);
|
||||
internal static StencilFunc glStencilFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilMask(UInt32 mask);
|
||||
internal static StencilMask glStencilMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilOp(OpenTK.Graphics.ES11.All fail, OpenTK.Graphics.ES11.All zfail, OpenTK.Graphics.ES11.All zpass);
|
||||
internal static StencilOp glStencilOp;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool TestFenceNV(UInt32 fence);
|
||||
internal static TestFenceNV glTestFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexCoordPointer(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static TexCoordPointer glTexCoordPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexEnvf(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static TexEnvf glTexEnvf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexEnvfv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static TexEnvfv glTexEnvfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexEnvi(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
internal static TexEnvi glTexEnvi;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexEnviv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static TexEnviv glTexEnviv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexEnvx(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static TexEnvx glTexEnvx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexEnvxOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static TexEnvxOES glTexEnvxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexEnvxv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static TexEnvxv glTexEnvxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexEnvxvOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static TexEnvxvOES glTexEnvxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexGenfOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static TexGenfOES glTexGenfOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexGenfvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static TexGenfvOES glTexGenfvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexGeniOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
internal static TexGeniOES glTexGeniOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexGenivOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static TexGenivOES glTexGenivOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexGenxOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static TexGenxOES glTexGenxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexGenxvOES(OpenTK.Graphics.ES11.All coord, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static TexGenxvOES glTexGenxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 internalformat, Int32 width, Int32 height, Int32 border, OpenTK.Graphics.ES11.All format, OpenTK.Graphics.ES11.All type, IntPtr pixels);
|
||||
internal static TexImage2D glTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameterf(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single param);
|
||||
internal static TexParameterf glTexParameterf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexParameterfv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Single* @params);
|
||||
internal unsafe static TexParameterfv glTexParameterfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameteri(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32 param);
|
||||
internal static TexParameteri glTexParameteri;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexParameteriv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, Int32* @params);
|
||||
internal unsafe static TexParameteriv glTexParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameterx(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static TexParameterx glTexParameterx;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameterxOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int param);
|
||||
internal static TexParameterxOES glTexParameterxOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexParameterxv(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static TexParameterxv glTexParameterxv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexParameterxvOES(OpenTK.Graphics.ES11.All target, OpenTK.Graphics.ES11.All pname, int* @params);
|
||||
internal unsafe static TexParameterxvOES glTexParameterxvOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexSubImage2D(OpenTK.Graphics.ES11.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES11.All format, OpenTK.Graphics.ES11.All type, IntPtr pixels);
|
||||
internal static TexSubImage2D glTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Translatef(Single x, Single y, Single z);
|
||||
internal static Translatef glTranslatef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Translatex(int x, int y, int z);
|
||||
internal static Translatex glTranslatex;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TranslatexOES(int x, int y, int z);
|
||||
internal static TranslatexOES glTranslatexOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool UnmapBufferOES(OpenTK.Graphics.ES11.All target);
|
||||
internal static UnmapBufferOES glUnmapBufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexPointer(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static VertexPointer glVertexPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Viewport(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static Viewport glViewport;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void WeightPointerOES(Int32 size, OpenTK.Graphics.ES11.All type, Int32 stride, IntPtr pointer);
|
||||
internal static WeightPointerOES glWeightPointerOES;
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,136 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
/* flibit Changes GraphicsContext stuff to IntPtr, an SDL_GLContext. */
|
||||
|
||||
namespace OpenTK.Graphics.ES11
|
||||
{
|
||||
// Used in debug-mode only, for automatic OpenGL error-checking.
|
||||
//
|
||||
// Works like this: an instance is created before each OpenGL function is called.
|
||||
// The constructor resets the OpenGL error state. Once the native function returns,
|
||||
// the error state is checked again, raising the relevant exceptions.
|
||||
//
|
||||
// A using-region is used to ensure Dispose() is called.
|
||||
//
|
||||
// Make sure that no error checking is added to the GetError function,
|
||||
// as that would cause infinite recursion!
|
||||
struct ErrorHelper : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
static readonly object SyncRoot = new object();
|
||||
static readonly Dictionary<IntPtr, List<ErrorCode>> ContextErrors =
|
||||
new Dictionary<IntPtr, List<ErrorCode>>();
|
||||
readonly IntPtr Context;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ErrorHelper(IntPtr context)
|
||||
{
|
||||
if (context == IntPtr.Zero)
|
||||
throw new GraphicsContextMissingException();
|
||||
|
||||
Context = context;
|
||||
lock (SyncRoot)
|
||||
{
|
||||
if (!ContextErrors.ContainsKey(Context))
|
||||
ContextErrors.Add(Context, new List<ErrorCode>());
|
||||
}
|
||||
ResetErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
// Retrieve all OpenGL errors to clear the error list.
|
||||
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
|
||||
[Conditional("DEBUG")]
|
||||
internal void ResetErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
while ((ErrorCode)GL.GetError() != ErrorCode.NoError)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve all OpenGL errors and throw an exception if anything other than NoError is returned.
|
||||
[Conditional("DEBUG")]
|
||||
internal void CheckErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
List<ErrorCode> error_list = ContextErrors[Context];
|
||||
error_list.Clear();
|
||||
ErrorCode error;
|
||||
do
|
||||
{
|
||||
error = (ErrorCode)GL.GetError();
|
||||
error_list.Add(error);
|
||||
} while (error != ErrorCode.NoError);
|
||||
|
||||
if (error_list.Count != 1)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (ErrorCode e in error_list)
|
||||
{
|
||||
if (e != ErrorCode.NoError)
|
||||
{
|
||||
sb.Append(e.ToString());
|
||||
sb.Append(", ");
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
sb.Remove(sb.Length - 2, 2); // Remove the last comma
|
||||
|
||||
throw new GraphicsErrorException(sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CheckErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenTK.Graphics.ES11
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides access to OpenGL ES 1.1 methods.
|
||||
/// </summary>
|
||||
|
||||
public sealed partial class GL : GraphicsBindingsBase
|
||||
{
|
||||
const string Library = "libGLES.dll";
|
||||
static readonly object sync_root = new object();
|
||||
|
||||
#region --- Protected Members ---
|
||||
|
||||
/// <summary>
|
||||
/// Returns a synchronization token unique for the GL class.
|
||||
/// </summary>
|
||||
protected override object SyncRoot
|
||||
{
|
||||
get { return sync_root; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,662 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
namespace OpenTK.Graphics.ES20
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
|
||||
partial class GL
|
||||
{
|
||||
|
||||
internal static partial class Core
|
||||
{
|
||||
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glActiveTexture", ExactSpelling = true)]
|
||||
internal extern static void ActiveTexture(OpenTK.Graphics.ES20.TextureUnit texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glAttachShader", ExactSpelling = true)]
|
||||
internal extern static void AttachShader(UInt32 program, UInt32 shader);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBeginPerfMonitorAMD", ExactSpelling = true)]
|
||||
internal extern static void BeginPerfMonitorAMD(UInt32 monitor);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindAttribLocation", ExactSpelling = true)]
|
||||
internal extern static void BindAttribLocation(UInt32 program, UInt32 index, String name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindBuffer", ExactSpelling = true)]
|
||||
internal extern static void BindBuffer(OpenTK.Graphics.ES20.BufferTarget target, UInt32 buffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindFramebuffer", ExactSpelling = true)]
|
||||
internal extern static void BindFramebuffer(OpenTK.Graphics.ES20.FramebufferTarget target, UInt32 framebuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindRenderbuffer", ExactSpelling = true)]
|
||||
internal extern static void BindRenderbuffer(OpenTK.Graphics.ES20.RenderbufferTarget target, UInt32 renderbuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindTexture", ExactSpelling = true)]
|
||||
internal extern static void BindTexture(OpenTK.Graphics.ES20.TextureTarget target, UInt32 texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindVertexArrayOES", ExactSpelling = true)]
|
||||
internal extern static void BindVertexArrayOES(UInt32 array);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendColor", ExactSpelling = true)]
|
||||
internal extern static void BlendColor(Single red, Single green, Single blue, Single alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendEquation", ExactSpelling = true)]
|
||||
internal extern static void BlendEquation(OpenTK.Graphics.ES20.BlendEquationMode mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendEquationSeparate", ExactSpelling = true)]
|
||||
internal extern static void BlendEquationSeparate(OpenTK.Graphics.ES20.BlendEquationMode modeRGB, OpenTK.Graphics.ES20.BlendEquationMode modeAlpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendFunc", ExactSpelling = true)]
|
||||
internal extern static void BlendFunc(OpenTK.Graphics.ES20.BlendingFactorSrc sfactor, OpenTK.Graphics.ES20.BlendingFactorDest dfactor);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlendFuncSeparate", ExactSpelling = true)]
|
||||
internal extern static void BlendFuncSeparate(OpenTK.Graphics.ES20.BlendingFactorSrc srcRGB, OpenTK.Graphics.ES20.BlendingFactorDest dstRGB, OpenTK.Graphics.ES20.BlendingFactorSrc srcAlpha, OpenTK.Graphics.ES20.BlendingFactorDest dstAlpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBlitFramebufferANGLE", ExactSpelling = true)]
|
||||
internal extern static void BlitFramebufferANGLE(Int32 srcX0, Int32 srcY0, Int32 srcX1, Int32 srcY1, Int32 dstX0, Int32 dstY0, Int32 dstX1, Int32 dstY1, UInt32 mask, OpenTK.Graphics.ES20.All filter);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBufferData", ExactSpelling = true)]
|
||||
internal extern static void BufferData(OpenTK.Graphics.ES20.BufferTarget target, IntPtr size, IntPtr data, OpenTK.Graphics.ES20.BufferUsage usage);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBufferSubData", ExactSpelling = true)]
|
||||
internal extern static void BufferSubData(OpenTK.Graphics.ES20.BufferTarget target, IntPtr offset, IntPtr size, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCheckFramebufferStatus", ExactSpelling = true)]
|
||||
internal extern static OpenTK.Graphics.ES20.FramebufferErrorCode CheckFramebufferStatus(OpenTK.Graphics.ES20.FramebufferTarget target);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClear", ExactSpelling = true)]
|
||||
internal extern static void Clear(OpenTK.Graphics.ES20.ClearBufferMask mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearColor", ExactSpelling = true)]
|
||||
internal extern static void ClearColor(Single red, Single green, Single blue, Single alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearDepthf", ExactSpelling = true)]
|
||||
internal extern static void ClearDepthf(Single depth);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glClearStencil", ExactSpelling = true)]
|
||||
internal extern static void ClearStencil(Int32 s);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glColorMask", ExactSpelling = true)]
|
||||
internal extern static void ColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompileShader", ExactSpelling = true)]
|
||||
internal extern static void CompileShader(UInt32 shader);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, OpenTK.Graphics.ES20.PixelInternalFormat internalformat, Int32 width, Int32 height, Int32 border, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexImage3DOES", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, OpenTK.Graphics.ES20.All internalformat, Int32 width, Int32 height, Int32 depth, Int32 border, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexSubImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES20.PixelFormat format, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCompressedTexSubImage3DOES", ExactSpelling = true)]
|
||||
internal extern static void CompressedTexSubImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 width, Int32 height, Int32 depth, OpenTK.Graphics.ES20.All format, Int32 imageSize, IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void CopyTexImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, OpenTK.Graphics.ES20.PixelInternalFormat internalformat, Int32 x, Int32 y, Int32 width, Int32 height, Int32 border);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void CopyTexSubImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyTexSubImage3DOES", ExactSpelling = true)]
|
||||
internal extern static void CopyTexSubImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCoverageMaskNV", ExactSpelling = true)]
|
||||
internal extern static void CoverageMaskNV(bool mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCoverageOperationNV", ExactSpelling = true)]
|
||||
internal extern static void CoverageOperationNV(OpenTK.Graphics.ES20.All operation);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCreateProgram", ExactSpelling = true)]
|
||||
internal extern static Int32 CreateProgram();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCreateShader", ExactSpelling = true)]
|
||||
internal extern static Int32 CreateShader(OpenTK.Graphics.ES20.ShaderType type);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCullFace", ExactSpelling = true)]
|
||||
internal extern static void CullFace(OpenTK.Graphics.ES20.CullFaceMode mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteBuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteBuffers(Int32 n, UInt32* buffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteFencesNV", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteFencesNV(Int32 n, UInt32* fences);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteFramebuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteFramebuffers(Int32 n, UInt32* framebuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeletePerfMonitorsAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeletePerfMonitorsAMD(Int32 n, UInt32* monitors);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteProgram", ExactSpelling = true)]
|
||||
internal extern static void DeleteProgram(UInt32 program);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteRenderbuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteRenderbuffers(Int32 n, UInt32* renderbuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteShader", ExactSpelling = true)]
|
||||
internal extern static void DeleteShader(UInt32 shader);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteTextures", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteTextures(Int32 n, UInt32* textures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDeleteVertexArraysOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void DeleteVertexArraysOES(Int32 n, UInt32* arrays);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthFunc", ExactSpelling = true)]
|
||||
internal extern static void DepthFunc(OpenTK.Graphics.ES20.DepthFunction func);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthMask", ExactSpelling = true)]
|
||||
internal extern static void DepthMask(bool flag);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDepthRangef", ExactSpelling = true)]
|
||||
internal extern static void DepthRangef(Single zNear, Single zFar);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDetachShader", ExactSpelling = true)]
|
||||
internal extern static void DetachShader(UInt32 program, UInt32 shader);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisable", ExactSpelling = true)]
|
||||
internal extern static void Disable(OpenTK.Graphics.ES20.EnableCap cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisableDriverControlQCOM", ExactSpelling = true)]
|
||||
internal extern static void DisableDriverControlQCOM(UInt32 driverControl);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDisableVertexAttribArray", ExactSpelling = true)]
|
||||
internal extern static void DisableVertexAttribArray(UInt32 index);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDiscardFramebufferEXT", ExactSpelling = true)]
|
||||
internal extern static unsafe void DiscardFramebufferEXT(OpenTK.Graphics.ES20.All target, Int32 numAttachments, OpenTK.Graphics.ES20.All* attachments);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawArrays", ExactSpelling = true)]
|
||||
internal extern static void DrawArrays(OpenTK.Graphics.ES20.BeginMode mode, Int32 first, Int32 count);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawElements", ExactSpelling = true)]
|
||||
internal extern static void DrawElements(OpenTK.Graphics.ES20.BeginMode mode, Int32 count, OpenTK.Graphics.ES20.DrawElementsType type, IntPtr indices);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEGLImageTargetRenderbufferStorageOES", ExactSpelling = true)]
|
||||
internal extern static void EGLImageTargetRenderbufferStorageOES(OpenTK.Graphics.ES20.All target, IntPtr image);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEGLImageTargetTexture2DOES", ExactSpelling = true)]
|
||||
internal extern static void EGLImageTargetTexture2DOES(OpenTK.Graphics.ES20.All target, IntPtr image);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnable", ExactSpelling = true)]
|
||||
internal extern static void Enable(OpenTK.Graphics.ES20.EnableCap cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnableDriverControlQCOM", ExactSpelling = true)]
|
||||
internal extern static void EnableDriverControlQCOM(UInt32 driverControl);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEnableVertexAttribArray", ExactSpelling = true)]
|
||||
internal extern static void EnableVertexAttribArray(UInt32 index);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEndPerfMonitorAMD", ExactSpelling = true)]
|
||||
internal extern static void EndPerfMonitorAMD(UInt32 monitor);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glEndTilingQCOM", ExactSpelling = true)]
|
||||
internal extern static void EndTilingQCOM(UInt32 preserveMask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetBufferPointervQCOM", ExactSpelling = true)]
|
||||
internal extern static void ExtGetBufferPointervQCOM(OpenTK.Graphics.ES20.All target, IntPtr @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetBuffersQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetBuffersQCOM(UInt32* buffers, Int32 maxBuffers, Int32* numBuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetFramebuffersQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetFramebuffersQCOM(UInt32* framebuffers, Int32 maxFramebuffers, Int32* numFramebuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetProgramBinarySourceQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetProgramBinarySourceQCOM(UInt32 program, OpenTK.Graphics.ES20.All shadertype, String source, Int32* length);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetProgramsQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetProgramsQCOM(UInt32* programs, Int32 maxPrograms, Int32* numPrograms);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetRenderbuffersQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetRenderbuffersQCOM(UInt32* renderbuffers, Int32 maxRenderbuffers, Int32* numRenderbuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetShadersQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetShadersQCOM(UInt32* shaders, Int32 maxShaders, Int32* numShaders);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetTexLevelParameterivQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetTexLevelParameterivQCOM(UInt32 texture, OpenTK.Graphics.ES20.All face, Int32 level, OpenTK.Graphics.ES20.All pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetTexSubImageQCOM", ExactSpelling = true)]
|
||||
internal extern static void ExtGetTexSubImageQCOM(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 width, Int32 height, Int32 depth, OpenTK.Graphics.ES20.All format, OpenTK.Graphics.ES20.All type, IntPtr texels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtGetTexturesQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void ExtGetTexturesQCOM(UInt32* textures, Int32 maxTextures, Int32* numTextures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtIsProgramBinaryQCOM", ExactSpelling = true)]
|
||||
internal extern static bool ExtIsProgramBinaryQCOM(UInt32 program);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glExtTexObjectStateOverrideiQCOM", ExactSpelling = true)]
|
||||
internal extern static void ExtTexObjectStateOverrideiQCOM(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFinish", ExactSpelling = true)]
|
||||
internal extern static void Finish();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFinishFenceNV", ExactSpelling = true)]
|
||||
internal extern static void FinishFenceNV(UInt32 fence);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFlush", ExactSpelling = true)]
|
||||
internal extern static void Flush();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFramebufferRenderbuffer", ExactSpelling = true)]
|
||||
internal extern static void FramebufferRenderbuffer(OpenTK.Graphics.ES20.FramebufferTarget target, OpenTK.Graphics.ES20.FramebufferSlot attachment, OpenTK.Graphics.ES20.RenderbufferTarget renderbuffertarget, UInt32 renderbuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFramebufferTexture2D", ExactSpelling = true)]
|
||||
internal extern static void FramebufferTexture2D(OpenTK.Graphics.ES20.FramebufferTarget target, OpenTK.Graphics.ES20.FramebufferSlot attachment, OpenTK.Graphics.ES20.TextureTarget textarget, UInt32 texture, Int32 level);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFramebufferTexture2DMultisampleIMG", ExactSpelling = true)]
|
||||
internal extern static void FramebufferTexture2DMultisampleIMG();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFramebufferTexture3DOES", ExactSpelling = true)]
|
||||
internal extern static void FramebufferTexture3DOES(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All attachment, OpenTK.Graphics.ES20.All textarget, UInt32 texture, Int32 level, Int32 zoffset);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFrontFace", ExactSpelling = true)]
|
||||
internal extern static void FrontFace(OpenTK.Graphics.ES20.FrontFaceDirection mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenBuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenBuffers(Int32 n, [OutAttribute] UInt32* buffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenerateMipmap", ExactSpelling = true)]
|
||||
internal extern static void GenerateMipmap(OpenTK.Graphics.ES20.TextureTarget target);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenFencesNV", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenFencesNV(Int32 n, [OutAttribute] UInt32* fences);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenFramebuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenFramebuffers(Int32 n, [OutAttribute] UInt32* framebuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenPerfMonitorsAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenPerfMonitorsAMD(Int32 n, [OutAttribute] UInt32* monitors);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenRenderbuffers", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenRenderbuffers(Int32 n, [OutAttribute] UInt32* renderbuffers);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenTextures", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenTextures(Int32 n, [OutAttribute] UInt32* textures);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGenVertexArraysOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GenVertexArraysOES(Int32 n, [OutAttribute] UInt32* arrays);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetActiveAttrib", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetActiveAttrib(UInt32 program, UInt32 index, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] Int32* size, [OutAttribute] OpenTK.Graphics.ES20.ActiveAttribType* type, [OutAttribute] StringBuilder name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetActiveUniform", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetActiveUniform(UInt32 program, UInt32 index, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] Int32* size, [OutAttribute] OpenTK.Graphics.ES20.ActiveUniformType* type, [OutAttribute] StringBuilder name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetAttachedShaders", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetAttachedShaders(UInt32 program, Int32 maxcount, [OutAttribute] Int32* count, [OutAttribute] UInt32* shaders);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetAttribLocation", ExactSpelling = true)]
|
||||
internal extern static int GetAttribLocation(UInt32 program, String name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBooleanv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetBooleanv(OpenTK.Graphics.ES20.GetPName pname, [OutAttribute] bool* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBufferParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetBufferParameteriv(OpenTK.Graphics.ES20.BufferTarget target, OpenTK.Graphics.ES20.BufferParameterName pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBufferPointervOES", ExactSpelling = true)]
|
||||
internal extern static void GetBufferPointervOES(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All pname, [OutAttribute] IntPtr @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetDriverControlsQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetDriverControlsQCOM([OutAttribute] Int32* num, Int32 size, [OutAttribute] UInt32* driverControls);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetDriverControlStringQCOM", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetDriverControlStringQCOM(UInt32 driverControl, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder driverControlString);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetError", ExactSpelling = true)]
|
||||
internal extern static OpenTK.Graphics.ES20.ErrorCode GetError();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFenceivNV", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFenceivNV(UInt32 fence, OpenTK.Graphics.ES20.All pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFloatv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFloatv(OpenTK.Graphics.ES20.GetPName pname, [OutAttribute] Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetFramebufferAttachmentParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetFramebufferAttachmentParameteriv(OpenTK.Graphics.ES20.FramebufferTarget target, OpenTK.Graphics.ES20.FramebufferSlot attachment, OpenTK.Graphics.ES20.FramebufferParameterName pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetIntegerv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetIntegerv(OpenTK.Graphics.ES20.GetPName pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPerfMonitorCounterDataAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetPerfMonitorCounterDataAMD(UInt32 monitor, OpenTK.Graphics.ES20.All pname, Int32 dataSize, [OutAttribute] UInt32* data, [OutAttribute] Int32* bytesWritten);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPerfMonitorCounterInfoAMD", ExactSpelling = true)]
|
||||
internal extern static void GetPerfMonitorCounterInfoAMD(UInt32 group, UInt32 counter, OpenTK.Graphics.ES20.All pname, [OutAttribute] IntPtr data);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPerfMonitorCountersAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetPerfMonitorCountersAMD(UInt32 group, [OutAttribute] Int32* numCounters, [OutAttribute] Int32* maxActiveCounters, Int32 counterSize, [OutAttribute] UInt32* counters);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPerfMonitorCounterStringAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetPerfMonitorCounterStringAMD(UInt32 group, UInt32 counter, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder counterString);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPerfMonitorGroupsAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetPerfMonitorGroupsAMD([OutAttribute] Int32* numGroups, Int32 groupsSize, [OutAttribute] UInt32* groups);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetPerfMonitorGroupStringAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetPerfMonitorGroupStringAMD(UInt32 group, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder groupString);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetProgramBinaryOES", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetProgramBinaryOES(UInt32 program, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] OpenTK.Graphics.ES20.All* binaryFormat, [OutAttribute] IntPtr binary);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetProgramInfoLog", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetProgramInfoLog(UInt32 program, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder infolog);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetProgramiv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetProgramiv(UInt32 program, OpenTK.Graphics.ES20.ProgramParameter pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetRenderbufferParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetRenderbufferParameteriv(OpenTK.Graphics.ES20.RenderbufferTarget target, OpenTK.Graphics.ES20.RenderbufferParameterName pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetShaderInfoLog", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetShaderInfoLog(UInt32 shader, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder infolog);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetShaderiv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetShaderiv(UInt32 shader, OpenTK.Graphics.ES20.ShaderParameter pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetShaderPrecisionFormat", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetShaderPrecisionFormat(OpenTK.Graphics.ES20.ShaderType shadertype, OpenTK.Graphics.ES20.ShaderPrecision precisiontype, [OutAttribute] Int32* range, [OutAttribute] Int32* precision);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetShaderSource", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetShaderSource(UInt32 shader, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder source);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetString", ExactSpelling = true)]
|
||||
internal extern static unsafe System.IntPtr GetString(OpenTK.Graphics.ES20.StringName name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexParameterfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexParameterfv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.GetTextureParameter pname, [OutAttribute] Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetTexParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetTexParameteriv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.GetTextureParameter pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetUniformfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetUniformfv(UInt32 program, Int32 location, [OutAttribute] Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetUniformiv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetUniformiv(UInt32 program, Int32 location, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetUniformLocation", ExactSpelling = true)]
|
||||
internal extern static int GetUniformLocation(UInt32 program, String name);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetVertexAttribfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetVertexAttribfv(UInt32 index, OpenTK.Graphics.ES20.VertexAttribParameter pname, [OutAttribute] Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetVertexAttribiv", ExactSpelling = true)]
|
||||
internal extern static unsafe void GetVertexAttribiv(UInt32 index, OpenTK.Graphics.ES20.VertexAttribParameter pname, [OutAttribute] Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetVertexAttribPointerv", ExactSpelling = true)]
|
||||
internal extern static void GetVertexAttribPointerv(UInt32 index, OpenTK.Graphics.ES20.VertexAttribPointerParameter pname, [OutAttribute] IntPtr pointer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glHint", ExactSpelling = true)]
|
||||
internal extern static void Hint(OpenTK.Graphics.ES20.HintTarget target, OpenTK.Graphics.ES20.HintMode mode);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsBuffer", ExactSpelling = true)]
|
||||
internal extern static bool IsBuffer(UInt32 buffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsEnabled", ExactSpelling = true)]
|
||||
internal extern static bool IsEnabled(OpenTK.Graphics.ES20.EnableCap cap);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsFenceNV", ExactSpelling = true)]
|
||||
internal extern static bool IsFenceNV(UInt32 fence);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsFramebuffer", ExactSpelling = true)]
|
||||
internal extern static bool IsFramebuffer(UInt32 framebuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsProgram", ExactSpelling = true)]
|
||||
internal extern static bool IsProgram(UInt32 program);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsRenderbuffer", ExactSpelling = true)]
|
||||
internal extern static bool IsRenderbuffer(UInt32 renderbuffer);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsShader", ExactSpelling = true)]
|
||||
internal extern static bool IsShader(UInt32 shader);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsTexture", ExactSpelling = true)]
|
||||
internal extern static bool IsTexture(UInt32 texture);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glIsVertexArrayOES", ExactSpelling = true)]
|
||||
internal extern static bool IsVertexArrayOES(UInt32 array);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLineWidth", ExactSpelling = true)]
|
||||
internal extern static void LineWidth(Single width);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glLinkProgram", ExactSpelling = true)]
|
||||
internal extern static void LinkProgram(UInt32 program);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMapBufferOES", ExactSpelling = true)]
|
||||
internal extern static unsafe System.IntPtr MapBufferOES(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All access);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiDrawArraysEXT", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultiDrawArraysEXT(OpenTK.Graphics.ES20.All mode, Int32* first, Int32* count, Int32 primcount);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMultiDrawElementsEXT", ExactSpelling = true)]
|
||||
internal extern static unsafe void MultiDrawElementsEXT(OpenTK.Graphics.ES20.All mode, Int32* first, OpenTK.Graphics.ES20.All type, IntPtr indices, Int32 primcount);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPixelStorei", ExactSpelling = true)]
|
||||
internal extern static void PixelStorei(OpenTK.Graphics.ES20.PixelStoreParameter pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glPolygonOffset", ExactSpelling = true)]
|
||||
internal extern static void PolygonOffset(Single factor, Single units);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glProgramBinaryOES", ExactSpelling = true)]
|
||||
internal extern static void ProgramBinaryOES(UInt32 program, OpenTK.Graphics.ES20.All binaryFormat, IntPtr binary, Int32 length);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glReadPixels", ExactSpelling = true)]
|
||||
internal extern static void ReadPixels(Int32 x, Int32 y, Int32 width, Int32 height, OpenTK.Graphics.ES20.PixelFormat format, OpenTK.Graphics.ES20.PixelType type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glReleaseShaderCompiler", ExactSpelling = true)]
|
||||
internal extern static void ReleaseShaderCompiler();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRenderbufferStorage", ExactSpelling = true)]
|
||||
internal extern static void RenderbufferStorage(OpenTK.Graphics.ES20.RenderbufferTarget target, OpenTK.Graphics.ES20.RenderbufferInternalFormat internalformat, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRenderbufferStorageMultisampleANGLE", ExactSpelling = true)]
|
||||
internal extern static void RenderbufferStorageMultisampleANGLE(OpenTK.Graphics.ES20.All target, Int32 samples, OpenTK.Graphics.ES20.All internalformat, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRenderbufferStorageMultisampleAPPLE", ExactSpelling = true)]
|
||||
internal extern static void RenderbufferStorageMultisampleAPPLE();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glRenderbufferStorageMultisampleIMG", ExactSpelling = true)]
|
||||
internal extern static void RenderbufferStorageMultisampleIMG();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glResolveMultisampleFramebufferAPPLE", ExactSpelling = true)]
|
||||
internal extern static void ResolveMultisampleFramebufferAPPLE();
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSampleCoverage", ExactSpelling = true)]
|
||||
internal extern static void SampleCoverage(Single value, bool invert);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glScissor", ExactSpelling = true)]
|
||||
internal extern static void Scissor(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSelectPerfMonitorCountersAMD", ExactSpelling = true)]
|
||||
internal extern static unsafe void SelectPerfMonitorCountersAMD(UInt32 monitor, bool enable, UInt32 group, Int32 numCounters, UInt32* countersList);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glSetFenceNV", ExactSpelling = true)]
|
||||
internal extern static void SetFenceNV(UInt32 fence, OpenTK.Graphics.ES20.All condition);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glShaderBinary", ExactSpelling = true)]
|
||||
internal extern static unsafe void ShaderBinary(Int32 n, UInt32* shaders, OpenTK.Graphics.ES20.ShaderBinaryFormat binaryformat, IntPtr binary, Int32 length);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glShaderSource", ExactSpelling = true)]
|
||||
internal extern static unsafe void ShaderSource(UInt32 shader, Int32 count, String[] @string, Int32* length);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStartTilingQCOM", ExactSpelling = true)]
|
||||
internal extern static void StartTilingQCOM(UInt32 x, UInt32 y, UInt32 width, UInt32 height, UInt32 preserveMask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilFunc", ExactSpelling = true)]
|
||||
internal extern static void StencilFunc(OpenTK.Graphics.ES20.StencilFunction func, Int32 @ref, UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilFuncSeparate", ExactSpelling = true)]
|
||||
internal extern static void StencilFuncSeparate(OpenTK.Graphics.ES20.CullFaceMode face, OpenTK.Graphics.ES20.StencilFunction func, Int32 @ref, UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilMask", ExactSpelling = true)]
|
||||
internal extern static void StencilMask(UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilMaskSeparate", ExactSpelling = true)]
|
||||
internal extern static void StencilMaskSeparate(OpenTK.Graphics.ES20.CullFaceMode face, UInt32 mask);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilOp", ExactSpelling = true)]
|
||||
internal extern static void StencilOp(OpenTK.Graphics.ES20.StencilOp fail, OpenTK.Graphics.ES20.StencilOp zfail, OpenTK.Graphics.ES20.StencilOp zpass);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glStencilOpSeparate", ExactSpelling = true)]
|
||||
internal extern static void StencilOpSeparate(OpenTK.Graphics.ES20.CullFaceMode face, OpenTK.Graphics.ES20.StencilOp fail, OpenTK.Graphics.ES20.StencilOp zfail, OpenTK.Graphics.ES20.StencilOp zpass);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTestFenceNV", ExactSpelling = true)]
|
||||
internal extern static bool TestFenceNV(UInt32 fence);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexImage2D", ExactSpelling = true)]
|
||||
internal extern static void TexImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, OpenTK.Graphics.ES20.PixelInternalFormat internalformat, Int32 width, Int32 height, Int32 border, OpenTK.Graphics.ES20.PixelFormat format, OpenTK.Graphics.ES20.PixelType type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexImage3DOES", ExactSpelling = true)]
|
||||
internal extern static void TexImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, OpenTK.Graphics.ES20.All internalformat, Int32 width, Int32 height, Int32 depth, Int32 border, OpenTK.Graphics.ES20.All format, OpenTK.Graphics.ES20.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterf", ExactSpelling = true)]
|
||||
internal extern static void TexParameterf(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Single param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameterfv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexParameterfv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Single* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameteri", ExactSpelling = true)]
|
||||
internal extern static void TexParameteri(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Int32 param);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexParameteriv", ExactSpelling = true)]
|
||||
internal extern static unsafe void TexParameteriv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Int32* @params);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexSubImage2D", ExactSpelling = true)]
|
||||
internal extern static void TexSubImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES20.PixelFormat format, OpenTK.Graphics.ES20.PixelType type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glTexSubImage3DOES", ExactSpelling = true)]
|
||||
internal extern static void TexSubImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 width, Int32 height, Int32 depth, OpenTK.Graphics.ES20.All format, OpenTK.Graphics.ES20.All type, IntPtr pixels);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform1f", ExactSpelling = true)]
|
||||
internal extern static void Uniform1f(Int32 location, Single x);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform1fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform1fv(Int32 location, Int32 count, Single* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform1i", ExactSpelling = true)]
|
||||
internal extern static void Uniform1i(Int32 location, Int32 x);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform1iv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform1iv(Int32 location, Int32 count, Int32* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform2f", ExactSpelling = true)]
|
||||
internal extern static void Uniform2f(Int32 location, Single x, Single y);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform2fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform2fv(Int32 location, Int32 count, Single* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform2i", ExactSpelling = true)]
|
||||
internal extern static void Uniform2i(Int32 location, Int32 x, Int32 y);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform2iv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform2iv(Int32 location, Int32 count, Int32* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform3f", ExactSpelling = true)]
|
||||
internal extern static void Uniform3f(Int32 location, Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform3fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform3fv(Int32 location, Int32 count, Single* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform3i", ExactSpelling = true)]
|
||||
internal extern static void Uniform3i(Int32 location, Int32 x, Int32 y, Int32 z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform3iv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform3iv(Int32 location, Int32 count, Int32* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform4f", ExactSpelling = true)]
|
||||
internal extern static void Uniform4f(Int32 location, Single x, Single y, Single z, Single w);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform4fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform4fv(Int32 location, Int32 count, Single* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform4i", ExactSpelling = true)]
|
||||
internal extern static void Uniform4i(Int32 location, Int32 x, Int32 y, Int32 z, Int32 w);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniform4iv", ExactSpelling = true)]
|
||||
internal extern static unsafe void Uniform4iv(Int32 location, Int32 count, Int32* v);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniformMatrix2fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void UniformMatrix2fv(Int32 location, Int32 count, bool transpose, Single* value);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniformMatrix3fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void UniformMatrix3fv(Int32 location, Int32 count, bool transpose, Single* value);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUniformMatrix4fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void UniformMatrix4fv(Int32 location, Int32 count, bool transpose, Single* value);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUnmapBufferOES", ExactSpelling = true)]
|
||||
internal extern static bool UnmapBufferOES(OpenTK.Graphics.ES20.All target);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glUseProgram", ExactSpelling = true)]
|
||||
internal extern static void UseProgram(UInt32 program);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glValidateProgram", ExactSpelling = true)]
|
||||
internal extern static void ValidateProgram(UInt32 program);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib1f", ExactSpelling = true)]
|
||||
internal extern static void VertexAttrib1f(UInt32 indx, Single x);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib1fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void VertexAttrib1fv(UInt32 indx, Single* values);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib2f", ExactSpelling = true)]
|
||||
internal extern static void VertexAttrib2f(UInt32 indx, Single x, Single y);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib2fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void VertexAttrib2fv(UInt32 indx, Single* values);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib3f", ExactSpelling = true)]
|
||||
internal extern static void VertexAttrib3f(UInt32 indx, Single x, Single y, Single z);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib3fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void VertexAttrib3fv(UInt32 indx, Single* values);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib4f", ExactSpelling = true)]
|
||||
internal extern static void VertexAttrib4f(UInt32 indx, Single x, Single y, Single z, Single w);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttrib4fv", ExactSpelling = true)]
|
||||
internal extern static unsafe void VertexAttrib4fv(UInt32 indx, Single* values);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glVertexAttribPointer", ExactSpelling = true)]
|
||||
internal extern static void VertexAttribPointer(UInt32 indx, Int32 size, OpenTK.Graphics.ES20.VertexAttribPointerType type, bool normalized, Int32 stride, IntPtr ptr);
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glViewport", ExactSpelling = true)]
|
||||
internal extern static void Viewport(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,661 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
namespace OpenTK.Graphics.ES20
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma warning disable 0649
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
|
||||
partial class GL
|
||||
{
|
||||
internal static partial class Delegates
|
||||
{
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ActiveTexture(OpenTK.Graphics.ES20.TextureUnit texture);
|
||||
internal static ActiveTexture glActiveTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void AttachShader(UInt32 program, UInt32 shader);
|
||||
internal static AttachShader glAttachShader;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BeginPerfMonitorAMD(UInt32 monitor);
|
||||
internal static BeginPerfMonitorAMD glBeginPerfMonitorAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindAttribLocation(UInt32 program, UInt32 index, String name);
|
||||
internal static BindAttribLocation glBindAttribLocation;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindBuffer(OpenTK.Graphics.ES20.BufferTarget target, UInt32 buffer);
|
||||
internal static BindBuffer glBindBuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindFramebuffer(OpenTK.Graphics.ES20.FramebufferTarget target, UInt32 framebuffer);
|
||||
internal static BindFramebuffer glBindFramebuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindRenderbuffer(OpenTK.Graphics.ES20.RenderbufferTarget target, UInt32 renderbuffer);
|
||||
internal static BindRenderbuffer glBindRenderbuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindTexture(OpenTK.Graphics.ES20.TextureTarget target, UInt32 texture);
|
||||
internal static BindTexture glBindTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BindVertexArrayOES(UInt32 array);
|
||||
internal static BindVertexArrayOES glBindVertexArrayOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendColor(Single red, Single green, Single blue, Single alpha);
|
||||
internal static BlendColor glBlendColor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendEquation(OpenTK.Graphics.ES20.BlendEquationMode mode);
|
||||
internal static BlendEquation glBlendEquation;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendEquationSeparate(OpenTK.Graphics.ES20.BlendEquationMode modeRGB, OpenTK.Graphics.ES20.BlendEquationMode modeAlpha);
|
||||
internal static BlendEquationSeparate glBlendEquationSeparate;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendFunc(OpenTK.Graphics.ES20.BlendingFactorSrc sfactor, OpenTK.Graphics.ES20.BlendingFactorDest dfactor);
|
||||
internal static BlendFunc glBlendFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlendFuncSeparate(OpenTK.Graphics.ES20.BlendingFactorSrc srcRGB, OpenTK.Graphics.ES20.BlendingFactorDest dstRGB, OpenTK.Graphics.ES20.BlendingFactorSrc srcAlpha, OpenTK.Graphics.ES20.BlendingFactorDest dstAlpha);
|
||||
internal static BlendFuncSeparate glBlendFuncSeparate;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BlitFramebufferANGLE(Int32 srcX0, Int32 srcY0, Int32 srcX1, Int32 srcY1, Int32 dstX0, Int32 dstY0, Int32 dstX1, Int32 dstY1, UInt32 mask, OpenTK.Graphics.ES20.All filter);
|
||||
internal static BlitFramebufferANGLE glBlitFramebufferANGLE;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BufferData(OpenTK.Graphics.ES20.BufferTarget target, IntPtr size, IntPtr data, OpenTK.Graphics.ES20.BufferUsage usage);
|
||||
internal static BufferData glBufferData;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void BufferSubData(OpenTK.Graphics.ES20.BufferTarget target, IntPtr offset, IntPtr size, IntPtr data);
|
||||
internal static BufferSubData glBufferSubData;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate OpenTK.Graphics.ES20.FramebufferErrorCode CheckFramebufferStatus(OpenTK.Graphics.ES20.FramebufferTarget target);
|
||||
internal static CheckFramebufferStatus glCheckFramebufferStatus;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Clear(OpenTK.Graphics.ES20.ClearBufferMask mask);
|
||||
internal static Clear glClear;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearColor(Single red, Single green, Single blue, Single alpha);
|
||||
internal static ClearColor glClearColor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearDepthf(Single depth);
|
||||
internal static ClearDepthf glClearDepthf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ClearStencil(Int32 s);
|
||||
internal static ClearStencil glClearStencil;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
internal static ColorMask glColorMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompileShader(UInt32 shader);
|
||||
internal static CompileShader glCompileShader;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, OpenTK.Graphics.ES20.PixelInternalFormat internalformat, Int32 width, Int32 height, Int32 border, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexImage2D glCompressedTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, OpenTK.Graphics.ES20.All internalformat, Int32 width, Int32 height, Int32 depth, Int32 border, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexImage3DOES glCompressedTexImage3DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexSubImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES20.PixelFormat format, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexSubImage2D glCompressedTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CompressedTexSubImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 width, Int32 height, Int32 depth, OpenTK.Graphics.ES20.All format, Int32 imageSize, IntPtr data);
|
||||
internal static CompressedTexSubImage3DOES glCompressedTexSubImage3DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, OpenTK.Graphics.ES20.PixelInternalFormat internalformat, Int32 x, Int32 y, Int32 width, Int32 height, Int32 border);
|
||||
internal static CopyTexImage2D glCopyTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexSubImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static CopyTexSubImage2D glCopyTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CopyTexSubImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static CopyTexSubImage3DOES glCopyTexSubImage3DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CoverageMaskNV(bool mask);
|
||||
internal static CoverageMaskNV glCoverageMaskNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CoverageOperationNV(OpenTK.Graphics.ES20.All operation);
|
||||
internal static CoverageOperationNV glCoverageOperationNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Int32 CreateProgram();
|
||||
internal static CreateProgram glCreateProgram;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate Int32 CreateShader(OpenTK.Graphics.ES20.ShaderType type);
|
||||
internal static CreateShader glCreateShader;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void CullFace(OpenTK.Graphics.ES20.CullFaceMode mode);
|
||||
internal static CullFace glCullFace;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteBuffers(Int32 n, UInt32* buffers);
|
||||
internal unsafe static DeleteBuffers glDeleteBuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteFencesNV(Int32 n, UInt32* fences);
|
||||
internal unsafe static DeleteFencesNV glDeleteFencesNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteFramebuffers(Int32 n, UInt32* framebuffers);
|
||||
internal unsafe static DeleteFramebuffers glDeleteFramebuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeletePerfMonitorsAMD(Int32 n, UInt32* monitors);
|
||||
internal unsafe static DeletePerfMonitorsAMD glDeletePerfMonitorsAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DeleteProgram(UInt32 program);
|
||||
internal static DeleteProgram glDeleteProgram;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteRenderbuffers(Int32 n, UInt32* renderbuffers);
|
||||
internal unsafe static DeleteRenderbuffers glDeleteRenderbuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DeleteShader(UInt32 shader);
|
||||
internal static DeleteShader glDeleteShader;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteTextures(Int32 n, UInt32* textures);
|
||||
internal unsafe static DeleteTextures glDeleteTextures;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DeleteVertexArraysOES(Int32 n, UInt32* arrays);
|
||||
internal unsafe static DeleteVertexArraysOES glDeleteVertexArraysOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthFunc(OpenTK.Graphics.ES20.DepthFunction func);
|
||||
internal static DepthFunc glDepthFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthMask(bool flag);
|
||||
internal static DepthMask glDepthMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DepthRangef(Single zNear, Single zFar);
|
||||
internal static DepthRangef glDepthRangef;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DetachShader(UInt32 program, UInt32 shader);
|
||||
internal static DetachShader glDetachShader;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Disable(OpenTK.Graphics.ES20.EnableCap cap);
|
||||
internal static Disable glDisable;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DisableDriverControlQCOM(UInt32 driverControl);
|
||||
internal static DisableDriverControlQCOM glDisableDriverControlQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DisableVertexAttribArray(UInt32 index);
|
||||
internal static DisableVertexAttribArray glDisableVertexAttribArray;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void DiscardFramebufferEXT(OpenTK.Graphics.ES20.All target, Int32 numAttachments, OpenTK.Graphics.ES20.All* attachments);
|
||||
internal unsafe static DiscardFramebufferEXT glDiscardFramebufferEXT;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawArrays(OpenTK.Graphics.ES20.BeginMode mode, Int32 first, Int32 count);
|
||||
internal static DrawArrays glDrawArrays;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void DrawElements(OpenTK.Graphics.ES20.BeginMode mode, Int32 count, OpenTK.Graphics.ES20.DrawElementsType type, IntPtr indices);
|
||||
internal static DrawElements glDrawElements;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EGLImageTargetRenderbufferStorageOES(OpenTK.Graphics.ES20.All target, IntPtr image);
|
||||
internal static EGLImageTargetRenderbufferStorageOES glEGLImageTargetRenderbufferStorageOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EGLImageTargetTexture2DOES(OpenTK.Graphics.ES20.All target, IntPtr image);
|
||||
internal static EGLImageTargetTexture2DOES glEGLImageTargetTexture2DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Enable(OpenTK.Graphics.ES20.EnableCap cap);
|
||||
internal static Enable glEnable;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EnableDriverControlQCOM(UInt32 driverControl);
|
||||
internal static EnableDriverControlQCOM glEnableDriverControlQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EnableVertexAttribArray(UInt32 index);
|
||||
internal static EnableVertexAttribArray glEnableVertexAttribArray;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EndPerfMonitorAMD(UInt32 monitor);
|
||||
internal static EndPerfMonitorAMD glEndPerfMonitorAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void EndTilingQCOM(UInt32 preserveMask);
|
||||
internal static EndTilingQCOM glEndTilingQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ExtGetBufferPointervQCOM(OpenTK.Graphics.ES20.All target, IntPtr @params);
|
||||
internal static ExtGetBufferPointervQCOM glExtGetBufferPointervQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetBuffersQCOM(UInt32* buffers, Int32 maxBuffers, Int32* numBuffers);
|
||||
internal unsafe static ExtGetBuffersQCOM glExtGetBuffersQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetFramebuffersQCOM(UInt32* framebuffers, Int32 maxFramebuffers, Int32* numFramebuffers);
|
||||
internal unsafe static ExtGetFramebuffersQCOM glExtGetFramebuffersQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetProgramBinarySourceQCOM(UInt32 program, OpenTK.Graphics.ES20.All shadertype, String source, Int32* length);
|
||||
internal unsafe static ExtGetProgramBinarySourceQCOM glExtGetProgramBinarySourceQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetProgramsQCOM(UInt32* programs, Int32 maxPrograms, Int32* numPrograms);
|
||||
internal unsafe static ExtGetProgramsQCOM glExtGetProgramsQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetRenderbuffersQCOM(UInt32* renderbuffers, Int32 maxRenderbuffers, Int32* numRenderbuffers);
|
||||
internal unsafe static ExtGetRenderbuffersQCOM glExtGetRenderbuffersQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetShadersQCOM(UInt32* shaders, Int32 maxShaders, Int32* numShaders);
|
||||
internal unsafe static ExtGetShadersQCOM glExtGetShadersQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetTexLevelParameterivQCOM(UInt32 texture, OpenTK.Graphics.ES20.All face, Int32 level, OpenTK.Graphics.ES20.All pname, Int32* @params);
|
||||
internal unsafe static ExtGetTexLevelParameterivQCOM glExtGetTexLevelParameterivQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ExtGetTexSubImageQCOM(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 width, Int32 height, Int32 depth, OpenTK.Graphics.ES20.All format, OpenTK.Graphics.ES20.All type, IntPtr texels);
|
||||
internal static ExtGetTexSubImageQCOM glExtGetTexSubImageQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ExtGetTexturesQCOM(UInt32* textures, Int32 maxTextures, Int32* numTextures);
|
||||
internal unsafe static ExtGetTexturesQCOM glExtGetTexturesQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool ExtIsProgramBinaryQCOM(UInt32 program);
|
||||
internal static ExtIsProgramBinaryQCOM glExtIsProgramBinaryQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ExtTexObjectStateOverrideiQCOM(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All pname, Int32 param);
|
||||
internal static ExtTexObjectStateOverrideiQCOM glExtTexObjectStateOverrideiQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Finish();
|
||||
internal static Finish glFinish;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FinishFenceNV(UInt32 fence);
|
||||
internal static FinishFenceNV glFinishFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Flush();
|
||||
internal static Flush glFlush;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FramebufferRenderbuffer(OpenTK.Graphics.ES20.FramebufferTarget target, OpenTK.Graphics.ES20.FramebufferSlot attachment, OpenTK.Graphics.ES20.RenderbufferTarget renderbuffertarget, UInt32 renderbuffer);
|
||||
internal static FramebufferRenderbuffer glFramebufferRenderbuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FramebufferTexture2D(OpenTK.Graphics.ES20.FramebufferTarget target, OpenTK.Graphics.ES20.FramebufferSlot attachment, OpenTK.Graphics.ES20.TextureTarget textarget, UInt32 texture, Int32 level);
|
||||
internal static FramebufferTexture2D glFramebufferTexture2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FramebufferTexture2DMultisampleIMG();
|
||||
internal static FramebufferTexture2DMultisampleIMG glFramebufferTexture2DMultisampleIMG;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FramebufferTexture3DOES(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All attachment, OpenTK.Graphics.ES20.All textarget, UInt32 texture, Int32 level, Int32 zoffset);
|
||||
internal static FramebufferTexture3DOES glFramebufferTexture3DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void FrontFace(OpenTK.Graphics.ES20.FrontFaceDirection mode);
|
||||
internal static FrontFace glFrontFace;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenBuffers(Int32 n, [OutAttribute] UInt32* buffers);
|
||||
internal unsafe static GenBuffers glGenBuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GenerateMipmap(OpenTK.Graphics.ES20.TextureTarget target);
|
||||
internal static GenerateMipmap glGenerateMipmap;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenFencesNV(Int32 n, [OutAttribute] UInt32* fences);
|
||||
internal unsafe static GenFencesNV glGenFencesNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenFramebuffers(Int32 n, [OutAttribute] UInt32* framebuffers);
|
||||
internal unsafe static GenFramebuffers glGenFramebuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenPerfMonitorsAMD(Int32 n, [OutAttribute] UInt32* monitors);
|
||||
internal unsafe static GenPerfMonitorsAMD glGenPerfMonitorsAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenRenderbuffers(Int32 n, [OutAttribute] UInt32* renderbuffers);
|
||||
internal unsafe static GenRenderbuffers glGenRenderbuffers;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenTextures(Int32 n, [OutAttribute] UInt32* textures);
|
||||
internal unsafe static GenTextures glGenTextures;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GenVertexArraysOES(Int32 n, [OutAttribute] UInt32* arrays);
|
||||
internal unsafe static GenVertexArraysOES glGenVertexArraysOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetActiveAttrib(UInt32 program, UInt32 index, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] Int32* size, [OutAttribute] OpenTK.Graphics.ES20.ActiveAttribType* type, [OutAttribute] StringBuilder name);
|
||||
internal unsafe static GetActiveAttrib glGetActiveAttrib;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetActiveUniform(UInt32 program, UInt32 index, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] Int32* size, [OutAttribute] OpenTK.Graphics.ES20.ActiveUniformType* type, [OutAttribute] StringBuilder name);
|
||||
internal unsafe static GetActiveUniform glGetActiveUniform;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetAttachedShaders(UInt32 program, Int32 maxcount, [OutAttribute] Int32* count, [OutAttribute] UInt32* shaders);
|
||||
internal unsafe static GetAttachedShaders glGetAttachedShaders;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int GetAttribLocation(UInt32 program, String name);
|
||||
internal static GetAttribLocation glGetAttribLocation;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetBooleanv(OpenTK.Graphics.ES20.GetPName pname, [OutAttribute] bool* @params);
|
||||
internal unsafe static GetBooleanv glGetBooleanv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetBufferParameteriv(OpenTK.Graphics.ES20.BufferTarget target, OpenTK.Graphics.ES20.BufferParameterName pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetBufferParameteriv glGetBufferParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GetBufferPointervOES(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All pname, [OutAttribute] IntPtr @params);
|
||||
internal static GetBufferPointervOES glGetBufferPointervOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetDriverControlsQCOM([OutAttribute] Int32* num, Int32 size, [OutAttribute] UInt32* driverControls);
|
||||
internal unsafe static GetDriverControlsQCOM glGetDriverControlsQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetDriverControlStringQCOM(UInt32 driverControl, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder driverControlString);
|
||||
internal unsafe static GetDriverControlStringQCOM glGetDriverControlStringQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate OpenTK.Graphics.ES20.ErrorCode GetError();
|
||||
internal static GetError glGetError;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFenceivNV(UInt32 fence, OpenTK.Graphics.ES20.All pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetFenceivNV glGetFenceivNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFloatv(OpenTK.Graphics.ES20.GetPName pname, [OutAttribute] Single* @params);
|
||||
internal unsafe static GetFloatv glGetFloatv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetFramebufferAttachmentParameteriv(OpenTK.Graphics.ES20.FramebufferTarget target, OpenTK.Graphics.ES20.FramebufferSlot attachment, OpenTK.Graphics.ES20.FramebufferParameterName pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetFramebufferAttachmentParameteriv glGetFramebufferAttachmentParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetIntegerv(OpenTK.Graphics.ES20.GetPName pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetIntegerv glGetIntegerv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetPerfMonitorCounterDataAMD(UInt32 monitor, OpenTK.Graphics.ES20.All pname, Int32 dataSize, [OutAttribute] UInt32* data, [OutAttribute] Int32* bytesWritten);
|
||||
internal unsafe static GetPerfMonitorCounterDataAMD glGetPerfMonitorCounterDataAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GetPerfMonitorCounterInfoAMD(UInt32 group, UInt32 counter, OpenTK.Graphics.ES20.All pname, [OutAttribute] IntPtr data);
|
||||
internal static GetPerfMonitorCounterInfoAMD glGetPerfMonitorCounterInfoAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetPerfMonitorCountersAMD(UInt32 group, [OutAttribute] Int32* numCounters, [OutAttribute] Int32* maxActiveCounters, Int32 counterSize, [OutAttribute] UInt32* counters);
|
||||
internal unsafe static GetPerfMonitorCountersAMD glGetPerfMonitorCountersAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetPerfMonitorCounterStringAMD(UInt32 group, UInt32 counter, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder counterString);
|
||||
internal unsafe static GetPerfMonitorCounterStringAMD glGetPerfMonitorCounterStringAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetPerfMonitorGroupsAMD([OutAttribute] Int32* numGroups, Int32 groupsSize, [OutAttribute] UInt32* groups);
|
||||
internal unsafe static GetPerfMonitorGroupsAMD glGetPerfMonitorGroupsAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetPerfMonitorGroupStringAMD(UInt32 group, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder groupString);
|
||||
internal unsafe static GetPerfMonitorGroupStringAMD glGetPerfMonitorGroupStringAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetProgramBinaryOES(UInt32 program, Int32 bufSize, [OutAttribute] Int32* length, [OutAttribute] OpenTK.Graphics.ES20.All* binaryFormat, [OutAttribute] IntPtr binary);
|
||||
internal unsafe static GetProgramBinaryOES glGetProgramBinaryOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetProgramInfoLog(UInt32 program, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder infolog);
|
||||
internal unsafe static GetProgramInfoLog glGetProgramInfoLog;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetProgramiv(UInt32 program, OpenTK.Graphics.ES20.ProgramParameter pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetProgramiv glGetProgramiv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetRenderbufferParameteriv(OpenTK.Graphics.ES20.RenderbufferTarget target, OpenTK.Graphics.ES20.RenderbufferParameterName pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetRenderbufferParameteriv glGetRenderbufferParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetShaderInfoLog(UInt32 shader, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder infolog);
|
||||
internal unsafe static GetShaderInfoLog glGetShaderInfoLog;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetShaderiv(UInt32 shader, OpenTK.Graphics.ES20.ShaderParameter pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetShaderiv glGetShaderiv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetShaderPrecisionFormat(OpenTK.Graphics.ES20.ShaderType shadertype, OpenTK.Graphics.ES20.ShaderPrecision precisiontype, [OutAttribute] Int32* range, [OutAttribute] Int32* precision);
|
||||
internal unsafe static GetShaderPrecisionFormat glGetShaderPrecisionFormat;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetShaderSource(UInt32 shader, Int32 bufsize, [OutAttribute] Int32* length, [OutAttribute] StringBuilder source);
|
||||
internal unsafe static GetShaderSource glGetShaderSource;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate System.IntPtr GetString(OpenTK.Graphics.ES20.StringName name);
|
||||
internal unsafe static GetString glGetString;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexParameterfv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.GetTextureParameter pname, [OutAttribute] Single* @params);
|
||||
internal unsafe static GetTexParameterfv glGetTexParameterfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetTexParameteriv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.GetTextureParameter pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetTexParameteriv glGetTexParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetUniformfv(UInt32 program, Int32 location, [OutAttribute] Single* @params);
|
||||
internal unsafe static GetUniformfv glGetUniformfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetUniformiv(UInt32 program, Int32 location, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetUniformiv glGetUniformiv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate int GetUniformLocation(UInt32 program, String name);
|
||||
internal static GetUniformLocation glGetUniformLocation;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetVertexAttribfv(UInt32 index, OpenTK.Graphics.ES20.VertexAttribParameter pname, [OutAttribute] Single* @params);
|
||||
internal unsafe static GetVertexAttribfv glGetVertexAttribfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void GetVertexAttribiv(UInt32 index, OpenTK.Graphics.ES20.VertexAttribParameter pname, [OutAttribute] Int32* @params);
|
||||
internal unsafe static GetVertexAttribiv glGetVertexAttribiv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void GetVertexAttribPointerv(UInt32 index, OpenTK.Graphics.ES20.VertexAttribPointerParameter pname, [OutAttribute] IntPtr pointer);
|
||||
internal static GetVertexAttribPointerv glGetVertexAttribPointerv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Hint(OpenTK.Graphics.ES20.HintTarget target, OpenTK.Graphics.ES20.HintMode mode);
|
||||
internal static Hint glHint;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsBuffer(UInt32 buffer);
|
||||
internal static IsBuffer glIsBuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsEnabled(OpenTK.Graphics.ES20.EnableCap cap);
|
||||
internal static IsEnabled glIsEnabled;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsFenceNV(UInt32 fence);
|
||||
internal static IsFenceNV glIsFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsFramebuffer(UInt32 framebuffer);
|
||||
internal static IsFramebuffer glIsFramebuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsProgram(UInt32 program);
|
||||
internal static IsProgram glIsProgram;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsRenderbuffer(UInt32 renderbuffer);
|
||||
internal static IsRenderbuffer glIsRenderbuffer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsShader(UInt32 shader);
|
||||
internal static IsShader glIsShader;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsTexture(UInt32 texture);
|
||||
internal static IsTexture glIsTexture;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool IsVertexArrayOES(UInt32 array);
|
||||
internal static IsVertexArrayOES glIsVertexArrayOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LineWidth(Single width);
|
||||
internal static LineWidth glLineWidth;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void LinkProgram(UInt32 program);
|
||||
internal static LinkProgram glLinkProgram;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate System.IntPtr MapBufferOES(OpenTK.Graphics.ES20.All target, OpenTK.Graphics.ES20.All access);
|
||||
internal unsafe static MapBufferOES glMapBufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultiDrawArraysEXT(OpenTK.Graphics.ES20.All mode, Int32* first, Int32* count, Int32 primcount);
|
||||
internal unsafe static MultiDrawArraysEXT glMultiDrawArraysEXT;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void MultiDrawElementsEXT(OpenTK.Graphics.ES20.All mode, Int32* first, OpenTK.Graphics.ES20.All type, IntPtr indices, Int32 primcount);
|
||||
internal unsafe static MultiDrawElementsEXT glMultiDrawElementsEXT;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PixelStorei(OpenTK.Graphics.ES20.PixelStoreParameter pname, Int32 param);
|
||||
internal static PixelStorei glPixelStorei;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void PolygonOffset(Single factor, Single units);
|
||||
internal static PolygonOffset glPolygonOffset;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ProgramBinaryOES(UInt32 program, OpenTK.Graphics.ES20.All binaryFormat, IntPtr binary, Int32 length);
|
||||
internal static ProgramBinaryOES glProgramBinaryOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ReadPixels(Int32 x, Int32 y, Int32 width, Int32 height, OpenTK.Graphics.ES20.PixelFormat format, OpenTK.Graphics.ES20.PixelType type, IntPtr pixels);
|
||||
internal static ReadPixels glReadPixels;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ReleaseShaderCompiler();
|
||||
internal static ReleaseShaderCompiler glReleaseShaderCompiler;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void RenderbufferStorage(OpenTK.Graphics.ES20.RenderbufferTarget target, OpenTK.Graphics.ES20.RenderbufferInternalFormat internalformat, Int32 width, Int32 height);
|
||||
internal static RenderbufferStorage glRenderbufferStorage;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void RenderbufferStorageMultisampleANGLE(OpenTK.Graphics.ES20.All target, Int32 samples, OpenTK.Graphics.ES20.All internalformat, Int32 width, Int32 height);
|
||||
internal static RenderbufferStorageMultisampleANGLE glRenderbufferStorageMultisampleANGLE;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void RenderbufferStorageMultisampleAPPLE();
|
||||
internal static RenderbufferStorageMultisampleAPPLE glRenderbufferStorageMultisampleAPPLE;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void RenderbufferStorageMultisampleIMG();
|
||||
internal static RenderbufferStorageMultisampleIMG glRenderbufferStorageMultisampleIMG;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ResolveMultisampleFramebufferAPPLE();
|
||||
internal static ResolveMultisampleFramebufferAPPLE glResolveMultisampleFramebufferAPPLE;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SampleCoverage(Single value, bool invert);
|
||||
internal static SampleCoverage glSampleCoverage;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Scissor(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static Scissor glScissor;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void SelectPerfMonitorCountersAMD(UInt32 monitor, bool enable, UInt32 group, Int32 numCounters, UInt32* countersList);
|
||||
internal unsafe static SelectPerfMonitorCountersAMD glSelectPerfMonitorCountersAMD;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void SetFenceNV(UInt32 fence, OpenTK.Graphics.ES20.All condition);
|
||||
internal static SetFenceNV glSetFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ShaderBinary(Int32 n, UInt32* shaders, OpenTK.Graphics.ES20.ShaderBinaryFormat binaryformat, IntPtr binary, Int32 length);
|
||||
internal unsafe static ShaderBinary glShaderBinary;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void ShaderSource(UInt32 shader, Int32 count, String[] @string, Int32* length);
|
||||
internal unsafe static ShaderSource glShaderSource;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StartTilingQCOM(UInt32 x, UInt32 y, UInt32 width, UInt32 height, UInt32 preserveMask);
|
||||
internal static StartTilingQCOM glStartTilingQCOM;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilFunc(OpenTK.Graphics.ES20.StencilFunction func, Int32 @ref, UInt32 mask);
|
||||
internal static StencilFunc glStencilFunc;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilFuncSeparate(OpenTK.Graphics.ES20.CullFaceMode face, OpenTK.Graphics.ES20.StencilFunction func, Int32 @ref, UInt32 mask);
|
||||
internal static StencilFuncSeparate glStencilFuncSeparate;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilMask(UInt32 mask);
|
||||
internal static StencilMask glStencilMask;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilMaskSeparate(OpenTK.Graphics.ES20.CullFaceMode face, UInt32 mask);
|
||||
internal static StencilMaskSeparate glStencilMaskSeparate;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilOp(OpenTK.Graphics.ES20.StencilOp fail, OpenTK.Graphics.ES20.StencilOp zfail, OpenTK.Graphics.ES20.StencilOp zpass);
|
||||
internal static StencilOp glStencilOp;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void StencilOpSeparate(OpenTK.Graphics.ES20.CullFaceMode face, OpenTK.Graphics.ES20.StencilOp fail, OpenTK.Graphics.ES20.StencilOp zfail, OpenTK.Graphics.ES20.StencilOp zpass);
|
||||
internal static StencilOpSeparate glStencilOpSeparate;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool TestFenceNV(UInt32 fence);
|
||||
internal static TestFenceNV glTestFenceNV;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, OpenTK.Graphics.ES20.PixelInternalFormat internalformat, Int32 width, Int32 height, Int32 border, OpenTK.Graphics.ES20.PixelFormat format, OpenTK.Graphics.ES20.PixelType type, IntPtr pixels);
|
||||
internal static TexImage2D glTexImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, OpenTK.Graphics.ES20.All internalformat, Int32 width, Int32 height, Int32 depth, Int32 border, OpenTK.Graphics.ES20.All format, OpenTK.Graphics.ES20.All type, IntPtr pixels);
|
||||
internal static TexImage3DOES glTexImage3DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameterf(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Single param);
|
||||
internal static TexParameterf glTexParameterf;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexParameterfv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Single* @params);
|
||||
internal unsafe static TexParameterfv glTexParameterfv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexParameteri(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Int32 param);
|
||||
internal static TexParameteri glTexParameteri;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void TexParameteriv(OpenTK.Graphics.ES20.TextureTarget target, OpenTK.Graphics.ES20.TextureParameterName pname, Int32* @params);
|
||||
internal unsafe static TexParameteriv glTexParameteriv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexSubImage2D(OpenTK.Graphics.ES20.TextureTarget target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 width, Int32 height, OpenTK.Graphics.ES20.PixelFormat format, OpenTK.Graphics.ES20.PixelType type, IntPtr pixels);
|
||||
internal static TexSubImage2D glTexSubImage2D;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void TexSubImage3DOES(OpenTK.Graphics.ES20.All target, Int32 level, Int32 xoffset, Int32 yoffset, Int32 zoffset, Int32 width, Int32 height, Int32 depth, OpenTK.Graphics.ES20.All format, OpenTK.Graphics.ES20.All type, IntPtr pixels);
|
||||
internal static TexSubImage3DOES glTexSubImage3DOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform1f(Int32 location, Single x);
|
||||
internal static Uniform1f glUniform1f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform1fv(Int32 location, Int32 count, Single* v);
|
||||
internal unsafe static Uniform1fv glUniform1fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform1i(Int32 location, Int32 x);
|
||||
internal static Uniform1i glUniform1i;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform1iv(Int32 location, Int32 count, Int32* v);
|
||||
internal unsafe static Uniform1iv glUniform1iv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform2f(Int32 location, Single x, Single y);
|
||||
internal static Uniform2f glUniform2f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform2fv(Int32 location, Int32 count, Single* v);
|
||||
internal unsafe static Uniform2fv glUniform2fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform2i(Int32 location, Int32 x, Int32 y);
|
||||
internal static Uniform2i glUniform2i;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform2iv(Int32 location, Int32 count, Int32* v);
|
||||
internal unsafe static Uniform2iv glUniform2iv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform3f(Int32 location, Single x, Single y, Single z);
|
||||
internal static Uniform3f glUniform3f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform3fv(Int32 location, Int32 count, Single* v);
|
||||
internal unsafe static Uniform3fv glUniform3fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform3i(Int32 location, Int32 x, Int32 y, Int32 z);
|
||||
internal static Uniform3i glUniform3i;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform3iv(Int32 location, Int32 count, Int32* v);
|
||||
internal unsafe static Uniform3iv glUniform3iv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform4f(Int32 location, Single x, Single y, Single z, Single w);
|
||||
internal static Uniform4f glUniform4f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform4fv(Int32 location, Int32 count, Single* v);
|
||||
internal unsafe static Uniform4fv glUniform4fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Uniform4i(Int32 location, Int32 x, Int32 y, Int32 z, Int32 w);
|
||||
internal static Uniform4i glUniform4i;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void Uniform4iv(Int32 location, Int32 count, Int32* v);
|
||||
internal unsafe static Uniform4iv glUniform4iv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void UniformMatrix2fv(Int32 location, Int32 count, bool transpose, Single* value);
|
||||
internal unsafe static UniformMatrix2fv glUniformMatrix2fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void UniformMatrix3fv(Int32 location, Int32 count, bool transpose, Single* value);
|
||||
internal unsafe static UniformMatrix3fv glUniformMatrix3fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void UniformMatrix4fv(Int32 location, Int32 count, bool transpose, Single* value);
|
||||
internal unsafe static UniformMatrix4fv glUniformMatrix4fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate bool UnmapBufferOES(OpenTK.Graphics.ES20.All target);
|
||||
internal static UnmapBufferOES glUnmapBufferOES;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void UseProgram(UInt32 program);
|
||||
internal static UseProgram glUseProgram;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void ValidateProgram(UInt32 program);
|
||||
internal static ValidateProgram glValidateProgram;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexAttrib1f(UInt32 indx, Single x);
|
||||
internal static VertexAttrib1f glVertexAttrib1f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void VertexAttrib1fv(UInt32 indx, Single* values);
|
||||
internal unsafe static VertexAttrib1fv glVertexAttrib1fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexAttrib2f(UInt32 indx, Single x, Single y);
|
||||
internal static VertexAttrib2f glVertexAttrib2f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void VertexAttrib2fv(UInt32 indx, Single* values);
|
||||
internal unsafe static VertexAttrib2fv glVertexAttrib2fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexAttrib3f(UInt32 indx, Single x, Single y, Single z);
|
||||
internal static VertexAttrib3f glVertexAttrib3f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void VertexAttrib3fv(UInt32 indx, Single* values);
|
||||
internal unsafe static VertexAttrib3fv glVertexAttrib3fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexAttrib4f(UInt32 indx, Single x, Single y, Single z, Single w);
|
||||
internal static VertexAttrib4f glVertexAttrib4f;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal unsafe delegate void VertexAttrib4fv(UInt32 indx, Single* values);
|
||||
internal unsafe static VertexAttrib4fv glVertexAttrib4fv;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void VertexAttribPointer(UInt32 indx, Int32 size, OpenTK.Graphics.ES20.VertexAttribPointerType type, bool normalized, Int32 stride, IntPtr ptr);
|
||||
internal static VertexAttribPointer glVertexAttribPointer;
|
||||
[System.Security.SuppressUnmanagedCodeSecurity()]
|
||||
internal delegate void Viewport(Int32 x, Int32 y, Int32 width, Int32 height);
|
||||
internal static Viewport glViewport;
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,136 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
/* flibit Changes GraphicsContext stuff to IntPtr, an SDL_GLContext. */
|
||||
|
||||
namespace OpenTK.Graphics.ES20
|
||||
{
|
||||
// Used in debug-mode only, for automatic OpenGL error-checking.
|
||||
//
|
||||
// Works like this: an instance is created before each OpenGL function is called.
|
||||
// The constructor resets the OpenGL error state. Once the native function returns,
|
||||
// the error state is checked again, raising the relevant exceptions.
|
||||
//
|
||||
// A using-region is used to ensure Dispose() is called.
|
||||
//
|
||||
// Make sure that no error checking is added to the GetError function,
|
||||
// as that would cause infinite recursion!
|
||||
struct ErrorHelper : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
static readonly object SyncRoot = new object();
|
||||
static readonly Dictionary<IntPtr, List<ErrorCode>> ContextErrors =
|
||||
new Dictionary<IntPtr, List<ErrorCode>>();
|
||||
readonly IntPtr Context;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ErrorHelper(IntPtr context)
|
||||
{
|
||||
if (context == IntPtr.Zero)
|
||||
throw new GraphicsContextMissingException();
|
||||
|
||||
Context = context;
|
||||
lock (SyncRoot)
|
||||
{
|
||||
if (!ContextErrors.ContainsKey(Context))
|
||||
ContextErrors.Add(Context, new List<ErrorCode>());
|
||||
}
|
||||
ResetErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
// Retrieve all OpenGL errors to clear the error list.
|
||||
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
|
||||
[Conditional("DEBUG")]
|
||||
internal void ResetErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
while ((ErrorCode)GL.GetError() != ErrorCode.NoError)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve all OpenGL errors and throw an exception if anything other than NoError is returned.
|
||||
[Conditional("DEBUG")]
|
||||
internal void CheckErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
List<ErrorCode> error_list = ContextErrors[Context];
|
||||
error_list.Clear();
|
||||
ErrorCode error;
|
||||
do
|
||||
{
|
||||
error = (ErrorCode)GL.GetError();
|
||||
error_list.Add(error);
|
||||
} while (error != ErrorCode.NoError);
|
||||
|
||||
if (error_list.Count != 1)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (ErrorCode e in error_list)
|
||||
{
|
||||
if (e != ErrorCode.NoError)
|
||||
{
|
||||
sb.Append(e.ToString());
|
||||
sb.Append(", ");
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
sb.Remove(sb.Length - 2, 2); // Remove the last comma
|
||||
|
||||
throw new GraphicsErrorException(sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CheckErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,445 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
// flibit added this!
|
||||
#pragma warning disable 3021
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !MINIMAL
|
||||
using System.Drawing;
|
||||
#endif
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Graphics.ES20
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides access to OpenGL ES 2.0 methods.
|
||||
/// </summary>
|
||||
public sealed partial class GL : GraphicsBindingsBase
|
||||
{
|
||||
const string Library = "libGLESv2.dll";
|
||||
static readonly object sync_root = new object();
|
||||
|
||||
#region --- Protected Members ---
|
||||
|
||||
/// <summary>
|
||||
/// Returns a synchronization token unique for the GL class.
|
||||
/// </summary>
|
||||
protected override object SyncRoot
|
||||
{
|
||||
get { return sync_root; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helper Overloads
|
||||
|
||||
#pragma warning disable 3019
|
||||
#pragma warning disable 1591
|
||||
#pragma warning disable 1572
|
||||
#pragma warning disable 1573
|
||||
|
||||
// Note: Mono 1.9.1 truncates StringBuilder results (for 'out string' parameters).
|
||||
// We work around this issue by doubling the StringBuilder capacity.
|
||||
|
||||
#region public static void ClearColor() overloads
|
||||
|
||||
public static void ClearColor(Color color)
|
||||
{
|
||||
GL.ClearColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
|
||||
}
|
||||
|
||||
public static void ClearColor(Color4 color)
|
||||
{
|
||||
GL.ClearColor(color.R, color.G, color.B, color.A);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void BlendColor() overloads
|
||||
|
||||
public static void BlendColor(Color color)
|
||||
{
|
||||
GL.BlendColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
|
||||
}
|
||||
|
||||
public static void BlendColor(Color4 color)
|
||||
{
|
||||
GL.BlendColor(color.R, color.G, color.B, color.A);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Uniform
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void Uniform2(int location, ref Vector2 vector)
|
||||
{
|
||||
GL.Uniform2(location, vector.X, vector.Y);
|
||||
}
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void Uniform3(int location, ref Vector3 vector)
|
||||
{
|
||||
GL.Uniform3(location, vector.X, vector.Y, vector.Z);
|
||||
}
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void Uniform4(int location, ref Vector4 vector)
|
||||
{
|
||||
GL.Uniform4(location, vector.X, vector.Y, vector.Z, vector.W);
|
||||
}
|
||||
|
||||
public static void Uniform2(int location, Vector2 vector)
|
||||
{
|
||||
GL.Uniform2(location, vector.X, vector.Y);
|
||||
}
|
||||
|
||||
public static void Uniform3(int location, Vector3 vector)
|
||||
{
|
||||
GL.Uniform3(location, vector.X, vector.Y, vector.Z);
|
||||
}
|
||||
|
||||
public static void Uniform4(int location, Vector4 vector)
|
||||
{
|
||||
GL.Uniform4(location, vector.X, vector.Y, vector.Z, vector.W);
|
||||
}
|
||||
|
||||
public static void Uniform4(int location, Color4 color)
|
||||
{
|
||||
GL.Uniform4(location, color.R, color.G, color.B, color.A);
|
||||
}
|
||||
|
||||
public static void Uniform4(int location, Quaternion quaternion)
|
||||
{
|
||||
GL.Uniform4(location, quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
|
||||
}
|
||||
|
||||
public static void UniformMatrix4(int location, bool transpose, ref Matrix4 matrix)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (float* matrix_ptr = &matrix.Row0.X)
|
||||
{
|
||||
GL.UniformMatrix4(location, 1, transpose, matrix_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Shaders
|
||||
|
||||
#region GetActiveAttrib
|
||||
|
||||
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, ProgramParameter.ActiveAttributeMaxLength, out length);
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
|
||||
|
||||
GetActiveAttrib(program, index, sb.Capacity, out length, out size, out type, sb);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GetActiveUniform
|
||||
|
||||
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
|
||||
{
|
||||
int length;
|
||||
GetProgram(program, ProgramParameter.ActiveUniformMaxLength, out length);
|
||||
|
||||
StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
|
||||
GetActiveUniform(program, uniformIndex, sb.Capacity, out length, out size, out type, sb);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void ShaderSource(Int32 shader, System.String @string)
|
||||
|
||||
public static void ShaderSource(Int32 shader, System.String @string)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
int length = @string.Length;
|
||||
GL.ShaderSource((UInt32)shader, 1, new string[] { @string }, &length);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static string GetShaderInfoLog(Int32 shader)
|
||||
|
||||
public static string GetShaderInfoLog(Int32 shader)
|
||||
{
|
||||
string info;
|
||||
GetShaderInfoLog(shader, out info);
|
||||
return info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void GetShaderInfoLog(Int32 shader, out string info)
|
||||
|
||||
public static void GetShaderInfoLog(Int32 shader, out string info)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
int length;
|
||||
GL.GetShader(shader, ShaderParameter.InfoLogLength, out length);
|
||||
if (length == 0)
|
||||
{
|
||||
info = String.Empty;
|
||||
return;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(length * 2);
|
||||
GL.GetShaderInfoLog((UInt32)shader, sb.Capacity, &length, sb);
|
||||
info = sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static string GetProgramInfoLog(Int32 program)
|
||||
|
||||
public static string GetProgramInfoLog(Int32 program)
|
||||
{
|
||||
string info;
|
||||
GetProgramInfoLog(program, out info);
|
||||
return info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void GetProgramInfoLog(Int32 program, out string info)
|
||||
|
||||
public static void GetProgramInfoLog(Int32 program, out string info)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
int length;
|
||||
GL.GetProgram(program, ProgramParameter.InfoLogLength, out length); if (length == 0)
|
||||
{
|
||||
info = String.Empty;
|
||||
return;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(length * 2);
|
||||
GL.GetProgramInfoLog((UInt32)program, sb.Capacity, &length, sb);
|
||||
info = sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void VertexAttrib2(Int32 index, ref Vector2 v)
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void VertexAttrib2(Int32 index, ref Vector2 v)
|
||||
{
|
||||
GL.VertexAttrib2(index, v.X, v.Y);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void VertexAttrib3(Int32 index, ref Vector3 v)
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void VertexAttrib3(Int32 index, ref Vector3 v)
|
||||
{
|
||||
GL.VertexAttrib3(index, v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void VertexAttrib4(Int32 index, ref Vector4 v)
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void VertexAttrib4(Int32 index, ref Vector4 v)
|
||||
{
|
||||
GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void VertexAttrib2(Int32 index, Vector2 v)
|
||||
|
||||
public static void VertexAttrib2(Int32 index, Vector2 v)
|
||||
{
|
||||
GL.VertexAttrib2(index, v.X, v.Y);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void VertexAttrib3(Int32 index, Vector3 v)
|
||||
|
||||
public static void VertexAttrib3(Int32 index, Vector3 v)
|
||||
{
|
||||
GL.VertexAttrib3(index, v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void VertexAttrib4(Int32 index, Vector4 v)
|
||||
|
||||
public static void VertexAttrib4(Int32 index, Vector4 v)
|
||||
{
|
||||
GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region VertexAttribPointer
|
||||
|
||||
public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset)
|
||||
{
|
||||
VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
|
||||
}
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static void VertexAttribPointer(uint index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset)
|
||||
{
|
||||
VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DrawElements
|
||||
|
||||
public static void DrawElements(BeginMode mode, int count, DrawElementsType type, int offset)
|
||||
{
|
||||
DrawElements(mode, count, type, new IntPtr(offset));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static int GenTexture()
|
||||
|
||||
public static int GenTexture()
|
||||
{
|
||||
int id;
|
||||
GenTextures(1, out id);
|
||||
return id;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void DeleteTexture(int id)
|
||||
|
||||
public static void DeleteTexture(int id)
|
||||
{
|
||||
DeleteTextures(1, ref id);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get[Float|Double]
|
||||
|
||||
public static void GetFloat(GetPName pname, out Vector2 vector)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (Vector2* ptr = &vector)
|
||||
GetFloat(pname, (float*)ptr);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetFloat(GetPName pname, out Vector3 vector)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (Vector3* ptr = &vector)
|
||||
GetFloat(pname, (float*)ptr);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetFloat(GetPName pname, out Vector4 vector)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (Vector4* ptr = &vector)
|
||||
GetFloat(pname, (float*)ptr);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetFloat(GetPName pname, out Matrix4 matrix)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
fixed (Matrix4* ptr = &matrix)
|
||||
GetFloat(pname, (float*)ptr);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Viewport
|
||||
|
||||
public static void Viewport(Size size)
|
||||
{
|
||||
GL.Viewport(0, 0, size.Width, size.Height);
|
||||
}
|
||||
|
||||
public static void Viewport(Point location, Size size)
|
||||
{
|
||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||
}
|
||||
|
||||
public static void Viewport(Rectangle rectangle)
|
||||
{
|
||||
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||
}
|
||||
#if NO_SYSDRAWING
|
||||
public static void Viewport(OpenTK.Point location, OpenTK.Size size)
|
||||
{
|
||||
GL.Viewport(location.X, location.Y, size.Width, size.Height);
|
||||
}
|
||||
|
||||
public static void Viewport(OpenTK.Rectangle rectangle)
|
||||
{
|
||||
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
#pragma warning restore 3019
|
||||
#pragma warning restore 1591
|
||||
#pragma warning restore 1572
|
||||
#pragma warning restore 1573
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
// flibit added this!
|
||||
#pragma warning restore 3021
|
|
@ -0,0 +1,59 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using SDL2;
|
||||
|
||||
namespace OpenTK.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements BindingsBase for the OpenTK.Graphics namespace (OpenGL and OpenGL|ES).
|
||||
/// </summary>
|
||||
public abstract class GraphicsBindingsBase : BindingsBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves an unmanaged function pointer to the specified function.
|
||||
/// </summary>
|
||||
/// <param name="funcname">
|
||||
/// A <see cref="System.String"/> that defines the name of the function.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="IntPtr"/> that contains the address of funcname or IntPtr.Zero,
|
||||
/// if the function is not supported by the drivers.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// Note: some drivers are known to return non-zero values for unsupported functions.
|
||||
/// Typical values include 1 and 2 - inheritors are advised to check for and ignore these
|
||||
/// values.
|
||||
/// </remarks>
|
||||
protected override IntPtr GetAddress(string funcname)
|
||||
{
|
||||
// flibit Muddled With This!!!
|
||||
return SDL.SDL_GL_GetProcAddress(funcname);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents errors related to a GraphicsContext.
|
||||
/// </summary>
|
||||
public class GraphicsContextException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructs a new GraphicsContextException.
|
||||
/// </summary>
|
||||
public GraphicsContextException() : base() { }
|
||||
/// <summary>
|
||||
/// Constructs a new GraphicsContextException with the given error message.
|
||||
/// </summary>
|
||||
public GraphicsContextException(string message) : base(message) { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// Thrown when an operation that required GraphicsContext is performed, when no
|
||||
/// GraphicsContext is current in the calling thread.
|
||||
/// </summary>
|
||||
public class GraphicsContextMissingException : GraphicsContextException
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructs a new GraphicsContextMissingException.
|
||||
/// </summary>
|
||||
public GraphicsContextMissingException()
|
||||
: base(String.Format(
|
||||
"No context is current in the calling thread (ThreadId: {0}).",
|
||||
System.Threading.Thread.CurrentThread.ManagedThreadId))
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies a specific OpenGL or OpenGL|ES error. Such exceptions are only thrown
|
||||
/// when OpenGL or OpenGL|ES automatic error checking is enabled -
|
||||
/// <see cref="GraphicsContext.ErrorChecking"/> property.
|
||||
/// Important: Do *not* catch this exception. Rather, fix the underlying issue that caused the error.
|
||||
/// </summary>
|
||||
public class GraphicsErrorException : GraphicsException
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructs a new GraphicsErrorException instance with the specified error message.
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
public GraphicsErrorException(string message) : base(message) { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#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;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>Represents errors related to Graphics operations.</summary>
|
||||
public class GraphicsException : Exception
|
||||
{
|
||||
/// <summary>Constructs a new GraphicsException.</summary>
|
||||
public GraphicsException() : base() { }
|
||||
/// <summary>Constructs a new GraphicsException with the specified excpetion message.</summary>
|
||||
/// <param name="message"></param>
|
||||
public GraphicsException(string message) : base(message) { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
/* flibit Changes GraphicsContext stuff to IntPtr, an SDL_GLContext. */
|
||||
|
||||
namespace OpenTK.Graphics.OpenGL
|
||||
{
|
||||
// Used in debug-mode only, for automatic OpenGL error-checking.
|
||||
//
|
||||
// Works like this: an instance is created before each OpenGL function is called.
|
||||
// The constructor resets the OpenGL error state. Once the native function returns,
|
||||
// the error state is checked again, raising the relevant exceptions.
|
||||
//
|
||||
// A using-region is used to ensure Dispose() is called.
|
||||
//
|
||||
// Make sure that no error checking is added to the GetError function,
|
||||
// as that would cause infinite recursion!
|
||||
struct ErrorHelper : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
static readonly object SyncRoot = new object();
|
||||
static readonly Dictionary<IntPtr, List<ErrorCode>> ContextErrors =
|
||||
new Dictionary<IntPtr, List<ErrorCode>>();
|
||||
readonly IntPtr Context;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ErrorHelper(IntPtr context)
|
||||
{
|
||||
if (context == IntPtr.Zero)
|
||||
throw new GraphicsContextMissingException();
|
||||
|
||||
Context = context;
|
||||
lock (SyncRoot)
|
||||
{
|
||||
if (!ContextErrors.ContainsKey(Context))
|
||||
ContextErrors.Add(Context, new List<ErrorCode>());
|
||||
}
|
||||
ResetErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
// Retrieve all OpenGL errors to clear the error list.
|
||||
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
|
||||
[Conditional("DEBUG")]
|
||||
internal void ResetErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
while (GL.GetError() != ErrorCode.NoError)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve all OpenGL errors and throw an exception if anything other than NoError is returned.
|
||||
[Conditional("DEBUG")]
|
||||
internal void CheckErrors()
|
||||
{
|
||||
if (GraphicsContext.ErrorChecking)
|
||||
{
|
||||
List<ErrorCode> error_list = ContextErrors[Context];
|
||||
error_list.Clear();
|
||||
ErrorCode error;
|
||||
do
|
||||
{
|
||||
error = GL.GetError();
|
||||
error_list.Add(error);
|
||||
} while (error != ErrorCode.NoError);
|
||||
|
||||
if (error_list.Count != 1)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (ErrorCode e in error_list)
|
||||
{
|
||||
if (e != ErrorCode.NoError)
|
||||
{
|
||||
sb.Append(e.ToString());
|
||||
sb.Append(", ");
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
sb.Remove(sb.Length - 2, 2); // Remove the last comma
|
||||
|
||||
throw new GraphicsErrorException(sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CheckErrors();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,49 @@
|
|||
#region License
|
||||
/* SDL2# - C# Wrapper for SDL2
|
||||
*
|
||||
* Copyright (c) 2013-2014 Ethan Lee.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied warranty.
|
||||
* In no event will the authors be held liable for any damages arising from
|
||||
* the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software in a
|
||||
* product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*
|
||||
* Ethan "flibitijibibo" Lee <flibitijibibo@flibitijibibo.com>
|
||||
*
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace OpenTK.Graphics
|
||||
{
|
||||
public class GraphicsContext
|
||||
{
|
||||
public static IntPtr CurrentContext
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public static bool ErrorChecking
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,261 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||
* This notice may not be removed from any source distribution.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*
|
||||
* Contributions by Georg W<EFBFBD>chter.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a bezier curve with as many points as you want.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct BezierCurve
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private List<Vector2> points;
|
||||
|
||||
/// <summary>
|
||||
/// The parallel value.
|
||||
/// </summary>
|
||||
/// <remarks>This value defines whether the curve should be calculated as a
|
||||
/// parallel curve to the original bezier curve. A value of 0.0f represents
|
||||
/// the original curve, 5.0f i.e. stands for a curve that has always a distance
|
||||
/// of 5.0f to the orignal curve at any point.</remarks>
|
||||
public float Parallel;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets the points of this curve.
|
||||
/// </summary>
|
||||
/// <remarks>The first point and the last points represent the anchor points.</remarks>
|
||||
public IList<Vector2> Points
|
||||
{
|
||||
get
|
||||
{
|
||||
return points;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurve"/>.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
public BezierCurve(IEnumerable<Vector2> points)
|
||||
{
|
||||
if (points == null)
|
||||
throw new ArgumentNullException("points", "Must point to a valid list of Vector2 structures.");
|
||||
|
||||
this.points = new List<Vector2>(points);
|
||||
this.Parallel = 0.0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurve"/>.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
public BezierCurve(params Vector2[] points)
|
||||
{
|
||||
if (points == null)
|
||||
throw new ArgumentNullException("points", "Must point to a valid list of Vector2 structures.");
|
||||
|
||||
this.points = new List<Vector2>(points);
|
||||
this.Parallel = 0.0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurve"/>.
|
||||
/// </summary>
|
||||
/// <param name="parallel">The parallel value.</param>
|
||||
/// <param name="points">The points.</param>
|
||||
public BezierCurve(float parallel, params Vector2[] points)
|
||||
{
|
||||
if (points == null)
|
||||
throw new ArgumentNullException("points", "Must point to a valid list of Vector2 structures.");
|
||||
|
||||
this.Parallel = parallel;
|
||||
this.points = new List<Vector2>(points);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurve"/>.
|
||||
/// </summary>
|
||||
/// <param name="parallel">The parallel value.</param>
|
||||
/// <param name="points">The points.</param>
|
||||
public BezierCurve(float parallel, IEnumerable<Vector2> points)
|
||||
{
|
||||
if (points == null)
|
||||
throw new ArgumentNullException("points", "Must point to a valid list of Vector2 structures.");
|
||||
|
||||
this.Parallel = parallel;
|
||||
this.points = new List<Vector2>(points);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point with the specified t.
|
||||
/// </summary>
|
||||
/// <param name="t">The t value, between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
public Vector2 CalculatePoint(float t)
|
||||
{
|
||||
return BezierCurve.CalculatePoint(points, t, Parallel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the length of this bezier curve.
|
||||
/// </summary>
|
||||
/// <param name="precision">The precision.</param>
|
||||
/// <returns>Length of curve.</returns>
|
||||
/// <remarks>The precision gets better as the <paramref name="precision"/>
|
||||
/// value gets smaller.</remarks>
|
||||
public float CalculateLength(float precision)
|
||||
{
|
||||
return BezierCurve.CalculateLength(points, precision, Parallel);
|
||||
}
|
||||
|
||||
#region Static methods
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the length of the specified bezier curve.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
/// <param name="precision">The precision value.</param>
|
||||
/// <returns>The precision gets better as the <paramref name="precision"/>
|
||||
/// value gets smaller.</returns>
|
||||
public static float CalculateLength(IList<Vector2> points, float precision)
|
||||
{
|
||||
return BezierCurve.CalculateLength(points, precision, 0.0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the length of the specified bezier curve.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
/// <param name="precision">The precision value.</param>
|
||||
/// <param name="parallel">The parallel value.</param>
|
||||
/// <returns>Length of curve.</returns>
|
||||
/// <remarks><para>The precision gets better as the <paramref name="precision"/>
|
||||
/// value gets smaller.</para>
|
||||
/// <para>The <paramref name="parallel"/> parameter defines whether the curve should be calculated as a
|
||||
/// parallel curve to the original bezier curve. A value of 0.0f represents
|
||||
/// the original curve, 5.0f represents a curve that has always a distance
|
||||
/// of 5.0f to the orignal curve.</para></remarks>
|
||||
public static float CalculateLength(IList<Vector2> points, float precision, float parallel)
|
||||
{
|
||||
float length = 0.0f;
|
||||
Vector2 old = BezierCurve.CalculatePoint(points, 0.0f, parallel);
|
||||
|
||||
for (float i = precision; i < (1.0f + precision); i += precision)
|
||||
{
|
||||
Vector2 n = CalculatePoint(points, i, parallel);
|
||||
length += (n - old).Length;
|
||||
old = n;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point on the given bezier curve with the specified t parameter.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
/// <param name="t">The t parameter, a value between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
public static Vector2 CalculatePoint(IList<Vector2> points, float t)
|
||||
{
|
||||
return BezierCurve.CalculatePoint(points, t, 0.0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point on the given bezier curve with the specified t parameter.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
/// <param name="t">The t parameter, a value between 0.0f and 1.0f.</param>
|
||||
/// <param name="parallel">The parallel value.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
/// <remarks>The <paramref name="parallel"/> parameter defines whether the curve should be calculated as a
|
||||
/// parallel curve to the original bezier curve. A value of 0.0f represents
|
||||
/// the original curve, 5.0f represents a curve that has always a distance
|
||||
/// of 5.0f to the orignal curve.</remarks>
|
||||
public static Vector2 CalculatePoint(IList<Vector2> points, float t, float parallel)
|
||||
{
|
||||
Vector2 r = new Vector2();
|
||||
double c = 1.0d - (double)t;
|
||||
float temp;
|
||||
int i = 0;
|
||||
|
||||
foreach (Vector2 pt in points)
|
||||
{
|
||||
temp = (float)MathHelper.BinomialCoefficient(points.Count - 1, i) * (float)(System.Math.Pow(t, i) *
|
||||
System.Math.Pow(c, (points.Count - 1) - i));
|
||||
|
||||
r.X += temp * pt.X;
|
||||
r.Y += temp * pt.Y;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (parallel == 0.0f)
|
||||
return r;
|
||||
|
||||
Vector2 perpendicular = new Vector2();
|
||||
|
||||
if (t != 0.0f)
|
||||
perpendicular = r - BezierCurve.CalculatePointOfDerivative(points, t);
|
||||
else
|
||||
perpendicular = points[1] - points[0];
|
||||
|
||||
return r + Vector2.Normalize(perpendicular).PerpendicularRight * parallel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point with the specified t of the derivative of the given bezier function.
|
||||
/// </summary>
|
||||
/// <param name="points">The points.</param>
|
||||
/// <param name="t">The t parameter, value between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
private static Vector2 CalculatePointOfDerivative(IList<Vector2> points, float t)
|
||||
{
|
||||
Vector2 r = new Vector2();
|
||||
double c = 1.0d - (double)t;
|
||||
float temp;
|
||||
int i = 0;
|
||||
|
||||
foreach (Vector2 pt in points)
|
||||
{
|
||||
temp = (float)MathHelper.BinomialCoefficient(points.Count - 2, i) * (float)(System.Math.Pow(t, i) *
|
||||
System.Math.Pow(c, (points.Count - 2) - i));
|
||||
|
||||
r.X += temp * pt.X;
|
||||
r.Y += temp * pt.Y;
|
||||
i++;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||
* This notice may not be removed from any source distribution.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*
|
||||
* Contributions by Georg W<EFBFBD>chter.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a cubic bezier curve with two anchor and two control points.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct BezierCurveCubic
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Start anchor point.
|
||||
/// </summary>
|
||||
public Vector2 StartAnchor;
|
||||
|
||||
/// <summary>
|
||||
/// End anchor point.
|
||||
/// </summary>
|
||||
public Vector2 EndAnchor;
|
||||
|
||||
/// <summary>
|
||||
/// First control point, controls the direction of the curve start.
|
||||
/// </summary>
|
||||
public Vector2 FirstControlPoint;
|
||||
|
||||
/// <summary>
|
||||
/// Second control point, controls the direction of the curve end.
|
||||
/// </summary>
|
||||
public Vector2 SecondControlPoint;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parallel value.
|
||||
/// </summary>
|
||||
/// <remarks>This value defines whether the curve should be calculated as a
|
||||
/// parallel curve to the original bezier curve. A value of 0.0f represents
|
||||
/// the original curve, 5.0f i.e. stands for a curve that has always a distance
|
||||
/// of 5.f to the orignal curve at any point.</remarks>
|
||||
public float Parallel;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurveCubic"/>.
|
||||
/// </summary>
|
||||
/// <param name="startAnchor">The start anchor point.</param>
|
||||
/// <param name="endAnchor">The end anchor point.</param>
|
||||
/// <param name="firstControlPoint">The first control point.</param>
|
||||
/// <param name="secondControlPoint">The second control point.</param>
|
||||
public BezierCurveCubic(Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint)
|
||||
{
|
||||
this.StartAnchor = startAnchor;
|
||||
this.EndAnchor = endAnchor;
|
||||
this.FirstControlPoint = firstControlPoint;
|
||||
this.SecondControlPoint = secondControlPoint;
|
||||
this.Parallel = 0.0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurveCubic"/>.
|
||||
/// </summary>
|
||||
/// <param name="parallel">The parallel value.</param>
|
||||
/// <param name="startAnchor">The start anchor point.</param>
|
||||
/// <param name="endAnchor">The end anchor point.</param>
|
||||
/// <param name="firstControlPoint">The first control point.</param>
|
||||
/// <param name="secondControlPoint">The second control point.</param>
|
||||
public BezierCurveCubic(float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint)
|
||||
{
|
||||
this.Parallel = parallel;
|
||||
this.StartAnchor = startAnchor;
|
||||
this.EndAnchor = endAnchor;
|
||||
this.FirstControlPoint = firstControlPoint;
|
||||
this.SecondControlPoint = secondControlPoint;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point with the specified t.
|
||||
/// </summary>
|
||||
/// <param name="t">The t value, between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
public Vector2 CalculatePoint(float t)
|
||||
{
|
||||
Vector2 r = new Vector2();
|
||||
float c = 1.0f - t;
|
||||
|
||||
r.X = (StartAnchor.X * c * c * c) + (FirstControlPoint.X * 3 * t * c * c) + (SecondControlPoint.X * 3 * t * t * c)
|
||||
+ EndAnchor.X * t * t * t;
|
||||
r.Y = (StartAnchor.Y * c * c * c) + (FirstControlPoint.Y * 3 * t * c * c) + (SecondControlPoint.Y * 3 * t * t * c)
|
||||
+ EndAnchor.Y * t * t * t;
|
||||
|
||||
if (Parallel == 0.0f)
|
||||
return r;
|
||||
|
||||
Vector2 perpendicular = new Vector2();
|
||||
|
||||
if (t == 0.0f)
|
||||
perpendicular = FirstControlPoint - StartAnchor;
|
||||
else
|
||||
perpendicular = r - CalculatePointOfDerivative(t);
|
||||
|
||||
return r + Vector2.Normalize(perpendicular).PerpendicularRight * Parallel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point with the specified t of the derivative of this function.
|
||||
/// </summary>
|
||||
/// <param name="t">The t, value between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
private Vector2 CalculatePointOfDerivative(float t)
|
||||
{
|
||||
Vector2 r = new Vector2();
|
||||
float c = 1.0f - t;
|
||||
|
||||
r.X = (c * c * StartAnchor.X) + (2 * t * c * FirstControlPoint.X) + (t * t * SecondControlPoint.X);
|
||||
r.Y = (c * c * StartAnchor.Y) + (2 * t * c * FirstControlPoint.Y) + (t * t * SecondControlPoint.Y);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the length of this bezier curve.
|
||||
/// </summary>
|
||||
/// <param name="precision">The precision.</param>
|
||||
/// <returns>Length of the curve.</returns>
|
||||
/// <remarks>The precision gets better when the <paramref name="precision"/>
|
||||
/// value gets smaller.</remarks>
|
||||
public float CalculateLength(float precision)
|
||||
{
|
||||
float length = 0.0f;
|
||||
Vector2 old = CalculatePoint(0.0f);
|
||||
|
||||
for (float i = precision; i < (1.0f + precision); i += precision)
|
||||
{
|
||||
Vector2 n = CalculatePoint(i);
|
||||
length += (n - old).Length;
|
||||
old = n;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,151 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||
* This notice may not be removed from any source distribution.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*
|
||||
* Contributions by Georg W<EFBFBD>chter.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a quadric bezier curve with two anchor and one control point.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct BezierCurveQuadric
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Start anchor point.
|
||||
/// </summary>
|
||||
public Vector2 StartAnchor;
|
||||
|
||||
/// <summary>
|
||||
/// End anchor point.
|
||||
/// </summary>
|
||||
public Vector2 EndAnchor;
|
||||
|
||||
/// <summary>
|
||||
/// Control point, controls the direction of both endings of the curve.
|
||||
/// </summary>
|
||||
public Vector2 ControlPoint;
|
||||
|
||||
/// <summary>
|
||||
/// The parallel value.
|
||||
/// </summary>
|
||||
/// <remarks>This value defines whether the curve should be calculated as a
|
||||
/// parallel curve to the original bezier curve. A value of 0.0f represents
|
||||
/// the original curve, 5.0f i.e. stands for a curve that has always a distance
|
||||
/// of 5.f to the orignal curve at any point.</remarks>
|
||||
public float Parallel;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurveQuadric"/>.
|
||||
/// </summary>
|
||||
/// <param name="startAnchor">The start anchor.</param>
|
||||
/// <param name="endAnchor">The end anchor.</param>
|
||||
/// <param name="controlPoint">The control point.</param>
|
||||
public BezierCurveQuadric(Vector2 startAnchor, Vector2 endAnchor, Vector2 controlPoint)
|
||||
{
|
||||
this.StartAnchor = startAnchor;
|
||||
this.EndAnchor = endAnchor;
|
||||
this.ControlPoint = controlPoint;
|
||||
this.Parallel = 0.0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new <see cref="BezierCurveQuadric"/>.
|
||||
/// </summary>
|
||||
/// <param name="parallel">The parallel value.</param>
|
||||
/// <param name="startAnchor">The start anchor.</param>
|
||||
/// <param name="endAnchor">The end anchor.</param>
|
||||
/// <param name="controlPoint">The control point.</param>
|
||||
public BezierCurveQuadric(float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 controlPoint)
|
||||
{
|
||||
this.Parallel = parallel;
|
||||
this.StartAnchor = startAnchor;
|
||||
this.EndAnchor = endAnchor;
|
||||
this.ControlPoint = controlPoint;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point with the specified t.
|
||||
/// </summary>
|
||||
/// <param name="t">The t value, between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
public Vector2 CalculatePoint(float t)
|
||||
{
|
||||
Vector2 r = new Vector2();
|
||||
float c = 1.0f - t;
|
||||
|
||||
r.X = (c * c * StartAnchor.X) + (2 * t * c * ControlPoint.X) + (t * t * EndAnchor.X);
|
||||
r.Y = (c * c * StartAnchor.Y) + (2 * t * c * ControlPoint.Y) + (t * t * EndAnchor.Y);
|
||||
|
||||
if (Parallel == 0.0f)
|
||||
return r;
|
||||
|
||||
Vector2 perpendicular = new Vector2();
|
||||
|
||||
if (t == 0.0f)
|
||||
perpendicular = ControlPoint - StartAnchor;
|
||||
else
|
||||
perpendicular = r - CalculatePointOfDerivative(t);
|
||||
|
||||
return r + Vector2.Normalize(perpendicular).PerpendicularRight * Parallel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the point with the specified t of the derivative of this function.
|
||||
/// </summary>
|
||||
/// <param name="t">The t, value between 0.0f and 1.0f.</param>
|
||||
/// <returns>Resulting point.</returns>
|
||||
private Vector2 CalculatePointOfDerivative(float t)
|
||||
{
|
||||
Vector2 r = new Vector2();
|
||||
|
||||
r.X = (1.0f - t) * StartAnchor.X + t * ControlPoint.X;
|
||||
r.Y = (1.0f - t) * StartAnchor.Y + t * ControlPoint.Y;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the length of this bezier curve.
|
||||
/// </summary>
|
||||
/// <param name="precision">The precision.</param>
|
||||
/// <returns>Length of curve.</returns>
|
||||
/// <remarks>The precision gets better when the <paramref name="precision"/>
|
||||
/// value gets smaller.</remarks>
|
||||
public float CalculateLength(float precision)
|
||||
{
|
||||
float length = 0.0f;
|
||||
Vector2 old = CalculatePoint(0.0f);
|
||||
|
||||
for (float i = precision; i < (1.0f + precision); i += precision)
|
||||
{
|
||||
Vector2 n = CalculatePoint(i);
|
||||
length += (n - old).Length;
|
||||
old = n;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
#region --- License ---
|
||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a 2d box (rectangle).
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Box2
|
||||
{
|
||||
/// <summary>
|
||||
/// The left boundary of the structure.
|
||||
/// </summary>
|
||||
public float Left;
|
||||
|
||||
/// <summary>
|
||||
/// The right boundary of the structure.
|
||||
/// </summary>
|
||||
public float Right;
|
||||
|
||||
/// <summary>
|
||||
/// The top boundary of the structure.
|
||||
/// </summary>
|
||||
public float Top;
|
||||
|
||||
/// <summary>
|
||||
/// The bottom boundary of the structure.
|
||||
/// </summary>
|
||||
public float Bottom;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Box2 with the specified dimensions.
|
||||
/// </summary>
|
||||
/// <param name="topLeft">AnOpenTK.Vector2 describing the top-left corner of the Box2.</param>
|
||||
/// <param name="bottomRight">An OpenTK.Vector2 describing the bottom-right corner of the Box2.</param>
|
||||
public Box2(Vector2 topLeft, Vector2 bottomRight)
|
||||
{
|
||||
Left = topLeft.X;
|
||||
Top = topLeft.Y;
|
||||
Right = bottomRight.X;
|
||||
Bottom = bottomRight.Y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Box2 with the specified dimensions.
|
||||
/// </summary>
|
||||
/// <param name="left">The position of the left boundary.</param>
|
||||
/// <param name="top">The position of the top boundary.</param>
|
||||
/// <param name="right">The position of the right boundary.</param>
|
||||
/// <param name="bottom">The position of the bottom boundary.</param>
|
||||
public Box2(float left, float top, float right, float bottom)
|
||||
{
|
||||
Left = left;
|
||||
Top = top;
|
||||
Right = right;
|
||||
Bottom = bottom;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Box2 with the specified dimensions.
|
||||
/// </summary>
|
||||
/// <param name="top">The position of the top boundary.</param>
|
||||
/// <param name="left">The position of the left boundary.</param>
|
||||
/// <param name="right">The position of the right boundary.</param>
|
||||
/// <param name="bottom">The position of the bottom boundary.</param>
|
||||
/// <returns>A new OpenTK.Box2 with the specfied dimensions.</returns>
|
||||
public static Box2 FromTLRB(float top, float left, float right, float bottom)
|
||||
{
|
||||
return new Box2(left, top, right, bottom);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a float describing the width of the Box2 structure.
|
||||
/// </summary>
|
||||
public float Width { get { return (float)System.Math.Abs(Right - Left); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a float describing the height of the Box2 structure.
|
||||
/// </summary>
|
||||
public float Height { get { return (float)System.Math.Abs(Bottom - Top); } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String"/> describing the current instance.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("({0},{1})-({2},{3})", Left, Top, Right, Bottom);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,371 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||
* This notice may not be removed from any source distribution.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*
|
||||
* Contributions by Andy Gill, James Talton and Georg Wächter.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains mathematical functions for the OpenTK.Math toolkit.
|
||||
/// </summary>
|
||||
[Obsolete("Use OpenTK.MathHelper instead.")]
|
||||
public static class Functions
|
||||
{
|
||||
#region NextPowerOfTwo
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static long NextPowerOfTwo(long n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (long)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static int NextPowerOfTwo(int n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (int)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static float NextPowerOfTwo(float n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (float)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static double NextPowerOfTwo(double n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Factorial
|
||||
|
||||
/// <summary>Calculates the factorial of a given natural number.
|
||||
/// </summary>
|
||||
/// <param name="n">The number.</param>
|
||||
/// <returns>n!</returns>
|
||||
public static long Factorial(int n)
|
||||
{
|
||||
long result = 1;
|
||||
|
||||
for (; n > 1; n--)
|
||||
result *= n;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region BinomialCoefficient
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the binomial coefficient <paramref name="n"/> above <paramref name="k"/>.
|
||||
/// </summary>
|
||||
/// <param name="n">The n.</param>
|
||||
/// <param name="k">The k.</param>
|
||||
/// <returns>n! / (k! * (n - k)!)</returns>
|
||||
public static long BinomialCoefficient(int n, int k)
|
||||
{
|
||||
return Factorial(n) / (Factorial(k) * Factorial(n - k));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region InverseSqrtFast
|
||||
|
||||
/// <summary>
|
||||
/// Returns an approximation of the inverse square root of left number.
|
||||
/// </summary>
|
||||
/// <param name="x">A number.</param>
|
||||
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
|
||||
/// <remarks>
|
||||
/// This is an improved implementation of the the method known as Carmack's inverse square root
|
||||
/// which is found in the Quake III source code. This implementation comes from
|
||||
/// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see
|
||||
/// http://www.beyond3d.com/content/articles/8/
|
||||
/// </remarks>
|
||||
public static float InverseSqrtFast(float x)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
float xhalf = 0.5f * x;
|
||||
int i = *(int*)&x; // Read bits as integer.
|
||||
i = 0x5f375a86 - (i >> 1); // Make an initial guess for Newton-Raphson approximation
|
||||
x = *(float*)&i; // Convert bits back to float
|
||||
x = x * (1.5f - xhalf * x * x); // Perform left single Newton-Raphson step.
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an approximation of the inverse square root of left number.
|
||||
/// </summary>
|
||||
/// <param name="x">A number.</param>
|
||||
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
|
||||
/// <remarks>
|
||||
/// This is an improved implementation of the the method known as Carmack's inverse square root
|
||||
/// which is found in the Quake III source code. This implementation comes from
|
||||
/// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see
|
||||
/// http://www.beyond3d.com/content/articles/8/
|
||||
/// </remarks>
|
||||
public static double InverseSqrtFast(double x)
|
||||
{
|
||||
return InverseSqrtFast((float)x);
|
||||
// TODO: The following code is wrong. Fix it, to improve precision.
|
||||
#if false
|
||||
unsafe
|
||||
{
|
||||
double xhalf = 0.5f * x;
|
||||
int i = *(int*)&x; // Read bits as integer.
|
||||
i = 0x5f375a86 - (i >> 1); // Make an initial guess for Newton-Raphson approximation
|
||||
x = *(float*)&i; // Convert bits back to float
|
||||
x = x * (1.5f - xhalf * x * x); // Perform left single Newton-Raphson step.
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DegreesToRadians
|
||||
|
||||
/// <summary>
|
||||
/// Convert degrees to radians
|
||||
/// </summary>
|
||||
/// <param name="degrees">An angle in degrees</param>
|
||||
/// <returns>The angle expressed in radians</returns>
|
||||
public static float DegreesToRadians(float degrees)
|
||||
{
|
||||
const float degToRad = (float)System.Math.PI / 180.0f;
|
||||
return degrees * degToRad;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert radians to degrees
|
||||
/// </summary>
|
||||
/// <param name="radians">An angle in radians</param>
|
||||
/// <returns>The angle expressed in degrees</returns>
|
||||
public static float RadiansToDegrees(float radians)
|
||||
{
|
||||
const float radToDeg = 180.0f / (float)System.Math.PI;
|
||||
return radians * radToDeg;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mathematical constants
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete. Do not use.
|
||||
/// </summary>
|
||||
public static readonly float PIF = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382f;
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete. Do not use.
|
||||
/// </summary>
|
||||
public static readonly float RTODF = 180.0f / PIF;
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete. Do not use.
|
||||
/// </summary>
|
||||
public static readonly float DTORF = PIF / 180.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete. Do not use.
|
||||
/// </summary>
|
||||
public static readonly double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382d;
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete. Do not use.
|
||||
/// </summary>
|
||||
public static readonly double RTOD = 180.0d / PIF;
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete. Do not use.
|
||||
/// </summary>
|
||||
public static readonly double DTOR = PIF / 180.0d;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Swap
|
||||
|
||||
/// <summary>
|
||||
/// Swaps two float values.
|
||||
/// </summary>
|
||||
/// <param name="a">The first value.</param>
|
||||
/// <param name="b">The second value.</param>
|
||||
public static void Swap(ref double a, ref double b)
|
||||
{
|
||||
double temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Swaps two float values.
|
||||
/// </summary>
|
||||
/// <param name="a">The first value.</param>
|
||||
/// <param name="b">The second value.</param>
|
||||
public static void Swap(ref float a, ref float b)
|
||||
{
|
||||
float temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#if false
|
||||
public static partial class Math
|
||||
{
|
||||
#region --- Vectors ---
|
||||
|
||||
#region --- Addition ---
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector2 to the current Vector3.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector3 containing the result of the addition.</returns>
|
||||
public static Vector2 Add(Vector2 left, Vector2 right)
|
||||
{
|
||||
return new Vector2(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector3 to the current Vector3.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector3 containing the result of the addition.</returns>
|
||||
public static Vector3 Add(Vector2 left, Vector3 right)
|
||||
{
|
||||
return new Vector3(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector4 containing the result of the addition.</returns>
|
||||
public static Vector4 Add(Vector2 left, Vector4 right)
|
||||
{
|
||||
return new Vector4(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector2 to the current Vector3.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector3 containing the result of the addition.</returns>
|
||||
public static Vector3 Add(Vector3 left, Vector2 right)
|
||||
{
|
||||
return new Vector3(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector3 to the current Vector3.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector3 containing the result of the addition.</returns>
|
||||
public static Vector3 Add(Vector3 left, Vector3 right)
|
||||
{
|
||||
return new Vector3(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector4 containing the result of the addition.</returns>
|
||||
public static Vector4 Add(Vector3 left, Vector4 right)
|
||||
{
|
||||
return new Vector4(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector2 to the current Vector3.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector3 containing the result of the addition.</returns>
|
||||
public static Vector4 Add(Vector4 left, Vector2 right)
|
||||
{
|
||||
return new Vector4(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector3 to the current Vector3.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector3 containing the result of the addition.</returns>
|
||||
public static Vector4 Add(Vector4 left, Vector3 right)
|
||||
{
|
||||
return new Vector4(left).Add(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the addition.</param>
|
||||
/// <returns>A new Vector4 containing the result of the addition.</returns>
|
||||
public static Vector4 Add(Vector4 left, Vector4 right)
|
||||
{
|
||||
return new Vector4(left).Add(right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Subtraction ---
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Cross ---
|
||||
|
||||
/// <summary>
|
||||
/// Computes the cross product between the current and the given Vector3. The current Vector3 is set to the result of the computation.
|
||||
/// </summary>
|
||||
/// <param name="right">The right operand of the cross product</param>
|
||||
/// <returns>The current </returns>
|
||||
public static Vector3 Cross(Vector3 left, Vector3 right)
|
||||
{
|
||||
return new Vector3(left).Cross(right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,588 @@
|
|||
#region --- License ---
|
||||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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.
|
||||
*/
|
||||
/*
|
||||
The conversion functions are derived from OpenEXR's implementation and are
|
||||
governed by the following license:
|
||||
|
||||
Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
|
||||
Digital Ltd. LLC
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Industrial Light & Magic nor the names of
|
||||
its contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#endregion --- License ---
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The name Half is derived from half-precision floating-point number.
|
||||
/// It occupies only 16 bits, which are split into 1 Sign bit, 5 Exponent bits and 10 Mantissa bits.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Quote from ARB_half_float_pixel specification:
|
||||
/// Any representable 16-bit floating-point value is legal as input to a GL command that accepts 16-bit floating-point data. The
|
||||
/// result of providing a value that is not a floating-point number (such as infinity or NaN) to such a command is unspecified,
|
||||
/// but must not lead to GL interruption or termination. Providing a denormalized number or negative zero to GL must yield
|
||||
/// predictable results.
|
||||
/// </remarks>
|
||||
[Serializable, StructLayout(LayoutKind.Sequential)]
|
||||
public struct Half : ISerializable, IComparable<Half>, IFormattable, IEquatable<Half>
|
||||
{
|
||||
#region Internal Field
|
||||
|
||||
UInt16 bits;
|
||||
|
||||
#endregion Internal Field
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>Returns true if the Half is zero.</summary>
|
||||
public bool IsZero { get { return (bits == 0) || (bits == 0x8000); } }
|
||||
|
||||
/// <summary>Returns true if the Half represents Not A Number (NaN)</summary>
|
||||
public bool IsNaN { get { return (((bits & 0x7C00) == 0x7C00) && (bits & 0x03FF) != 0x0000); } }
|
||||
|
||||
/// <summary>Returns true if the Half represents positive infinity.</summary>
|
||||
public bool IsPositiveInfinity { get { return (bits == 31744); } }
|
||||
|
||||
/// <summary>Returns true if the Half represents negative infinity.</summary>
|
||||
public bool IsNegativeInfinity { get { return (bits == 64512); } }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// The new Half instance will convert the parameter into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="f">32-bit single-precision floating-point number.</param>
|
||||
public Half(Single f)
|
||||
: this()
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
bits = SingleToHalf(*(int*)&f);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half instance will convert the parameter into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="f">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Half(Single f, bool throwOnError)
|
||||
: this(f)
|
||||
{
|
||||
if (throwOnError)
|
||||
{
|
||||
// handle cases that cause overflow rather than silently ignoring it
|
||||
if (f > Half.MaxValue) throw new ArithmeticException("Half: Positive maximum value exceeded.");
|
||||
if (f < -Half.MaxValue) throw new ArithmeticException("Half: Negative minimum value exceeded.");
|
||||
|
||||
// handle cases that make no sense
|
||||
if (Single.IsNaN(f)) throw new ArithmeticException("Half: Input is not a number (NaN).");
|
||||
if (Single.IsPositiveInfinity(f)) throw new ArithmeticException("Half: Input is positive infinity.");
|
||||
if (Single.IsNegativeInfinity(f)) throw new ArithmeticException("Half: Input is negative infinity.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half instance will convert the parameter into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="d">64-bit double-precision floating-point number.</param>
|
||||
public Half(Double d) : this((Single)d) { }
|
||||
|
||||
/// <summary>
|
||||
/// The new Half instance will convert the parameter into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="d">64-bit double-precision floating-point number.</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Half(Double d, bool throwOnError) : this((Single)d, throwOnError) { }
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Single -> Half
|
||||
|
||||
/// <summary>Ported from OpenEXR's IlmBase 1.0.1</summary>
|
||||
private UInt16 SingleToHalf(Int32 si32)
|
||||
{
|
||||
// Our floating point number, F, is represented by the bit pattern in integer i.
|
||||
// Disassemble that bit pattern into the sign, S, the exponent, E, and the significand, M.
|
||||
// Shift S into the position where it will go in in the resulting half number.
|
||||
// Adjust E, accounting for the different exponent bias of float and half (127 versus 15).
|
||||
|
||||
Int32 sign = (si32 >> 16) & 0x00008000;
|
||||
Int32 exponent = ((si32 >> 23) & 0x000000ff) - (127 - 15);
|
||||
Int32 mantissa = si32 & 0x007fffff;
|
||||
|
||||
// Now reassemble S, E and M into a half:
|
||||
|
||||
if (exponent <= 0)
|
||||
{
|
||||
if (exponent < -10)
|
||||
{
|
||||
// E is less than -10. The absolute value of F is less than Half.MinValue
|
||||
// (F may be a small normalized float, a denormalized float or a zero).
|
||||
//
|
||||
// We convert F to a half zero with the same sign as F.
|
||||
|
||||
return (UInt16)sign;
|
||||
}
|
||||
|
||||
// E is between -10 and 0. F is a normalized float whose magnitude is less than Half.MinNormalizedValue.
|
||||
//
|
||||
// We convert F to a denormalized half.
|
||||
|
||||
// Add an explicit leading 1 to the significand.
|
||||
|
||||
mantissa = mantissa | 0x00800000;
|
||||
|
||||
// Round to M to the nearest (10+E)-bit value (with E between -10 and 0); in case of a tie, round to the nearest even value.
|
||||
//
|
||||
// Rounding may cause the significand to overflow and make our number normalized. Because of the way a half's bits
|
||||
// are laid out, we don't have to treat this case separately; the code below will handle it correctly.
|
||||
|
||||
Int32 t = 14 - exponent;
|
||||
Int32 a = (1 << (t - 1)) - 1;
|
||||
Int32 b = (mantissa >> t) & 1;
|
||||
|
||||
mantissa = (mantissa + a + b) >> t;
|
||||
|
||||
// Assemble the half from S, E (==zero) and M.
|
||||
|
||||
return (UInt16)(sign | mantissa);
|
||||
}
|
||||
else if (exponent == 0xff - (127 - 15))
|
||||
{
|
||||
if (mantissa == 0)
|
||||
{
|
||||
// F is an infinity; convert F to a half infinity with the same sign as F.
|
||||
|
||||
return (UInt16)(sign | 0x7c00);
|
||||
}
|
||||
else
|
||||
{
|
||||
// F is a NAN; we produce a half NAN that preserves the sign bit and the 10 leftmost bits of the
|
||||
// significand of F, with one exception: If the 10 leftmost bits are all zero, the NAN would turn
|
||||
// into an infinity, so we have to set at least one bit in the significand.
|
||||
|
||||
mantissa >>= 13;
|
||||
return (UInt16)(sign | 0x7c00 | mantissa | ((mantissa == 0) ? 1 : 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// E is greater than zero. F is a normalized float. We try to convert F to a normalized half.
|
||||
|
||||
// Round to M to the nearest 10-bit value. In case of a tie, round to the nearest even value.
|
||||
|
||||
mantissa = mantissa + 0x00000fff + ((mantissa >> 13) & 1);
|
||||
|
||||
if ((mantissa & 0x00800000) == 1)
|
||||
{
|
||||
mantissa = 0; // overflow in significand,
|
||||
exponent += 1; // adjust exponent
|
||||
}
|
||||
|
||||
// exponent overflow
|
||||
if (exponent > 30) throw new ArithmeticException("Half: Hardware floating-point overflow.");
|
||||
|
||||
// Assemble the half from S, E and M.
|
||||
|
||||
return (UInt16)(sign | (exponent << 10) | (mantissa >> 13));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Single -> Half
|
||||
|
||||
#region Half -> Single
|
||||
|
||||
/// <summary>Converts the 16-bit half to 32-bit floating-point.</summary>
|
||||
/// <returns>A single-precision floating-point number.</returns>
|
||||
public Single ToSingle()
|
||||
{
|
||||
int i = HalfToFloat(bits);
|
||||
|
||||
unsafe
|
||||
{
|
||||
return *(float*)&i;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Ported from OpenEXR's IlmBase 1.0.1</summary>
|
||||
private Int32 HalfToFloat(UInt16 ui16)
|
||||
{
|
||||
|
||||
Int32 sign = (ui16 >> 15) & 0x00000001;
|
||||
Int32 exponent = (ui16 >> 10) & 0x0000001f;
|
||||
Int32 mantissa = ui16 & 0x000003ff;
|
||||
|
||||
if (exponent == 0)
|
||||
{
|
||||
if (mantissa == 0)
|
||||
{
|
||||
// Plus or minus zero
|
||||
|
||||
return sign << 31;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Denormalized number -- renormalize it
|
||||
|
||||
while ((mantissa & 0x00000400) == 0)
|
||||
{
|
||||
mantissa <<= 1;
|
||||
exponent -= 1;
|
||||
}
|
||||
|
||||
exponent += 1;
|
||||
mantissa &= ~0x00000400;
|
||||
}
|
||||
}
|
||||
else if (exponent == 31)
|
||||
{
|
||||
if (mantissa == 0)
|
||||
{
|
||||
// Positive or negative infinity
|
||||
|
||||
return (sign << 31) | 0x7f800000;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Nan -- preserve sign and significand bits
|
||||
|
||||
return (sign << 31) | 0x7f800000 | (mantissa << 13);
|
||||
}
|
||||
}
|
||||
|
||||
// Normalized number
|
||||
|
||||
exponent = exponent + (127 - 15);
|
||||
mantissa = mantissa << 13;
|
||||
|
||||
// Assemble S, E and M.
|
||||
|
||||
return (sign << 31) | (exponent << 23) | mantissa;
|
||||
}
|
||||
|
||||
#endregion Half -> Single
|
||||
|
||||
#region Conversions
|
||||
|
||||
/// <summary>
|
||||
/// Converts a System.Single to a OpenTK.Half.
|
||||
/// </summary>
|
||||
/// <param name="f">The value to convert.
|
||||
/// A <see cref="System.Single"/>
|
||||
/// </param>
|
||||
/// <returns>The result of the conversion.
|
||||
/// A <see cref="Half"/>
|
||||
/// </returns>
|
||||
public static explicit operator Half(float f)
|
||||
{
|
||||
return new Half(f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a System.Double to a OpenTK.Half.
|
||||
/// </summary>
|
||||
/// <param name="d">The value to convert.
|
||||
/// A <see cref="System.Double"/>
|
||||
/// </param>
|
||||
/// <returns>The result of the conversion.
|
||||
/// A <see cref="Half"/>
|
||||
/// </returns>
|
||||
public static explicit operator Half(double d)
|
||||
{
|
||||
return new Half(d);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a OpenTK.Half to a System.Single.
|
||||
/// </summary>
|
||||
/// <param name="h">The value to convert.
|
||||
/// A <see cref="Half"/>
|
||||
/// </param>
|
||||
/// <returns>The result of the conversion.
|
||||
/// A <see cref="System.Single"/>
|
||||
/// </returns>
|
||||
public static implicit operator float(Half h)
|
||||
{
|
||||
return h.ToSingle();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a OpenTK.Half to a System.Double.
|
||||
/// </summary>
|
||||
/// <param name="h">The value to convert.
|
||||
/// A <see cref="Half"/>
|
||||
/// </param>
|
||||
/// <returns>The result of the conversion.
|
||||
/// A <see cref="System.Double"/>
|
||||
/// </returns>
|
||||
public static implicit operator double(Half h)
|
||||
{
|
||||
return (double)h.ToSingle();
|
||||
}
|
||||
|
||||
#endregion Conversions
|
||||
|
||||
#region Constants
|
||||
|
||||
/// <summary>The size in bytes for an instance of the Half struct.</summary>
|
||||
public static readonly Int32 SizeInBytes = 2;
|
||||
|
||||
/// <summary>Smallest positive half</summary>
|
||||
public static readonly Single MinValue = 5.96046448e-08f;
|
||||
|
||||
/// <summary>Smallest positive normalized half</summary>
|
||||
public static readonly Single MinNormalizedValue = 6.10351562e-05f;
|
||||
|
||||
/// <summary>Largest positive half</summary>
|
||||
public static readonly Single MaxValue = 65504.0f;
|
||||
|
||||
/// <summary>Smallest positive e for which half (1.0 + e) != half (1.0)</summary>
|
||||
public static readonly Single Epsilon = 0.00097656f;
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region ISerializable
|
||||
|
||||
/// <summary>Constructor used by ISerializable to deserialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public Half(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
this.bits = (ushort)info.GetValue("bits", typeof(ushort));
|
||||
}
|
||||
|
||||
/// <summary>Used by ISerialize to serialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
info.AddValue("bits", this.bits);
|
||||
}
|
||||
|
||||
#endregion ISerializable
|
||||
|
||||
#region Binary dump
|
||||
|
||||
/// <summary>Updates the Half by reading from a Stream.</summary>
|
||||
/// <param name="bin">A BinaryReader instance associated with an open Stream.</param>
|
||||
public void FromBinaryStream(BinaryReader bin)
|
||||
{
|
||||
this.bits = bin.ReadUInt16();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Writes the Half into a Stream.</summary>
|
||||
/// <param name="bin">A BinaryWriter instance associated with an open Stream.</param>
|
||||
public void ToBinaryStream(BinaryWriter bin)
|
||||
{
|
||||
bin.Write(this.bits);
|
||||
}
|
||||
|
||||
#endregion Binary dump
|
||||
|
||||
#region IEquatable<Half> Members
|
||||
|
||||
const int maxUlps = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether this instance is equal to a specified OpenTK.Half value.
|
||||
/// </summary>
|
||||
/// <param name="other">OpenTK.Half object to compare to this instance..</param>
|
||||
/// <returns>True, if other is equal to this instance; false otherwise.</returns>
|
||||
public bool Equals(Half other)
|
||||
{
|
||||
short aInt, bInt;
|
||||
unchecked { aInt = (short)other.bits; }
|
||||
unchecked { bInt = (short)this.bits; }
|
||||
|
||||
// Make aInt lexicographically ordered as a twos-complement int
|
||||
if (aInt < 0)
|
||||
aInt = (short)(0x8000 - aInt);
|
||||
|
||||
// Make bInt lexicographically ordered as a twos-complement int
|
||||
if (bInt < 0)
|
||||
bInt = (short)(0x8000 - bInt);
|
||||
|
||||
short intDiff = System.Math.Abs((short)(aInt - bInt));
|
||||
|
||||
if (intDiff <= maxUlps)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IComparable<Half> Members
|
||||
|
||||
/// <summary>
|
||||
/// Compares this instance to a specified half-precision floating-point number
|
||||
/// and returns an integer that indicates whether the value of this instance
|
||||
/// is less than, equal to, or greater than the value of the specified half-precision
|
||||
/// floating-point number.
|
||||
/// </summary>
|
||||
/// <param name="other">A half-precision floating-point number to compare.</param>
|
||||
/// <returns>
|
||||
/// A signed number indicating the relative values of this instance and value. If the number is:
|
||||
/// <para>Less than zero, then this instance is less than other, or this instance is not a number
|
||||
/// (OpenTK.Half.NaN) and other is a number.</para>
|
||||
/// <para>Zero: this instance is equal to value, or both this instance and other
|
||||
/// are not a number (OpenTK.Half.NaN), OpenTK.Half.PositiveInfinity, or
|
||||
/// OpenTK.Half.NegativeInfinity.</para>
|
||||
/// <para>Greater than zero: this instance is greater than othrs, or this instance is a number
|
||||
/// and other is not a number (OpenTK.Half.NaN).</para>
|
||||
/// </returns>
|
||||
public int CompareTo(Half other)
|
||||
{
|
||||
return ((float)this).CompareTo((float)other);
|
||||
}
|
||||
|
||||
#endregion IComparable<Half> Members
|
||||
|
||||
#region IFormattable Members
|
||||
|
||||
/// <summary>Converts this Half into a human-legible string representation.</summary>
|
||||
/// <returns>The string representation of this instance.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return this.ToSingle().ToString();
|
||||
}
|
||||
|
||||
/// <summary>Converts this Half into a human-legible string representation.</summary>
|
||||
/// <param name="format">Formatting for the output string.</param>
|
||||
/// <param name="formatProvider">Culture-specific formatting information.</param>
|
||||
/// <returns>The string representation of this instance.</returns>
|
||||
public string ToString(string format, IFormatProvider formatProvider)
|
||||
{
|
||||
return this.ToSingle().ToString(format, formatProvider);
|
||||
}
|
||||
|
||||
#endregion IFormattable Members
|
||||
|
||||
#region String -> Half
|
||||
|
||||
/// <summary>Converts the string representation of a number to a half-precision floating-point equivalent.</summary>
|
||||
/// <param name="s">String representation of the number to convert.</param>
|
||||
/// <returns>A new Half instance.</returns>
|
||||
public static Half Parse(string s)
|
||||
{
|
||||
return (Half)Single.Parse(s);
|
||||
}
|
||||
|
||||
/// <summary>Converts the string representation of a number to a half-precision floating-point equivalent.</summary>
|
||||
/// <param name="s">String representation of the number to convert.</param>
|
||||
/// <param name="style">Specifies the format of s.</param>
|
||||
/// <param name="provider">Culture-specific formatting information.</param>
|
||||
/// <returns>A new Half instance.</returns>
|
||||
public static Half Parse(string s, System.Globalization.NumberStyles style, IFormatProvider provider)
|
||||
{
|
||||
return (Half)Single.Parse(s, style, provider);
|
||||
}
|
||||
|
||||
/// <summary>Converts the string representation of a number to a half-precision floating-point equivalent. Returns success.</summary>
|
||||
/// <param name="s">String representation of the number to convert.</param>
|
||||
/// <param name="result">The Half instance to write to.</param>
|
||||
/// <returns>Success.</returns>
|
||||
public static bool TryParse(string s, out Half result)
|
||||
{
|
||||
float f;
|
||||
bool b = Single.TryParse(s, out f);
|
||||
result = (Half)f;
|
||||
return b;
|
||||
}
|
||||
|
||||
/// <summary>Converts the string representation of a number to a half-precision floating-point equivalent. Returns success.</summary>
|
||||
/// <param name="s">String representation of the number to convert.</param>
|
||||
/// <param name="style">Specifies the format of s.</param>
|
||||
/// <param name="provider">Culture-specific formatting information.</param>
|
||||
/// <param name="result">The Half instance to write to.</param>
|
||||
/// <returns>Success.</returns>
|
||||
public static bool TryParse(string s, System.Globalization.NumberStyles style, IFormatProvider provider, out Half result)
|
||||
{
|
||||
float f;
|
||||
bool b = Single.TryParse(s, style, provider, out f);
|
||||
result = (Half)f;
|
||||
return b;
|
||||
}
|
||||
|
||||
#endregion String -> Half
|
||||
|
||||
#region BitConverter
|
||||
|
||||
/// <summary>Returns the Half as an array of bytes.</summary>
|
||||
/// <param name="h">The Half to convert.</param>
|
||||
/// <returns>The input as byte array.</returns>
|
||||
public static byte[] GetBytes(Half h)
|
||||
{
|
||||
return BitConverter.GetBytes(h.bits);
|
||||
}
|
||||
|
||||
/// <summary>Converts an array of bytes into Half.</summary>
|
||||
/// <param name="value">A Half in it's byte[] representation.</param>
|
||||
/// <param name="startIndex">The starting position within value.</param>
|
||||
/// <returns>A new Half instance.</returns>
|
||||
public static Half FromBytes(byte[] value, int startIndex)
|
||||
{
|
||||
Half h;
|
||||
h.bits = BitConverter.ToUInt16(value, startIndex);
|
||||
return h;
|
||||
}
|
||||
|
||||
#endregion BitConverter
|
||||
}
|
||||
}
|
|
@ -0,0 +1,293 @@
|
|||
#region --- License ---
|
||||
/* Licensed under the MIT/X11 license.
|
||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||
* This notice may not be removed from any source distribution.
|
||||
* See license.txt for licensing detailed licensing details.
|
||||
*
|
||||
* Contributions by Andy Gill, James Talton and Georg Wächter.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains common mathematical functions and constants.
|
||||
/// </summary>
|
||||
public static class MathHelper
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of Pi as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float Pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382f;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of Pi divided by two as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float PiOver2 = Pi / 2;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of Pi divided by three as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float PiOver3 = Pi / 3;
|
||||
|
||||
/// <summary>
|
||||
/// Definesthe value of Pi divided by four as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float PiOver4 = Pi / 4;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of Pi divided by six as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float PiOver6 = Pi / 6;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of Pi multiplied by two as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float TwoPi = 2 * Pi;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of Pi multiplied by 3 and divided by two as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float ThreePiOver2 = 3 * Pi / 2;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the value of E as a <see cref="System.Single"/>.
|
||||
/// </summary>
|
||||
public const float E = 2.71828182845904523536f;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the base-10 logarithm of E.
|
||||
/// </summary>
|
||||
public const float Log10E = 0.434294482f;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the base-2 logarithm of E.
|
||||
/// </summary>
|
||||
public const float Log2E = 1.442695041f;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
#region NextPowerOfTwo
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static long NextPowerOfTwo(long n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (long)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static int NextPowerOfTwo(int n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (int)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static float NextPowerOfTwo(float n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (float)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the next power of two that is larger than the specified number.
|
||||
/// </summary>
|
||||
/// <param name="n">The specified number.</param>
|
||||
/// <returns>The next power of two.</returns>
|
||||
public static double NextPowerOfTwo(double n)
|
||||
{
|
||||
if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Factorial
|
||||
|
||||
/// <summary>Calculates the factorial of a given natural number.
|
||||
/// </summary>
|
||||
/// <param name="n">The number.</param>
|
||||
/// <returns>n!</returns>
|
||||
public static long Factorial(int n)
|
||||
{
|
||||
long result = 1;
|
||||
|
||||
for (; n > 1; n--)
|
||||
result *= n;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region BinomialCoefficient
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the binomial coefficient <paramref name="n"/> above <paramref name="k"/>.
|
||||
/// </summary>
|
||||
/// <param name="n">The n.</param>
|
||||
/// <param name="k">The k.</param>
|
||||
/// <returns>n! / (k! * (n - k)!)</returns>
|
||||
public static long BinomialCoefficient(int n, int k)
|
||||
{
|
||||
return Factorial(n) / (Factorial(k) * Factorial(n - k));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region InverseSqrtFast
|
||||
|
||||
/// <summary>
|
||||
/// Returns an approximation of the inverse square root of left number.
|
||||
/// </summary>
|
||||
/// <param name="x">A number.</param>
|
||||
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
|
||||
/// <remarks>
|
||||
/// This is an improved implementation of the the method known as Carmack's inverse square root
|
||||
/// which is found in the Quake III source code. This implementation comes from
|
||||
/// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see
|
||||
/// http://www.beyond3d.com/content/articles/8/
|
||||
/// </remarks>
|
||||
public static float InverseSqrtFast(float x)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
float xhalf = 0.5f * x;
|
||||
int i = *(int*)&x; // Read bits as integer.
|
||||
i = 0x5f375a86 - (i >> 1); // Make an initial guess for Newton-Raphson approximation
|
||||
x = *(float*)&i; // Convert bits back to float
|
||||
x = x * (1.5f - xhalf * x * x); // Perform left single Newton-Raphson step.
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an approximation of the inverse square root of left number.
|
||||
/// </summary>
|
||||
/// <param name="x">A number.</param>
|
||||
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
|
||||
/// <remarks>
|
||||
/// This is an improved implementation of the the method known as Carmack's inverse square root
|
||||
/// which is found in the Quake III source code. This implementation comes from
|
||||
/// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see
|
||||
/// http://www.beyond3d.com/content/articles/8/
|
||||
/// </remarks>
|
||||
public static double InverseSqrtFast(double x)
|
||||
{
|
||||
return InverseSqrtFast((float)x);
|
||||
// TODO: The following code is wrong. Fix it, to improve precision.
|
||||
#if false
|
||||
unsafe
|
||||
{
|
||||
double xhalf = 0.5f * x;
|
||||
int i = *(int*)&x; // Read bits as integer.
|
||||
i = 0x5f375a86 - (i >> 1); // Make an initial guess for Newton-Raphson approximation
|
||||
x = *(float*)&i; // Convert bits back to float
|
||||
x = x * (1.5f - xhalf * x * x); // Perform left single Newton-Raphson step.
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DegreesToRadians
|
||||
|
||||
/// <summary>
|
||||
/// Convert degrees to radians
|
||||
/// </summary>
|
||||
/// <param name="degrees">An angle in degrees</param>
|
||||
/// <returns>The angle expressed in radians</returns>
|
||||
public static float DegreesToRadians(float degrees)
|
||||
{
|
||||
const float degToRad = (float)System.Math.PI / 180.0f;
|
||||
return degrees * degToRad;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert radians to degrees
|
||||
/// </summary>
|
||||
/// <param name="radians">An angle in radians</param>
|
||||
/// <returns>The angle expressed in degrees</returns>
|
||||
public static float RadiansToDegrees(float radians)
|
||||
{
|
||||
const float radToDeg = 180.0f / (float)System.Math.PI;
|
||||
return radians * radToDeg;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert degrees to radians
|
||||
/// </summary>
|
||||
/// <param name="degrees">An angle in degrees</param>
|
||||
/// <returns>The angle expressed in radians</returns>
|
||||
public static double DegreesToRadians(double degrees)
|
||||
{
|
||||
const double degToRad = System.Math.PI / 180.0;
|
||||
return degrees * degToRad;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert radians to degrees
|
||||
/// </summary>
|
||||
/// <param name="radians">An angle in radians</param>
|
||||
/// <returns>The angle expressed in degrees</returns>
|
||||
public static double RadiansToDegrees(double radians)
|
||||
{
|
||||
const double radToDeg = 180.0 / System.Math.PI;
|
||||
return radians * radToDeg;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Swap
|
||||
|
||||
/// <summary>
|
||||
/// Swaps two double values.
|
||||
/// </summary>
|
||||
/// <param name="a">The first value.</param>
|
||||
/// <param name="b">The second value.</param>
|
||||
public static void Swap(ref double a, ref double b)
|
||||
{
|
||||
double temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Swaps two float values.
|
||||
/// </summary>
|
||||
/// <param name="a">The first value.</param>
|
||||
/// <param name="b">The second value.</param>
|
||||
public static void Swap(ref float a, ref float b)
|
||||
{
|
||||
float temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,828 @@
|
|||
#region --- License ---
|
||||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
// Todo: Remove this warning when the code goes public.
|
||||
#pragma warning disable 3019
|
||||
#if false
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Matrix3d : IEquatable<Matrix3d>
|
||||
{
|
||||
#region Fields & Access
|
||||
|
||||
/// <summary>Row 0, Column 0</summary>
|
||||
public double R0C0;
|
||||
|
||||
/// <summary>Row 0, Column 1</summary>
|
||||
public double R0C1;
|
||||
|
||||
/// <summary>Row 0, Column 2</summary>
|
||||
public double R0C2;
|
||||
|
||||
/// <summary>Row 1, Column 0</summary>
|
||||
public double R1C0;
|
||||
|
||||
/// <summary>Row 1, Column 1</summary>
|
||||
public double R1C1;
|
||||
|
||||
/// <summary>Row 1, Column 2</summary>
|
||||
public double R1C2;
|
||||
|
||||
/// <summary>Row 2, Column 0</summary>
|
||||
public double R2C0;
|
||||
|
||||
/// <summary>Row 2, Column 1</summary>
|
||||
public double R2C1;
|
||||
|
||||
/// <summary>Row 2, Column 2</summary>
|
||||
public double R2C2;
|
||||
|
||||
/// <summary>Gets the component at the given row and column in the matrix.</summary>
|
||||
/// <param name="row">The row of the matrix.</param>
|
||||
/// <param name="column">The column of the matrix.</param>
|
||||
/// <returns>The component at the given row and column in the matrix.</returns>
|
||||
public double this[int row, int column]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch( row )
|
||||
{
|
||||
case 0:
|
||||
switch (column)
|
||||
{
|
||||
case 0: return R0C0;
|
||||
case 1: return R0C1;
|
||||
case 2: return R0C2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
switch (column)
|
||||
{
|
||||
case 0: return R1C0;
|
||||
case 1: return R1C1;
|
||||
case 2: return R1C2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (column)
|
||||
{
|
||||
case 0: return R2C0;
|
||||
case 1: return R2C1;
|
||||
case 2: return R2C2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
set
|
||||
{
|
||||
switch( row )
|
||||
{
|
||||
case 0:
|
||||
switch (column)
|
||||
{
|
||||
case 0: R0C0 = value; return;
|
||||
case 1: R0C1 = value; return;
|
||||
case 2: R0C2 = value; return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
switch (column)
|
||||
{
|
||||
case 0: R1C0 = value; return;
|
||||
case 1: R1C1 = value; return;
|
||||
case 2: R1C2 = value; return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (column)
|
||||
{
|
||||
case 0: R2C0 = value; return;
|
||||
case 1: R2C1 = value; return;
|
||||
case 2: R2C2 = value; return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the component at the index into the matrix.</summary>
|
||||
/// <param name="index">The index into the components of the matrix.</param>
|
||||
/// <returns>The component at the given index into the matrix.</returns>
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0: return R0C0;
|
||||
case 1: return R0C1;
|
||||
case 2: return R0C2;
|
||||
case 3: return R1C0;
|
||||
case 4: return R1C1;
|
||||
case 5: return R1C2;
|
||||
case 6: return R2C0;
|
||||
case 7: return R2C1;
|
||||
case 8: return R2C2;
|
||||
default: throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0: R0C0 = value; return;
|
||||
case 1: R0C1 = value; return;
|
||||
case 2: R0C2 = value; return;
|
||||
case 3: R1C0 = value; return;
|
||||
case 4: R1C1 = value; return;
|
||||
case 5: R1C2 = value; return;
|
||||
case 6: R2C0 = value; return;
|
||||
case 7: R2C1 = value; return;
|
||||
case 8: R2C2 = value; return;
|
||||
default: throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Converts the matrix into an IntPtr.</summary>
|
||||
/// <param name="matrix">The matrix to convert.</param>
|
||||
/// <returns>An IntPtr for the matrix.</returns>
|
||||
public static explicit operator IntPtr(Matrix3d matrix)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
return (IntPtr)(&matrix.R0C0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Converts the matrix into left double*.</summary>
|
||||
/// <param name="matrix">The matrix to convert.</param>
|
||||
/// <returns>A double* for the matrix.</returns>
|
||||
[CLSCompliant(false)]
|
||||
unsafe public static explicit operator double*(Matrix3d matrix)
|
||||
{
|
||||
return &matrix.R0C0;
|
||||
}
|
||||
|
||||
/// <summary>Converts the matrix into an array of doubles.</summary>
|
||||
/// <param name="matrix">The matrix to convert.</param>
|
||||
/// <returns>An array of doubles for the matrix.</returns>
|
||||
public static explicit operator double[](Matrix3d matrix)
|
||||
{
|
||||
return new double[9]
|
||||
{
|
||||
matrix.R0C0,
|
||||
matrix.R0C1,
|
||||
matrix.R0C2,
|
||||
matrix.R1C0,
|
||||
matrix.R1C1,
|
||||
matrix.R1C2,
|
||||
matrix.R2C0,
|
||||
matrix.R2C1,
|
||||
matrix.R2C2
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>Constructs left matrix with the same components as the given matrix.</summary>
|
||||
/// <param name="vector">The matrix whose components to copy.</param>
|
||||
public Matrix3d(ref Matrix3d matrix)
|
||||
{
|
||||
this.R0C0 = matrix.R0C0;
|
||||
this.R0C1 = matrix.R0C1;
|
||||
this.R0C2 = matrix.R0C2;
|
||||
this.R1C0 = matrix.R1C0;
|
||||
this.R1C1 = matrix.R1C1;
|
||||
this.R1C2 = matrix.R1C2;
|
||||
this.R2C0 = matrix.R2C0;
|
||||
this.R2C1 = matrix.R2C1;
|
||||
this.R2C2 = matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Constructs left matrix with the given values.</summary>
|
||||
/// <param name="r0c0">The value for row 0 column 0.</param>
|
||||
/// <param name="r0c1">The value for row 0 column 1.</param>
|
||||
/// <param name="r0c2">The value for row 0 column 2.</param>
|
||||
/// <param name="r1c0">The value for row 1 column 0.</param>
|
||||
/// <param name="r1c1">The value for row 1 column 1.</param>
|
||||
/// <param name="r1c2">The value for row 1 column 2.</param>
|
||||
/// <param name="r2c0">The value for row 2 column 0.</param>
|
||||
/// <param name="r2c1">The value for row 2 column 1.</param>
|
||||
/// <param name="r2c2">The value for row 2 column 2.</param>
|
||||
public Matrix3d
|
||||
(
|
||||
double r0c0,
|
||||
double r0c1,
|
||||
double r0c2,
|
||||
double r1c0,
|
||||
double r1c1,
|
||||
double r1c2,
|
||||
double r2c0,
|
||||
double r2c1,
|
||||
double r2c2
|
||||
)
|
||||
{
|
||||
this.R0C0 = r0c0;
|
||||
this.R0C1 = r0c1;
|
||||
this.R0C2 = r0c2;
|
||||
this.R1C0 = r1c0;
|
||||
this.R1C1 = r1c1;
|
||||
this.R1C2 = r1c2;
|
||||
this.R2C0 = r2c0;
|
||||
this.R2C1 = r2c1;
|
||||
this.R2C2 = r2c2;
|
||||
}
|
||||
|
||||
/// <summary>Constructs left matrix from the given array of double-precision floating-point numbers.</summary>
|
||||
/// <param name="doubleArray">The array of doubles for the components of the matrix.</param>
|
||||
public Matrix3d(double[] doubleArray)
|
||||
{
|
||||
if (doubleArray == null || doubleArray.GetLength(0) < 9) throw new MissingFieldException();
|
||||
|
||||
this.R0C0 = doubleArray[0];
|
||||
this.R0C1 = doubleArray[1];
|
||||
this.R0C2 = doubleArray[2];
|
||||
this.R1C0 = doubleArray[3];
|
||||
this.R1C1 = doubleArray[4];
|
||||
this.R1C2 = doubleArray[5];
|
||||
this.R2C0 = doubleArray[6];
|
||||
this.R2C1 = doubleArray[7];
|
||||
this.R2C2 = doubleArray[8];
|
||||
}
|
||||
|
||||
/// <summary>Constructs left matrix from the given quaternion.</summary>
|
||||
/// <param name="quaternion">The quaternion to use to construct the martix.</param>
|
||||
public Matrix3d(Quaterniond quaternion)
|
||||
{
|
||||
quaternion.Normalize();
|
||||
|
||||
double xx = quaternion.X * quaternion.X;
|
||||
double yy = quaternion.Y * quaternion.Y;
|
||||
double zz = quaternion.Z * quaternion.Z;
|
||||
double xy = quaternion.X * quaternion.Y;
|
||||
double xz = quaternion.X * quaternion.Z;
|
||||
double yz = quaternion.Y * quaternion.Z;
|
||||
double wx = quaternion.W * quaternion.X;
|
||||
double wy = quaternion.W * quaternion.Y;
|
||||
double wz = quaternion.W * quaternion.Z;
|
||||
|
||||
R0C0 = 1 - 2 * (yy + zz);
|
||||
R0C1 = 2 * (xy - wz);
|
||||
R0C2 = 2 * (xz + wy);
|
||||
|
||||
R1C0 = 2 * (xy + wz);
|
||||
R1C1 = 1 - 2 * (xx + zz);
|
||||
R1C2 = 2 * (yz - wx);
|
||||
|
||||
R2C0 = 2 * (xz - wy);
|
||||
R2C1 = 2 * (yz + wx);
|
||||
R2C2 = 1 - 2 * (xx + yy);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Equality
|
||||
|
||||
/// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
|
||||
/// <param name="matrix">The OpenTK.Matrix3d structure to compare with.</param>
|
||||
/// <returns>true if the current matrix is equal to the matrix parameter; otherwise, false.</returns>
|
||||
[CLSCompliant(false)]
|
||||
public bool Equals(Matrix3d matrix)
|
||||
{
|
||||
return
|
||||
R0C0 == matrix.R0C0 &&
|
||||
R0C1 == matrix.R0C1 &&
|
||||
R0C2 == matrix.R0C2 &&
|
||||
R1C0 == matrix.R1C0 &&
|
||||
R1C1 == matrix.R1C1 &&
|
||||
R1C2 == matrix.R1C2 &&
|
||||
R2C0 == matrix.R2C0 &&
|
||||
R2C1 == matrix.R2C1 &&
|
||||
R2C2 == matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
|
||||
/// <param name="matrix">The OpenTK.Matrix3d structure to compare to.</param>
|
||||
/// <returns>true if the current matrix is equal to the matrix parameter; otherwise, false.</returns>
|
||||
public bool Equals(ref Matrix3d matrix)
|
||||
{
|
||||
return
|
||||
R0C0 == matrix.R0C0 &&
|
||||
R0C1 == matrix.R0C1 &&
|
||||
R0C2 == matrix.R0C2 &&
|
||||
R1C0 == matrix.R1C0 &&
|
||||
R1C1 == matrix.R1C1 &&
|
||||
R1C2 == matrix.R1C2 &&
|
||||
R2C0 == matrix.R2C0 &&
|
||||
R2C1 == matrix.R2C1 &&
|
||||
R2C2 == matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
|
||||
/// <param name="left">The left-hand operand.</param>
|
||||
/// <param name="right">The right-hand operand.</param>
|
||||
/// <returns>true if the current matrix is equal to the matrix parameter; otherwise, false.</returns>
|
||||
public static bool Equals(ref Matrix3d left, ref Matrix3d right)
|
||||
{
|
||||
return
|
||||
left.R0C0 == right.R0C0 &&
|
||||
left.R0C1 == right.R0C1 &&
|
||||
left.R0C2 == right.R0C2 &&
|
||||
left.R1C0 == right.R1C0 &&
|
||||
left.R1C1 == right.R1C1 &&
|
||||
left.R1C2 == right.R1C2 &&
|
||||
left.R2C0 == right.R2C0 &&
|
||||
left.R2C1 == right.R2C1 &&
|
||||
left.R2C2 == right.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the current matrix is approximately equal to another matrix.</summary>
|
||||
/// <param name="matrix">The OpenTK.Matrix3d structure to compare with.</param>
|
||||
/// <param name="tolerance">The limit below which the matrices are considered equal.</param>
|
||||
/// <returns>true if the current matrix is approximately equal to the matrix parameter; otherwise, false.</returns>
|
||||
public bool EqualsApprox(ref Matrix3d matrix, double tolerance)
|
||||
{
|
||||
return
|
||||
System.Math.Abs(R0C0 - matrix.R0C0) <= tolerance &&
|
||||
System.Math.Abs(R0C1 - matrix.R0C1) <= tolerance &&
|
||||
System.Math.Abs(R0C2 - matrix.R0C2) <= tolerance &&
|
||||
System.Math.Abs(R1C0 - matrix.R1C0) <= tolerance &&
|
||||
System.Math.Abs(R1C1 - matrix.R1C1) <= tolerance &&
|
||||
System.Math.Abs(R1C2 - matrix.R1C2) <= tolerance &&
|
||||
System.Math.Abs(R2C0 - matrix.R2C0) <= tolerance &&
|
||||
System.Math.Abs(R2C1 - matrix.R2C1) <= tolerance &&
|
||||
System.Math.Abs(R2C2 - matrix.R2C2) <= tolerance;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the current matrix is approximately equal to another matrix.</summary>
|
||||
/// <param name="left">The left-hand operand.</param>
|
||||
/// <param name="right">The right-hand operand.</param>
|
||||
/// <param name="tolerance">The limit below which the matrices are considered equal.</param>
|
||||
/// <returns>true if the current matrix is approximately equal to the matrix parameter; otherwise, false.</returns>
|
||||
public static bool EqualsApprox(ref Matrix3d left, ref Matrix3d right, double tolerance)
|
||||
{
|
||||
return
|
||||
System.Math.Abs(left.R0C0 - right.R0C0) <= tolerance &&
|
||||
System.Math.Abs(left.R0C1 - right.R0C1) <= tolerance &&
|
||||
System.Math.Abs(left.R0C2 - right.R0C2) <= tolerance &&
|
||||
System.Math.Abs(left.R1C0 - right.R1C0) <= tolerance &&
|
||||
System.Math.Abs(left.R1C1 - right.R1C1) <= tolerance &&
|
||||
System.Math.Abs(left.R1C2 - right.R1C2) <= tolerance &&
|
||||
System.Math.Abs(left.R2C0 - right.R2C0) <= tolerance &&
|
||||
System.Math.Abs(left.R2C1 - right.R2C1) <= tolerance &&
|
||||
System.Math.Abs(left.R2C2 - right.R2C2) <= tolerance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Arithmetic Operators
|
||||
|
||||
|
||||
/// <summary>Add left matrix to this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to add.</param>
|
||||
public void Add(ref Matrix3d matrix)
|
||||
{
|
||||
R0C0 = R0C0 + matrix.R0C0;
|
||||
R0C1 = R0C1 + matrix.R0C1;
|
||||
R0C2 = R0C2 + matrix.R0C2;
|
||||
R1C0 = R1C0 + matrix.R1C0;
|
||||
R1C1 = R1C1 + matrix.R1C1;
|
||||
R1C2 = R1C2 + matrix.R1C2;
|
||||
R2C0 = R2C0 + matrix.R2C0;
|
||||
R2C1 = R2C1 + matrix.R2C1;
|
||||
R2C2 = R2C2 + matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Add left matrix to this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to add.</param>
|
||||
/// <param name="result">The resulting matrix of the addition.</param>
|
||||
public void Add(ref Matrix3d matrix, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = R0C0 + matrix.R0C0;
|
||||
result.R0C1 = R0C1 + matrix.R0C1;
|
||||
result.R0C2 = R0C2 + matrix.R0C2;
|
||||
result.R1C0 = R1C0 + matrix.R1C0;
|
||||
result.R1C1 = R1C1 + matrix.R1C1;
|
||||
result.R1C2 = R1C2 + matrix.R1C2;
|
||||
result.R2C0 = R2C0 + matrix.R2C0;
|
||||
result.R2C1 = R2C1 + matrix.R2C1;
|
||||
result.R2C2 = R2C2 + matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Add left matrix to left matrix.</summary>
|
||||
/// <param name="matrix">The matrix on the matrix side of the equation.</param>
|
||||
/// <param name="right">The matrix on the right side of the equation</param>
|
||||
/// <param name="result">The resulting matrix of the addition.</param>
|
||||
public static void Add(ref Matrix3d left, ref Matrix3d right, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = left.R0C0 + right.R0C0;
|
||||
result.R0C1 = left.R0C1 + right.R0C1;
|
||||
result.R0C2 = left.R0C2 + right.R0C2;
|
||||
result.R1C0 = left.R1C0 + right.R1C0;
|
||||
result.R1C1 = left.R1C1 + right.R1C1;
|
||||
result.R1C2 = left.R1C2 + right.R1C2;
|
||||
result.R2C0 = left.R2C0 + right.R2C0;
|
||||
result.R2C1 = left.R2C1 + right.R2C1;
|
||||
result.R2C2 = left.R2C2 + right.R2C2;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Subtract left matrix from this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to subtract.</param>
|
||||
public void Subtract(ref Matrix3d matrix)
|
||||
{
|
||||
R0C0 = R0C0 + matrix.R0C0;
|
||||
R0C1 = R0C1 + matrix.R0C1;
|
||||
R0C2 = R0C2 + matrix.R0C2;
|
||||
R1C0 = R1C0 + matrix.R1C0;
|
||||
R1C1 = R1C1 + matrix.R1C1;
|
||||
R1C2 = R1C2 + matrix.R1C2;
|
||||
R2C0 = R2C0 + matrix.R2C0;
|
||||
R2C1 = R2C1 + matrix.R2C1;
|
||||
R2C2 = R2C2 + matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Subtract left matrix from this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to subtract.</param>
|
||||
/// <param name="result">The resulting matrix of the subtraction.</param>
|
||||
public void Subtract(ref Matrix3d matrix, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = R0C0 + matrix.R0C0;
|
||||
result.R0C1 = R0C1 + matrix.R0C1;
|
||||
result.R0C2 = R0C2 + matrix.R0C2;
|
||||
result.R1C0 = R1C0 + matrix.R1C0;
|
||||
result.R1C1 = R1C1 + matrix.R1C1;
|
||||
result.R1C2 = R1C2 + matrix.R1C2;
|
||||
result.R2C0 = R2C0 + matrix.R2C0;
|
||||
result.R2C1 = R2C1 + matrix.R2C1;
|
||||
result.R2C2 = R2C2 + matrix.R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Subtract left matrix from left matrix.</summary>
|
||||
/// <param name="matrix">The matrix on the matrix side of the equation.</param>
|
||||
/// <param name="right">The matrix on the right side of the equation</param>
|
||||
/// <param name="result">The resulting matrix of the subtraction.</param>
|
||||
public static void Subtract(ref Matrix3d left, ref Matrix3d right, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = left.R0C0 + right.R0C0;
|
||||
result.R0C1 = left.R0C1 + right.R0C1;
|
||||
result.R0C2 = left.R0C2 + right.R0C2;
|
||||
result.R1C0 = left.R1C0 + right.R1C0;
|
||||
result.R1C1 = left.R1C1 + right.R1C1;
|
||||
result.R1C2 = left.R1C2 + right.R1C2;
|
||||
result.R2C0 = left.R2C0 + right.R2C0;
|
||||
result.R2C1 = left.R2C1 + right.R2C1;
|
||||
result.R2C2 = left.R2C2 + right.R2C2;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Multiply left martix times this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to multiply.</param>
|
||||
public void Multiply(ref Matrix3d matrix)
|
||||
{
|
||||
double r0c0 = matrix.R0C0 * R0C0 + matrix.R0C1 * R1C0 + matrix.R0C2 * R2C0;
|
||||
double r0c1 = matrix.R0C0 * R0C1 + matrix.R0C1 * R1C1 + matrix.R0C2 * R2C1;
|
||||
double r0c2 = matrix.R0C0 * R0C2 + matrix.R0C1 * R1C2 + matrix.R0C2 * R2C2;
|
||||
|
||||
double r1c0 = matrix.R1C0 * R0C0 + matrix.R1C1 * R1C0 + matrix.R1C2 * R2C0;
|
||||
double r1c1 = matrix.R1C0 * R0C1 + matrix.R1C1 * R1C1 + matrix.R1C2 * R2C1;
|
||||
double r1c2 = matrix.R1C0 * R0C2 + matrix.R1C1 * R1C2 + matrix.R1C2 * R2C2;
|
||||
|
||||
R2C0 = matrix.R2C0 * R0C0 + matrix.R2C1 * R1C0 + matrix.R2C2 * R2C0;
|
||||
R2C1 = matrix.R2C0 * R0C1 + matrix.R2C1 * R1C1 + matrix.R2C2 * R2C1;
|
||||
R2C2 = matrix.R2C0 * R0C2 + matrix.R2C1 * R1C2 + matrix.R2C2 * R2C2;
|
||||
|
||||
|
||||
R0C0 = r0c0;
|
||||
R0C1 = r0c1;
|
||||
R0C2 = r0c2;
|
||||
|
||||
R1C0 = r1c0;
|
||||
R1C1 = r1c1;
|
||||
R1C2 = r1c2;
|
||||
}
|
||||
|
||||
/// <summary>Multiply matrix times this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to multiply.</param>
|
||||
/// <param name="result">The resulting matrix of the multiplication.</param>
|
||||
public void Multiply(ref Matrix3d matrix, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = matrix.R0C0 * R0C0 + matrix.R0C1 * R1C0 + matrix.R0C2 * R2C0;
|
||||
result.R0C1 = matrix.R0C0 * R0C1 + matrix.R0C1 * R1C1 + matrix.R0C2 * R2C1;
|
||||
result.R0C2 = matrix.R0C0 * R0C2 + matrix.R0C1 * R1C2 + matrix.R0C2 * R2C2;
|
||||
result.R1C0 = matrix.R1C0 * R0C0 + matrix.R1C1 * R1C0 + matrix.R1C2 * R2C0;
|
||||
result.R1C1 = matrix.R1C0 * R0C1 + matrix.R1C1 * R1C1 + matrix.R1C2 * R2C1;
|
||||
result.R1C2 = matrix.R1C0 * R0C2 + matrix.R1C1 * R1C2 + matrix.R1C2 * R2C2;
|
||||
result.R2C0 = matrix.R2C0 * R0C0 + matrix.R2C1 * R1C0 + matrix.R2C2 * R2C0;
|
||||
result.R2C1 = matrix.R2C0 * R0C1 + matrix.R2C1 * R1C1 + matrix.R2C2 * R2C1;
|
||||
result.R2C2 = matrix.R2C0 * R0C2 + matrix.R2C1 * R1C2 + matrix.R2C2 * R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Multiply left matrix times left matrix.</summary>
|
||||
/// <param name="matrix">The matrix on the matrix side of the equation.</param>
|
||||
/// <param name="right">The matrix on the right side of the equation</param>
|
||||
/// <param name="result">The resulting matrix of the multiplication.</param>
|
||||
public static void Multiply(ref Matrix3d left, ref Matrix3d right, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = right.R0C0 * left.R0C0 + right.R0C1 * left.R1C0 + right.R0C2 * left.R2C0;
|
||||
result.R0C1 = right.R0C0 * left.R0C1 + right.R0C1 * left.R1C1 + right.R0C2 * left.R2C1;
|
||||
result.R0C2 = right.R0C0 * left.R0C2 + right.R0C1 * left.R1C2 + right.R0C2 * left.R2C2;
|
||||
result.R1C0 = right.R1C0 * left.R0C0 + right.R1C1 * left.R1C0 + right.R1C2 * left.R2C0;
|
||||
result.R1C1 = right.R1C0 * left.R0C1 + right.R1C1 * left.R1C1 + right.R1C2 * left.R2C1;
|
||||
result.R1C2 = right.R1C0 * left.R0C2 + right.R1C1 * left.R1C2 + right.R1C2 * left.R2C2;
|
||||
result.R2C0 = right.R2C0 * left.R0C0 + right.R2C1 * left.R1C0 + right.R2C2 * left.R2C0;
|
||||
result.R2C1 = right.R2C0 * left.R0C1 + right.R2C1 * left.R1C1 + right.R2C2 * left.R2C1;
|
||||
result.R2C2 = right.R2C0 * left.R0C2 + right.R2C1 * left.R1C2 + right.R2C2 * left.R2C2;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Multiply matrix times this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to multiply.</param>
|
||||
public void Multiply(double scalar)
|
||||
{
|
||||
R0C0 = scalar * R0C0;
|
||||
R0C1 = scalar * R0C1;
|
||||
R0C2 = scalar * R0C2;
|
||||
R1C0 = scalar * R1C0;
|
||||
R1C1 = scalar * R1C1;
|
||||
R1C2 = scalar * R1C2;
|
||||
R2C0 = scalar * R2C0;
|
||||
R2C1 = scalar * R2C1;
|
||||
R2C2 = scalar * R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Multiply matrix times this matrix.</summary>
|
||||
/// <param name="matrix">The matrix to multiply.</param>
|
||||
/// <param name="result">The resulting matrix of the multiplication.</param>
|
||||
public void Multiply(double scalar, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = scalar * R0C0;
|
||||
result.R0C1 = scalar * R0C1;
|
||||
result.R0C2 = scalar * R0C2;
|
||||
result.R1C0 = scalar * R1C0;
|
||||
result.R1C1 = scalar * R1C1;
|
||||
result.R1C2 = scalar * R1C2;
|
||||
result.R2C0 = scalar * R2C0;
|
||||
result.R2C1 = scalar * R2C1;
|
||||
result.R2C2 = scalar * R2C2;
|
||||
}
|
||||
|
||||
/// <summary>Multiply left matrix times left matrix.</summary>
|
||||
/// <param name="matrix">The matrix on the matrix side of the equation.</param>
|
||||
/// <param name="right">The matrix on the right side of the equation</param>
|
||||
/// <param name="result">The resulting matrix of the multiplication.</param>
|
||||
public static void Multiply(ref Matrix3d matrix, double scalar, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = scalar * matrix.R0C0;
|
||||
result.R0C1 = scalar * matrix.R0C1;
|
||||
result.R0C2 = scalar * matrix.R0C2;
|
||||
result.R1C0 = scalar * matrix.R1C0;
|
||||
result.R1C1 = scalar * matrix.R1C1;
|
||||
result.R1C2 = scalar * matrix.R1C2;
|
||||
result.R2C0 = scalar * matrix.R2C0;
|
||||
result.R2C1 = scalar * matrix.R2C1;
|
||||
result.R2C2 = scalar * matrix.R2C2;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
public double Determinant
|
||||
{
|
||||
get
|
||||
{
|
||||
return R0C0 * R1C1 * R2C2 - R0C0 * R1C2 * R2C1 - R0C1 * R1C0 * R2C2 + R0C2 * R1C0 * R2C1 + R0C1 * R1C2 * R2C0 - R0C2 * R1C1 * R2C0;
|
||||
}
|
||||
}
|
||||
|
||||
public void Transpose()
|
||||
{
|
||||
Functions.Swap(ref R0C1, ref R1C0);
|
||||
Functions.Swap(ref R0C2, ref R2C0);
|
||||
Functions.Swap(ref R1C2, ref R2C1);
|
||||
}
|
||||
public void Transpose(out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = R0C0;
|
||||
result.R0C1 = R1C0;
|
||||
result.R0C2 = R2C0;
|
||||
result.R1C0 = R0C1;
|
||||
result.R1C1 = R1C1;
|
||||
result.R1C2 = R2C1;
|
||||
result.R2C0 = R0C2;
|
||||
result.R2C1 = R1C2;
|
||||
result.R2C2 = R2C2;
|
||||
}
|
||||
public static void Transpose(ref Matrix3d matrix, out Matrix3d result)
|
||||
{
|
||||
result.R0C0 = matrix.R0C0;
|
||||
result.R0C1 = matrix.R1C0;
|
||||
result.R0C2 = matrix.R2C0;
|
||||
result.R1C0 = matrix.R0C1;
|
||||
result.R1C1 = matrix.R1C1;
|
||||
result.R1C2 = matrix.R2C1;
|
||||
result.R2C0 = matrix.R0C2;
|
||||
result.R2C1 = matrix.R1C2;
|
||||
result.R2C2 = matrix.R2C2;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Transformation Functions
|
||||
|
||||
public void Transform(ref Vector3d vector)
|
||||
{
|
||||
double x = R0C0 * vector.X + R0C1 * vector.Y + R0C2 * vector.Z;
|
||||
double y = R1C0 * vector.X + R1C1 * vector.Y + R1C2 * vector.Z;
|
||||
vector.Z = R2C0 * vector.X + R2C1 * vector.Y + R2C2 * vector.Z;
|
||||
vector.X = x;
|
||||
vector.Y = y;
|
||||
}
|
||||
public static void Transform(ref Matrix3d matrix, ref Vector3d vector)
|
||||
{
|
||||
double x = matrix.R0C0 * vector.X + matrix.R0C1 * vector.Y + matrix.R0C2 * vector.Z;
|
||||
double y = matrix.R1C0 * vector.X + matrix.R1C1 * vector.Y + matrix.R1C2 * vector.Z;
|
||||
vector.Z = matrix.R2C0 * vector.X + matrix.R2C1 * vector.Y + matrix.R2C2 * vector.Z;
|
||||
vector.X = x;
|
||||
vector.Y = y;
|
||||
}
|
||||
public void Transform(ref Vector3d vector, out Vector3d result)
|
||||
{
|
||||
result.X = R0C0 * vector.X + R0C1 * vector.Y + R0C2 * vector.Z;
|
||||
result.Y = R1C0 * vector.X + R1C1 * vector.Y + R1C2 * vector.Z;
|
||||
result.Z = R2C0 * vector.X + R2C1 * vector.Y + R2C2 * vector.Z;
|
||||
}
|
||||
public static void Transform(ref Matrix3d matrix, ref Vector3d vector, out Vector3d result)
|
||||
{
|
||||
result.X = matrix.R0C0 * vector.X + matrix.R0C1 * vector.Y + matrix.R0C2 * vector.Z;
|
||||
result.Y = matrix.R1C0 * vector.X + matrix.R1C1 * vector.Y + matrix.R1C2 * vector.Z;
|
||||
result.Z = matrix.R2C0 * vector.X + matrix.R2C1 * vector.Y + matrix.R2C2 * vector.Z;
|
||||
}
|
||||
|
||||
public void Rotate(double angle)
|
||||
{
|
||||
double angleRadians = Functions.DTOR * angle;
|
||||
double sin = (double)System.Math.Sin(angleRadians);
|
||||
double cos = (double)System.Math.Cos(angleRadians);
|
||||
|
||||
double r0c0 = cos * R0C0 + sin * R1C0;
|
||||
double r0c1 = cos * R0C1 + sin * R1C1;
|
||||
double r0c2 = cos * R0C2 + sin * R1C2;
|
||||
|
||||
R1C0 = cos * R1C0 - sin * R0C0;
|
||||
R1C1 = cos * R1C1 - sin * R0C1;
|
||||
R1C2 = cos * R1C2 - sin * R0C2;
|
||||
|
||||
R0C0 = r0c0;
|
||||
R0C1 = r0c1;
|
||||
R0C2 = r0c2;
|
||||
}
|
||||
public void Rotate(double angle, out Matrix3d result)
|
||||
{
|
||||
double angleRadians = Functions.DTOR * angle;
|
||||
double sin = (double)System.Math.Sin(angleRadians);
|
||||
double cos = (double)System.Math.Cos(angleRadians);
|
||||
|
||||
result.R0C0 = cos * R0C0 + sin * R1C0;
|
||||
result.R0C1 = cos * R0C1 + sin * R1C1;
|
||||
result.R0C2 = cos * R0C2 + sin * R1C2;
|
||||
result.R1C0 = cos * R1C0 - sin * R0C0;
|
||||
result.R1C1 = cos * R1C1 - sin * R0C1;
|
||||
result.R1C2 = cos * R1C2 - sin * R0C2;
|
||||
result.R2C0 = R2C0;
|
||||
result.R2C1 = R2C1;
|
||||
result.R2C2 = R2C2;
|
||||
}
|
||||
public static void Rotate(ref Matrix3d matrix, double angle, out Matrix3d result)
|
||||
{
|
||||
double angleRadians = Functions.DTOR * angle;
|
||||
double sin = (double)System.Math.Sin(angleRadians);
|
||||
double cos = (double)System.Math.Cos(angleRadians);
|
||||
|
||||
result.R0C0 = cos * matrix.R0C0 + sin * matrix.R1C0;
|
||||
result.R0C1 = cos * matrix.R0C1 + sin * matrix.R1C1;
|
||||
result.R0C2 = cos * matrix.R0C2 + sin * matrix.R1C2;
|
||||
result.R1C0 = cos * matrix.R1C0 - sin * matrix.R0C0;
|
||||
result.R1C1 = cos * matrix.R1C1 - sin * matrix.R0C1;
|
||||
result.R1C2 = cos * matrix.R1C2 - sin * matrix.R0C2;
|
||||
result.R2C0 = matrix.R2C0;
|
||||
result.R2C1 = matrix.R2C1;
|
||||
result.R2C2 = matrix.R2C2;
|
||||
}
|
||||
public static void RotateMatrix(double angle, out Matrix3d result)
|
||||
{
|
||||
double angleRadians = Functions.DTOR * angle;
|
||||
double sin = (double)System.Math.Sin(angleRadians);
|
||||
double cos = (double)System.Math.Cos(angleRadians);
|
||||
|
||||
result.R0C0 = cos;
|
||||
result.R0C1 = sin;
|
||||
result.R0C2 = 0;
|
||||
result.R1C0 = -sin;
|
||||
result.R1C1 = cos;
|
||||
result.R1C2 = 0;
|
||||
result.R2C0 = 0;
|
||||
result.R2C1 = 0;
|
||||
result.R2C2 = 1;
|
||||
}
|
||||
|
||||
public Quaterniond ToQuaternion()
|
||||
{
|
||||
//return new Quaterniond(ref this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constants
|
||||
|
||||
/// <summary>The identity matrix.</summary>
|
||||
public static readonly Matrix3d Identity = new Matrix3d
|
||||
(
|
||||
1, 0, 0,
|
||||
0, 1, 0,
|
||||
0, 0, 1
|
||||
);
|
||||
|
||||
/// <summary>A matrix of all zeros.</summary>
|
||||
public static readonly Matrix3d Zero = new Matrix3d
|
||||
(
|
||||
0, 0, 0,
|
||||
0, 0, 0,
|
||||
0, 0, 0
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
#region HashCode
|
||||
|
||||
/// <summary>Returns the hash code for this instance.</summary>
|
||||
/// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return
|
||||
R0C0.GetHashCode() ^ R0C1.GetHashCode() ^ R0C2.GetHashCode() ^
|
||||
R1C0.GetHashCode() ^ R1C1.GetHashCode() ^ R1C2.GetHashCode() ^
|
||||
R2C0.GetHashCode() ^ R2C1.GetHashCode() ^ R2C2.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region String
|
||||
|
||||
/// <summary>Returns the fully qualified type name of this instance.</summary>
|
||||
/// <returns>A System.String containing left fully qualified type name.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format(
|
||||
"|{00}, {01}, {02}|\n" +
|
||||
"|{03}, {04}, {05}|\n" +
|
||||
"|{06}, {07}, {18}|\n" +
|
||||
R0C0, R0C1, R0C2,
|
||||
R1C0, R1C1, R1C2,
|
||||
R2C0, R2C1, R2C2);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
#pragma warning restore 3019
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,235 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
#if NO_SYSDRAWING
|
||||
/// <summary>
|
||||
/// Defines a point on a two-dimensional plane.
|
||||
/// </summary>
|
||||
public struct Point : IEquatable<Point>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
int x, y;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Point instance.
|
||||
/// </summary>
|
||||
/// <param name="x">The X coordinate of this instance.</param>
|
||||
/// <param name="y">The Y coordinate of this instance.</param>
|
||||
public Point(int x, int y)
|
||||
: this()
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="System.Boolean"/> that indicates whether this instance is empty or zero.
|
||||
/// </summary>
|
||||
public bool IsEmpty { get { return X == 0 && Y == 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the X coordinate of this instance.
|
||||
/// </summary>
|
||||
public int X { get { return x; } set { x = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y coordinate of this instance.
|
||||
/// </summary>
|
||||
public int Y { get { return y; } set { y = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Point (0, 0).
|
||||
/// </summary>
|
||||
public static readonly Point Zero = new Point();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Point (0, 0).
|
||||
/// </summary>
|
||||
public static readonly Point Empty = new Point();
|
||||
|
||||
/// <summary>
|
||||
/// Translates the specified Point by the specified Size.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// The <see cref="Point"/> instance to translate.
|
||||
/// </param>
|
||||
/// <param name="size">
|
||||
/// The <see cref="Size"/> instance to translate point with.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A new <see cref="Point"/> instance translated by size.
|
||||
/// </returns>
|
||||
public static Point operator +(Point point, Size size)
|
||||
{
|
||||
return new Point(point.X + size.Width, point.Y + size.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Translates the specified Point by the negative of the specified Size.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// The <see cref="Point"/> instance to translate.
|
||||
/// </param>
|
||||
/// <param name="size">
|
||||
/// The <see cref="Size"/> instance to translate point with.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A new <see cref="Point"/> instance translated by size.
|
||||
/// </returns>
|
||||
public static Point operator -(Point point, Size size)
|
||||
{
|
||||
return new Point(point.X - size.Width, point.Y - size.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left is equal to right; false otherwise.</returns>
|
||||
public static bool operator ==(Point left, Point right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left is not equal to right; false otherwise.</returns>
|
||||
public static bool operator !=(Point left, Point right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an OpenTK.Point instance to a System.Drawing.Point.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// The <see cref="Point"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="System.Drawing.Point"/> instance equivalent to point.
|
||||
/// </returns>
|
||||
public static implicit operator System.Drawing.Point(Point point)
|
||||
{
|
||||
return new System.Drawing.Point(point.X, point.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a System.Drawing.Point instance to an OpenTK.Point.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// The <see cref="System.Drawing.Point"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="Point"/> instance equivalent to point.
|
||||
/// </returns>
|
||||
public static implicit operator Point(System.Drawing.Point point)
|
||||
{
|
||||
return new Point(point.X, point.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an OpenTK.Point instance to a System.Drawing.PointF.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// The <see cref="Point"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="System.Drawing.PointF"/> instance equivalent to point.
|
||||
/// </returns>
|
||||
public static implicit operator System.Drawing.PointF(Point point)
|
||||
{
|
||||
return new System.Drawing.PointF(point.X, point.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance is equal to the specified object.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object instance to compare to.</param>
|
||||
/// <returns>True, if both instances are equal; false otherwise.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Point)
|
||||
return Equals((Point)obj);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.Int32"/> that represents the hash code for this instance./></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() ^ Y.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String"/> that describes this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.String"/> that describes this instance.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{{{0}, {1}}}", X, Y);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEquatable<Point> Members
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance is equal to the specified Point.
|
||||
/// </summary>
|
||||
/// <param name="other">The instance to compare to.</param>
|
||||
/// <returns>True, if both instances are equal; false otherwise.</returns>
|
||||
public bool Equals(Point other)
|
||||
{
|
||||
return X == other.X && Y == other.Y;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,705 @@
|
|||
#region --- License ---
|
||||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Quaternion.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Quaternion : IEquatable<Quaternion>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
Vector3 xyz;
|
||||
float w;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new Quaternion from vector and w components
|
||||
/// </summary>
|
||||
/// <param name="v">The vector part</param>
|
||||
/// <param name="w">The w part</param>
|
||||
public Quaternion(Vector3 v, float w)
|
||||
{
|
||||
this.xyz = v;
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new Quaternion
|
||||
/// </summary>
|
||||
/// <param name="x">The x component</param>
|
||||
/// <param name="y">The y component</param>
|
||||
/// <param name="z">The z component</param>
|
||||
/// <param name="w">The w component</param>
|
||||
public Quaternion(float x, float y, float z, float w)
|
||||
: this(new Vector3(x, y, z), w)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
|
||||
/// </summary>
|
||||
[Obsolete("Use Xyz property instead.")]
|
||||
[CLSCompliant(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[XmlIgnore]
|
||||
public Vector3 XYZ { get { return Xyz; } set { Xyz = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
|
||||
/// </summary>
|
||||
public Vector3 Xyz { get { return xyz; } set { xyz = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the X component of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public float X { get { return xyz.X; } set { xyz.X = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y component of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public float Y { get { return xyz.Y; } set { xyz.Y = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Z component of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public float Z { get { return xyz.Z; } set { xyz.Z = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the W component of this instance.
|
||||
/// </summary>
|
||||
public float W { get { return w; } set { w = value; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Instance
|
||||
|
||||
#region ToAxisAngle
|
||||
|
||||
/// <summary>
|
||||
/// Convert the current quaternion to axis angle representation
|
||||
/// </summary>
|
||||
/// <param name="axis">The resultant axis</param>
|
||||
/// <param name="angle">The resultant angle</param>
|
||||
public void ToAxisAngle(out Vector3 axis, out float angle)
|
||||
{
|
||||
Vector4 result = ToAxisAngle();
|
||||
axis = result.Xyz;
|
||||
angle = result.W;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert this instance to an axis-angle representation.
|
||||
/// </summary>
|
||||
/// <returns>A Vector4 that is the axis-angle representation of this quaternion.</returns>
|
||||
public Vector4 ToAxisAngle()
|
||||
{
|
||||
Quaternion q = this;
|
||||
if (Math.Abs(q.W) > 1.0f)
|
||||
q.Normalize();
|
||||
|
||||
Vector4 result = new Vector4();
|
||||
|
||||
result.W = 2.0f * (float)System.Math.Acos(q.W); // angle
|
||||
float den = (float)System.Math.Sqrt(1.0 - q.W * q.W);
|
||||
if (den > 0.0001f)
|
||||
{
|
||||
result.Xyz = q.Xyz / den;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This occurs when the angle is zero.
|
||||
// Not a problem: just set an arbitrary normalized axis.
|
||||
result.Xyz = Vector3.UnitX;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public float Length
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length (magnitude) of the quaternion.
|
||||
/// </summary>
|
||||
/// <seealso cref="LengthSquared"/>
|
||||
public float Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)System.Math.Sqrt(W * W + Xyz.LengthSquared);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public float LengthSquared
|
||||
|
||||
/// <summary>
|
||||
/// Gets the square of the quaternion length (magnitude).
|
||||
/// </summary>
|
||||
public float LengthSquared
|
||||
{
|
||||
get
|
||||
{
|
||||
return W * W + Xyz.LengthSquared;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public void Normalize()
|
||||
|
||||
/// <summary>
|
||||
/// Scales the Quaternion to unit length.
|
||||
/// </summary>
|
||||
public void Normalize()
|
||||
{
|
||||
float scale = 1.0f / this.Length;
|
||||
Xyz *= scale;
|
||||
W *= scale;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public void Conjugate()
|
||||
|
||||
/// <summary>
|
||||
/// Convert this quaternion to its conjugate
|
||||
/// </summary>
|
||||
public void Conjugate()
|
||||
{
|
||||
Xyz = -Xyz;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static
|
||||
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Defines the identity quaternion.
|
||||
/// </summary>
|
||||
public static Quaternion Identity = new Quaternion(0, 0, 0, 1);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Add
|
||||
|
||||
/// <summary>
|
||||
/// Add two quaternions
|
||||
/// </summary>
|
||||
/// <param name="left">The first operand</param>
|
||||
/// <param name="right">The second operand</param>
|
||||
/// <returns>The result of the addition</returns>
|
||||
public static Quaternion Add(Quaternion left, Quaternion right)
|
||||
{
|
||||
return new Quaternion(
|
||||
left.Xyz + right.Xyz,
|
||||
left.W + right.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add two quaternions
|
||||
/// </summary>
|
||||
/// <param name="left">The first operand</param>
|
||||
/// <param name="right">The second operand</param>
|
||||
/// <param name="result">The result of the addition</param>
|
||||
public static void Add(ref Quaternion left, ref Quaternion right, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(
|
||||
left.Xyz + right.Xyz,
|
||||
left.W + right.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sub
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The left instance.</param>
|
||||
/// <param name="right">The right instance.</param>
|
||||
/// <returns>The result of the operation.</returns>
|
||||
public static Quaternion Sub(Quaternion left, Quaternion right)
|
||||
{
|
||||
return new Quaternion(
|
||||
left.Xyz - right.Xyz,
|
||||
left.W - right.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The left instance.</param>
|
||||
/// <param name="right">The right instance.</param>
|
||||
/// <param name="result">The result of the operation.</param>
|
||||
public static void Sub(ref Quaternion left, ref Quaternion right, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(
|
||||
left.Xyz - right.Xyz,
|
||||
left.W - right.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mult
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
[Obsolete("Use Multiply instead.")]
|
||||
public static Quaternion Mult(Quaternion left, Quaternion right)
|
||||
{
|
||||
return new Quaternion(
|
||||
right.W * left.Xyz + left.W * right.Xyz + Vector3.Cross(left.Xyz, right.Xyz),
|
||||
left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
[Obsolete("Use Multiply instead.")]
|
||||
public static void Mult(ref Quaternion left, ref Quaternion right, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(
|
||||
right.W * left.Xyz + left.W * right.Xyz + Vector3.Cross(left.Xyz, right.Xyz),
|
||||
left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static Quaternion Multiply(Quaternion left, Quaternion right)
|
||||
{
|
||||
Quaternion result;
|
||||
Multiply(ref left, ref right, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
public static void Multiply(ref Quaternion left, ref Quaternion right, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(
|
||||
right.W * left.Xyz + left.W * right.Xyz + Vector3.Cross(left.Xyz, right.Xyz),
|
||||
left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
public static void Multiply(ref Quaternion quaternion, float scale, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static Quaternion Multiply(Quaternion quaternion, float scale)
|
||||
{
|
||||
return new Quaternion(quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Conjugate
|
||||
|
||||
/// <summary>
|
||||
/// Get the conjugate of the given quaternion
|
||||
/// </summary>
|
||||
/// <param name="q">The quaternion</param>
|
||||
/// <returns>The conjugate of the given quaternion</returns>
|
||||
public static Quaternion Conjugate(Quaternion q)
|
||||
{
|
||||
return new Quaternion(-q.Xyz, q.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the conjugate of the given quaternion
|
||||
/// </summary>
|
||||
/// <param name="q">The quaternion</param>
|
||||
/// <param name="result">The conjugate of the given quaternion</param>
|
||||
public static void Conjugate(ref Quaternion q, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(-q.Xyz, q.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Invert
|
||||
|
||||
/// <summary>
|
||||
/// Get the inverse of the given quaternion
|
||||
/// </summary>
|
||||
/// <param name="q">The quaternion to invert</param>
|
||||
/// <returns>The inverse of the given quaternion</returns>
|
||||
public static Quaternion Invert(Quaternion q)
|
||||
{
|
||||
Quaternion result;
|
||||
Invert(ref q, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the inverse of the given quaternion
|
||||
/// </summary>
|
||||
/// <param name="q">The quaternion to invert</param>
|
||||
/// <param name="result">The inverse of the given quaternion</param>
|
||||
public static void Invert(ref Quaternion q, out Quaternion result)
|
||||
{
|
||||
float lengthSq = q.LengthSquared;
|
||||
if (lengthSq != 0.0)
|
||||
{
|
||||
float i = 1.0f / lengthSq;
|
||||
result = new Quaternion(q.Xyz * -i, q.W * i);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = q;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Normalize
|
||||
|
||||
/// <summary>
|
||||
/// Scale the given quaternion to unit length
|
||||
/// </summary>
|
||||
/// <param name="q">The quaternion to normalize</param>
|
||||
/// <returns>The normalized quaternion</returns>
|
||||
public static Quaternion Normalize(Quaternion q)
|
||||
{
|
||||
Quaternion result;
|
||||
Normalize(ref q, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scale the given quaternion to unit length
|
||||
/// </summary>
|
||||
/// <param name="q">The quaternion to normalize</param>
|
||||
/// <param name="result">The normalized quaternion</param>
|
||||
public static void Normalize(ref Quaternion q, out Quaternion result)
|
||||
{
|
||||
float scale = 1.0f / q.Length;
|
||||
result = new Quaternion(q.Xyz * scale, q.W * scale);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region FromAxisAngle
|
||||
|
||||
/// <summary>
|
||||
/// Build a quaternion from the given axis and angle
|
||||
/// </summary>
|
||||
/// <param name="axis">The axis to rotate about</param>
|
||||
/// <param name="angle">The rotation angle in radians</param>
|
||||
/// <returns></returns>
|
||||
public static Quaternion FromAxisAngle(Vector3 axis, float angle)
|
||||
{
|
||||
if (axis.LengthSquared == 0.0f)
|
||||
return Identity;
|
||||
|
||||
Quaternion result = Identity;
|
||||
|
||||
angle *= 0.5f;
|
||||
axis.Normalize();
|
||||
result.Xyz = axis * (float)System.Math.Sin(angle);
|
||||
result.W = (float)System.Math.Cos(angle);
|
||||
|
||||
return Normalize(result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Slerp
|
||||
|
||||
/// <summary>
|
||||
/// Do Spherical linear interpolation between two quaternions
|
||||
/// </summary>
|
||||
/// <param name="q1">The first quaternion</param>
|
||||
/// <param name="q2">The second quaternion</param>
|
||||
/// <param name="blend">The blend factor</param>
|
||||
/// <returns>A smooth blend between the given quaternions</returns>
|
||||
public static Quaternion Slerp(Quaternion q1, Quaternion q2, float blend)
|
||||
{
|
||||
// if either input is zero, return the other.
|
||||
if (q1.LengthSquared == 0.0f)
|
||||
{
|
||||
if (q2.LengthSquared == 0.0f)
|
||||
{
|
||||
return Identity;
|
||||
}
|
||||
return q2;
|
||||
}
|
||||
else if (q2.LengthSquared == 0.0f)
|
||||
{
|
||||
return q1;
|
||||
}
|
||||
|
||||
|
||||
float cosHalfAngle = q1.W * q2.W + Vector3.Dot(q1.Xyz, q2.Xyz);
|
||||
|
||||
if (cosHalfAngle >= 1.0f || cosHalfAngle <= -1.0f)
|
||||
{
|
||||
// angle = 0.0f, so just return one input.
|
||||
return q1;
|
||||
}
|
||||
else if (cosHalfAngle < 0.0f)
|
||||
{
|
||||
q2.Xyz = -q2.Xyz;
|
||||
q2.W = -q2.W;
|
||||
cosHalfAngle = -cosHalfAngle;
|
||||
}
|
||||
|
||||
float blendA;
|
||||
float blendB;
|
||||
if (cosHalfAngle < 0.99f)
|
||||
{
|
||||
// do proper slerp for big angles
|
||||
float halfAngle = (float)System.Math.Acos(cosHalfAngle);
|
||||
float sinHalfAngle = (float)System.Math.Sin(halfAngle);
|
||||
float oneOverSinHalfAngle = 1.0f / sinHalfAngle;
|
||||
blendA = (float)System.Math.Sin(halfAngle * (1.0f - blend)) * oneOverSinHalfAngle;
|
||||
blendB = (float)System.Math.Sin(halfAngle * blend) * oneOverSinHalfAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
// do lerp if angle is really small.
|
||||
blendA = 1.0f - blend;
|
||||
blendB = blend;
|
||||
}
|
||||
|
||||
Quaternion result = new Quaternion(blendA * q1.Xyz + blendB * q2.Xyz, blendA * q1.W + blendB * q2.W);
|
||||
if (result.LengthSquared > 0.0f)
|
||||
return Normalize(result);
|
||||
else
|
||||
return Identity;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaternion operator +(Quaternion left, Quaternion right)
|
||||
{
|
||||
left.Xyz += right.Xyz;
|
||||
left.W += right.W;
|
||||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaternion operator -(Quaternion left, Quaternion right)
|
||||
{
|
||||
left.Xyz -= right.Xyz;
|
||||
left.W -= right.W;
|
||||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaternion operator *(Quaternion left, Quaternion right)
|
||||
{
|
||||
Multiply(ref left, ref right, out left);
|
||||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static Quaternion operator *(Quaternion quaternion, float scale)
|
||||
{
|
||||
Multiply(ref quaternion, scale, out quaternion);
|
||||
return quaternion;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static Quaternion operator *(float scale, Quaternion quaternion)
|
||||
{
|
||||
return new Quaternion(quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Quaternion left, Quaternion right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(Quaternion left, Quaternion right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
|
||||
#region public override string ToString()
|
||||
|
||||
/// <summary>
|
||||
/// Returns a System.String that represents the current Quaternion.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("V: {0}, W: {1}", Xyz, W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public override bool Equals (object o)
|
||||
|
||||
/// <summary>
|
||||
/// Compares this object instance to another object for equality.
|
||||
/// </summary>
|
||||
/// <param name="other">The other object to be used in the comparison.</param>
|
||||
/// <returns>True if both objects are Quaternions of equal value. Otherwise it returns false.</returns>
|
||||
public override bool Equals(object other)
|
||||
{
|
||||
if (other is Quaternion == false) return false;
|
||||
return this == (Quaternion)other;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public override int GetHashCode ()
|
||||
|
||||
/// <summary>
|
||||
/// Provides the hash code for this object.
|
||||
/// </summary>
|
||||
/// <returns>A hash code formed from the bitwise XOR of this objects members.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Xyz.GetHashCode() ^ W.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEquatable<Quaternion> Members
|
||||
|
||||
/// <summary>
|
||||
/// Compares this Quaternion instance to another Quaternion for equality.
|
||||
/// </summary>
|
||||
/// <param name="other">The other Quaternion to be used in the comparison.</param>
|
||||
/// <returns>True if both instances are equal; false otherwise.</returns>
|
||||
public bool Equals(Quaternion other)
|
||||
{
|
||||
return Xyz == other.Xyz && W == other.W;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,323 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
#if NO_SYSDRAWING
|
||||
/// <summary>
|
||||
/// Represents a rectangular region on a two-dimensional plane.
|
||||
/// </summary>
|
||||
public struct Rectangle : IEquatable<Rectangle>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
Point location;
|
||||
Size size;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Rectangle instance.
|
||||
/// </summary>
|
||||
/// <param name="location">The top-left corner of the Rectangle.</param>
|
||||
/// <param name="size">The width and height of the Rectangle.</param>
|
||||
public Rectangle(Point location, Size size)
|
||||
: this()
|
||||
{
|
||||
Location = location;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Rectangle instance.
|
||||
/// </summary>
|
||||
/// <param name="x">The x coordinate of the Rectangle.</param>
|
||||
/// <param name="y">The y coordinate of the Rectangle.</param>
|
||||
/// <param name="width">The width coordinate of the Rectangle.</param>
|
||||
/// <param name="height">The height coordinate of the Rectangle.</param>
|
||||
public Rectangle(int x, int y, int width, int height)
|
||||
: this(new Point(x, y), new Size(width, height))
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the x coordinate of the Rectangle.
|
||||
/// </summary>
|
||||
public int X
|
||||
{
|
||||
get { return Location.X; }
|
||||
set { Location = new Point (value, Y); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the y coordinate of the Rectangle.
|
||||
/// </summary>
|
||||
public int Y
|
||||
{
|
||||
get { return Location.Y; }
|
||||
set { Location = new Point (X, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the Rectangle.
|
||||
/// </summary>
|
||||
public int Width
|
||||
{
|
||||
get { return Size.Width; }
|
||||
set { Size = new Size (value, Height); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the height of the Rectangle.
|
||||
/// </summary>
|
||||
public int Height
|
||||
{
|
||||
get { return Size.Height; }
|
||||
set { Size = new Size(Width, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="Point"/> representing the x and y coordinates
|
||||
/// of the Rectangle.
|
||||
/// </summary>
|
||||
public Point Location
|
||||
{
|
||||
get { return location; }
|
||||
set { location = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="Size"/> representing the width and height
|
||||
/// of the Rectangle.
|
||||
/// </summary>
|
||||
public Size Size
|
||||
{
|
||||
get { return size; }
|
||||
set { size = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the y coordinate of the top edge of this Rectangle.
|
||||
/// </summary>
|
||||
public int Top { get { return Y; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the x coordinate of the right edge of this Rectangle.
|
||||
/// </summary>
|
||||
public int Right { get { return X + Width; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the y coordinate of the bottom edge of this Rectangle.
|
||||
/// </summary>
|
||||
public int Bottom { get { return Y + Height; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the x coordinate of the left edge of this Rectangle.
|
||||
/// </summary>
|
||||
public int Left { get { return X; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="System.Boolean"/> that indicates whether this
|
||||
/// Rectangle is equal to the empty Rectangle.
|
||||
/// </summary>
|
||||
public bool IsEmpty
|
||||
{
|
||||
get { return Location.IsEmpty && Size.IsEmpty; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the empty Rectangle.
|
||||
/// </summary>
|
||||
public static readonly Rectangle Zero = new Rectangle();
|
||||
|
||||
/// <summary>
|
||||
/// Defines the empty Rectangle.
|
||||
/// </summary>
|
||||
public static readonly Rectangle Empty = new Rectangle();
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance with the specified edges.
|
||||
/// </summary>
|
||||
/// <param name="left">The left edge of the Rectangle.</param>
|
||||
/// <param name="top">The top edge of the Rectangle.</param>
|
||||
/// <param name="right">The right edge of the Rectangle.</param>
|
||||
/// <param name="bottom">The bottom edge of the Rectangle.</param>
|
||||
/// <returns>A new Rectangle instance with the specified edges.</returns>
|
||||
public static Rectangle FromLTRB(int left, int top, int right, int bottom)
|
||||
{
|
||||
return new Rectangle(new Point(left, top), new Size(right - left, bottom - top));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests whether this instance contains the specified Point.
|
||||
/// </summary>
|
||||
/// <param name="point">The <see cref="Point"/> to test.</param>
|
||||
/// <returns>True if this instance contains point; false otherwise.</returns>
|
||||
/// <remarks>The left and top edges are inclusive. The right and bottom edges
|
||||
/// are exclusive.</remarks>
|
||||
public bool Contains(Point point)
|
||||
{
|
||||
return point.X >= Left && point.X < Right &&
|
||||
point.Y >= Top && point.Y < Bottom;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests whether this instance contains the specified Rectangle.
|
||||
/// </summary>
|
||||
/// <param name="rect">The <see cref="Rectangle"/> to test.</param>
|
||||
/// <returns>True if this instance contains rect; false otherwise.</returns>
|
||||
/// <remarks>The left and top edges are inclusive. The right and bottom edges
|
||||
/// are exclusive.</remarks>
|
||||
public bool Contains(Rectangle rect)
|
||||
{
|
||||
return Contains(rect.Location) && Contains(rect.Location + rect.Size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left is equal to right; false otherwise.</returns>
|
||||
public static bool operator ==(Rectangle left, Rectangle right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left is not equal to right; false otherwise.</returns>
|
||||
public static bool operator !=(Rectangle left, Rectangle right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an OpenTK.Rectangle instance to a System.Drawing.Rectangle.
|
||||
/// </summary>
|
||||
/// <param name="rect">
|
||||
/// The <see cref="Rectangle"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="System.Drawing.Rectangle"/> instance equivalent to rect.
|
||||
/// </returns>
|
||||
public static implicit operator System.Drawing.Rectangle(Rectangle rect)
|
||||
{
|
||||
return new System.Drawing.Rectangle(rect.Location, rect.Size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a System.Drawing.Rectangle instance to an OpenTK.Rectangle.
|
||||
/// </summary>
|
||||
/// <param name="rect">
|
||||
/// The <see cref="System.Drawing.Rectangle"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="Rectangle"/> instance equivalent to point.
|
||||
/// </returns>
|
||||
public static implicit operator Rectangle(System.Drawing.Rectangle rect)
|
||||
{
|
||||
return new Rectangle(rect.Location, rect.Size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an OpenTK.Rectangle instance to a System.Drawing.RectangleF.
|
||||
/// </summary>
|
||||
/// <param name="rect">
|
||||
/// The <see cref="Rectangle"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="System.Drawing.RectangleF"/> instance equivalent to rect.
|
||||
/// </returns>
|
||||
public static implicit operator System.Drawing.RectangleF(Rectangle rect)
|
||||
{
|
||||
return new System.Drawing.RectangleF(rect.Location, rect.Size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance is equal to the specified object.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object instance to compare to.</param>
|
||||
/// <returns>True, if both instances are equal; false otherwise.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Rectangle)
|
||||
return Equals((Rectangle)obj);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.Int32"/> that represents the hash code for this instance./></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Location.GetHashCode() & Size.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String"/> that describes this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.String"/> that describes this instance.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{{{0}-{1}}}", Location, Location + Size);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEquatable<Rectangle> Members
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance is equal to the specified Rectangle.
|
||||
/// </summary>
|
||||
/// <param name="other">The instance to compare to.</param>
|
||||
/// <returns>True, if both instances are equal; false otherwise.</returns>
|
||||
public bool Equals(Rectangle other)
|
||||
{
|
||||
return Location.Equals(other.Location) &&
|
||||
Size.Equals(other.Size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,222 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
||||
//
|
||||
// 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
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
#if NO_SYSDRAWING
|
||||
/// <summary>
|
||||
/// Stores the width and height of a rectangle.
|
||||
/// </summary>
|
||||
public struct Size : IEquatable<Size>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
int width, height;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Size instance.
|
||||
/// </summary>
|
||||
/// <param name="width">The width of this instance.</param>
|
||||
/// <param name="height">The height of this instance.</param>
|
||||
public Size(int width, int height)
|
||||
: this()
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of this instance.
|
||||
/// </summary>
|
||||
public int Width
|
||||
{
|
||||
get { return width; }
|
||||
set
|
||||
{
|
||||
if (width < 0)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
width = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the height of this instance.
|
||||
/// </summary>
|
||||
public int Height
|
||||
{
|
||||
get { return height; }
|
||||
set
|
||||
{
|
||||
if (height < 0)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
height = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="System.Boolean"/> that indicates whether this instance is empty or zero.
|
||||
/// </summary>
|
||||
public bool IsEmpty
|
||||
{
|
||||
get { return Width == 0 && Height == 0; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a Size instance equal to (0, 0).
|
||||
/// </summary>
|
||||
public static readonly Size Empty = new Size();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a Size instance equal to (0, 0).
|
||||
/// </summary>
|
||||
public static readonly Size Zero = new Size();
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left is equal to right; false otherwise.</returns>
|
||||
public static bool operator ==(Size left, Size right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left is not equal to right; false otherwise.</returns>
|
||||
public static bool operator !=(Size left, Size right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an OpenTK.Size instance to a System.Drawing.Size.
|
||||
/// </summary>
|
||||
/// <param name="size">
|
||||
/// The <see cref="Size"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="System.Drawing.Size"/> instance equivalent to size.
|
||||
/// </returns>
|
||||
public static implicit operator System.Drawing.Size(Size size)
|
||||
{
|
||||
return new System.Drawing.Size(size.Width, size.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a System.Drawing.Size instance to an OpenTK.Size.
|
||||
/// </summary>
|
||||
/// <param name="size">
|
||||
/// The <see cref="System.Drawing.Size"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="Size"/> instance equivalent to size.
|
||||
/// </returns>
|
||||
public static implicit operator Size(System.Drawing.Size size)
|
||||
{
|
||||
return new Size(size.Width, size.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an OpenTK.Point instance to a System.Drawing.SizeF.
|
||||
/// </summary>
|
||||
/// <param name="size">
|
||||
/// The <see cref="Size"/> instance to convert.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="System.Drawing.SizeF"/> instance equivalent to size.
|
||||
/// </returns>
|
||||
public static implicit operator System.Drawing.SizeF(Size size)
|
||||
{
|
||||
return new System.Drawing.SizeF(size.Width, size.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance is equal to the specified object.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object instance to compare to.</param>
|
||||
/// <returns>True, if both instances are equal; false otherwise.</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Size)
|
||||
return Equals((Size)obj);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.Int32"/> that represents the hash code for this instance./></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Width.GetHashCode() ^ Height.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String"/> that describes this instance.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="System.String"/> that describes this instance.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{{{0}, {1}}}", Width, Height);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEquatable<Size> Members
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance is equal to the specified Size.
|
||||
/// </summary>
|
||||
/// <param name="other">The instance to compare to.</param>
|
||||
/// <returns>True, if both instances are equal; false otherwise.</returns>
|
||||
public bool Equals(Size other)
|
||||
{
|
||||
return Width == other.Width && Height == other.Height;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,362 @@
|
|||
#region --- License ---
|
||||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
|
||||
/// <summary>2-component Vector of the Half type. Occupies 4 Byte total.</summary>
|
||||
[Serializable, StructLayout(LayoutKind.Sequential)]
|
||||
public struct Vector2h : ISerializable, IEquatable<Vector2h>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>The X component of the Half2.</summary>
|
||||
public Half X;
|
||||
|
||||
/// <summary>The Y component of the Half2.</summary>
|
||||
public Half Y;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The value that will initialize this instance.</param>
|
||||
public Vector2h(Half value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The value that will initialize this instance.</param>
|
||||
public Vector2h(Single value)
|
||||
{
|
||||
X = new Half(value);
|
||||
Y = new Half(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will avoid conversion and copy directly from the Half parameters.
|
||||
/// </summary>
|
||||
/// <param name="x">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
/// <param name="y">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
public Vector2h(Half x, Half y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the 2 parameters into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="x">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="y">32-bit single-precision floating-point number.</param>
|
||||
public Vector2h(Single x, Single y)
|
||||
{
|
||||
X = new Half(x);
|
||||
Y = new Half(y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the 2 parameters into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="x">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="y">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector2h(Single x, Single y, bool throwOnError)
|
||||
{
|
||||
X = new Half(x, throwOnError);
|
||||
Y = new Half(y, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector2h(Vector2 v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector2h(Vector2 v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
|
||||
/// This is the fastest constructor.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2</param>
|
||||
public Vector2h(ref Vector2 v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector2h(ref Vector2 v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2d</param>
|
||||
public Vector2h(Vector2d v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2d</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector2h(Vector2d v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
|
||||
/// This is the faster constructor.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2d</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector2h(ref Vector2d v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector2d</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector2h(ref Vector2d v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Half -> Single
|
||||
|
||||
/// <summary>
|
||||
/// Returns this Half2 instance's contents as Vector2.
|
||||
/// </summary>
|
||||
/// <returns>OpenTK.Vector2</returns>
|
||||
public Vector2 ToVector2()
|
||||
{
|
||||
return new Vector2(X, Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns this Half2 instance's contents as Vector2d.
|
||||
/// </summary>
|
||||
public Vector2d ToVector2d()
|
||||
{
|
||||
return new Vector2d(X, Y);
|
||||
}
|
||||
|
||||
#endregion Half -> Single
|
||||
|
||||
#region Conversions
|
||||
|
||||
/// <summary>Converts OpenTK.Vector2 to OpenTK.Half2.</summary>
|
||||
/// <param name="v">The Vector2 to convert.</param>
|
||||
/// <returns>The resulting Half vector.</returns>
|
||||
public static explicit operator Vector2h(Vector2 v)
|
||||
{
|
||||
return new Vector2h(v);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Vector2d to OpenTK.Half2.</summary>
|
||||
/// <param name="v">The Vector2d to convert.</param>
|
||||
/// <returns>The resulting Half vector.</returns>
|
||||
public static explicit operator Vector2h(Vector2d v)
|
||||
{
|
||||
return new Vector2h(v);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Half2 to OpenTK.Vector2.</summary>
|
||||
/// <param name="h">The Half2 to convert.</param>
|
||||
/// <returns>The resulting Vector2.</returns>
|
||||
public static explicit operator Vector2(Vector2h h)
|
||||
{
|
||||
return new Vector2(h.X, h.Y);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Half2 to OpenTK.Vector2d.</summary>
|
||||
/// <param name="h">The Half2 to convert.</param>
|
||||
/// <returns>The resulting Vector2d.</returns>
|
||||
public static explicit operator Vector2d(Vector2h h)
|
||||
{
|
||||
return new Vector2d(h.X, h.Y);
|
||||
}
|
||||
|
||||
#endregion Conversions
|
||||
|
||||
#region Constants
|
||||
|
||||
/// <summary>The size in bytes for an instance of the Half2 struct is 4.</summary>
|
||||
public static readonly int SizeInBytes = 4;
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region ISerializable
|
||||
|
||||
/// <summary>Constructor used by ISerializable to deserialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public Vector2h(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
this.X = (Half)info.GetValue("X", typeof(Half));
|
||||
this.Y = (Half)info.GetValue("Y", typeof(Half));
|
||||
}
|
||||
|
||||
/// <summary>Used by ISerialize to serialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
info.AddValue("X", this.X);
|
||||
info.AddValue("Y", this.Y);
|
||||
}
|
||||
|
||||
#endregion ISerializable
|
||||
|
||||
#region Binary dump
|
||||
|
||||
/// <summary>Updates the X and Y components of this instance by reading from a Stream.</summary>
|
||||
/// <param name="bin">A BinaryReader instance associated with an open Stream.</param>
|
||||
public void FromBinaryStream(BinaryReader bin)
|
||||
{
|
||||
X.FromBinaryStream(bin);
|
||||
Y.FromBinaryStream(bin);
|
||||
}
|
||||
|
||||
/// <summary>Writes the X and Y components of this instance into a Stream.</summary>
|
||||
/// <param name="bin">A BinaryWriter instance associated with an open Stream.</param>
|
||||
public void ToBinaryStream(BinaryWriter bin)
|
||||
{
|
||||
X.ToBinaryStream(bin);
|
||||
Y.ToBinaryStream(bin);
|
||||
}
|
||||
|
||||
#endregion Binary dump
|
||||
|
||||
#region IEquatable<Half2> Members
|
||||
|
||||
/// <summary>Returns a value indicating whether this instance is equal to a specified OpenTK.Half2 vector.</summary>
|
||||
/// <param name="other">OpenTK.Half2 to compare to this instance..</param>
|
||||
/// <returns>True, if other is equal to this instance; false otherwise.</returns>
|
||||
public bool Equals(Vector2h other)
|
||||
{
|
||||
return (this.X.Equals(other.X) && this.Y.Equals(other.Y));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ToString()
|
||||
|
||||
/// <summary>Returns a string that contains this Half2's numbers in human-legible form.</summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("({0}, {1})", X.ToString(), Y.ToString());
|
||||
}
|
||||
|
||||
#endregion ToString()
|
||||
|
||||
#region BitConverter
|
||||
|
||||
/// <summary>Returns the Half2 as an array of bytes.</summary>
|
||||
/// <param name="h">The Half2 to convert.</param>
|
||||
/// <returns>The input as byte array.</returns>
|
||||
public static byte[] GetBytes(Vector2h h)
|
||||
{
|
||||
byte[] result = new byte[SizeInBytes];
|
||||
|
||||
byte[] temp = Half.GetBytes(h.X);
|
||||
result[0] = temp[0];
|
||||
result[1] = temp[1];
|
||||
temp = Half.GetBytes(h.Y);
|
||||
result[2] = temp[0];
|
||||
result[3] = temp[1];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts an array of bytes into Half2.</summary>
|
||||
/// <param name="value">A Half2 in it's byte[] representation.</param>
|
||||
/// <param name="startIndex">The starting position within value.</param>
|
||||
/// <returns>A new Half2 instance.</returns>
|
||||
public static Vector2h FromBytes(byte[] value, int startIndex)
|
||||
{
|
||||
Vector2h h2 = new Vector2h();
|
||||
h2.X = Half.FromBytes(value, startIndex);
|
||||
h2.Y = Half.FromBytes(value, startIndex + 2);
|
||||
return h2;
|
||||
}
|
||||
|
||||
#endregion BitConverter
|
||||
}
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,409 @@
|
|||
#region --- License ---
|
||||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// 3-component Vector of the Half type. Occupies 6 Byte total.
|
||||
/// </summary>
|
||||
[Serializable, StructLayout(LayoutKind.Sequential)]
|
||||
public struct Vector3h : ISerializable, IEquatable<Vector3h>
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>The X component of the Half3.</summary>
|
||||
public Half X;
|
||||
|
||||
/// <summary>The Y component of the Half3.</summary>
|
||||
public Half Y;
|
||||
|
||||
/// <summary>The Z component of the Half3.</summary>
|
||||
public Half Z;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The value that will initialize this instance.</param>
|
||||
public Vector3h(Half value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
Z = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The value that will initialize this instance.</param>
|
||||
public Vector3h(Single value)
|
||||
{
|
||||
X = new Half(value);
|
||||
Y = new Half(value);
|
||||
Z = new Half(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will avoid conversion and copy directly from the Half parameters.
|
||||
/// </summary>
|
||||
/// <param name="x">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
/// <param name="y">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
/// <param name="z">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
public Vector3h(Half x, Half y, Half z)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Z = z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the 3 parameters into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="x">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="y">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="z">32-bit single-precision floating-point number.</param>
|
||||
public Vector3h(Single x, Single y, Single z)
|
||||
{
|
||||
X = new Half(x);
|
||||
Y = new Half(y);
|
||||
Z = new Half(z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the 3 parameters into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="x">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="y">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="z">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector3h(Single x, Single y, Single z, bool throwOnError)
|
||||
{
|
||||
X = new Half(x, throwOnError);
|
||||
Y = new Half(y, throwOnError);
|
||||
Z = new Half(z, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector3h(Vector3 v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector3h(Vector3 v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
|
||||
/// This is the fastest constructor.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3</param>
|
||||
public Vector3h(ref Vector3 v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector3h(ref Vector3 v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3d</param>
|
||||
public Vector3h(Vector3d v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3d</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector3h(Vector3d v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
|
||||
/// This is the faster constructor.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3d</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector3h(ref Vector3d v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector3d</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector3h(ref Vector3d v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Swizzle
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an OpenTK.Vector2h with the X and Y components of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector2h Xy { get { return new Vector2h(X, Y); } set { X = value.X; Y = value.Y; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Half -> Single
|
||||
|
||||
/// <summary>
|
||||
/// Returns this Half3 instance's contents as Vector3.
|
||||
/// </summary>
|
||||
/// <returns>OpenTK.Vector3</returns>
|
||||
public Vector3 ToVector3()
|
||||
{
|
||||
return new Vector3(X, Y, Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns this Half3 instance's contents as Vector3d.
|
||||
/// </summary>
|
||||
public Vector3d ToVector3d()
|
||||
{
|
||||
return new Vector3d(X, Y, Z);
|
||||
}
|
||||
|
||||
#endregion Half -> Single
|
||||
|
||||
#region Conversions
|
||||
|
||||
/// <summary>Converts OpenTK.Vector3 to OpenTK.Half3.</summary>
|
||||
/// <param name="v3f">The Vector3 to convert.</param>
|
||||
/// <returns>The resulting Half vector.</returns>
|
||||
public static explicit operator Vector3h(Vector3 v3f)
|
||||
{
|
||||
return new Vector3h(v3f);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Vector3d to OpenTK.Half3.</summary>
|
||||
/// <param name="v3d">The Vector3d to convert.</param>
|
||||
/// <returns>The resulting Half vector.</returns>
|
||||
public static explicit operator Vector3h(Vector3d v3d)
|
||||
{
|
||||
return new Vector3h(v3d);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Half3 to OpenTK.Vector3.</summary>
|
||||
/// <param name="h3">The Half3 to convert.</param>
|
||||
/// <returns>The resulting Vector3.</returns>
|
||||
public static explicit operator Vector3(Vector3h h3)
|
||||
{
|
||||
Vector3 result = new Vector3();
|
||||
result.X = h3.X.ToSingle();
|
||||
result.Y = h3.Y.ToSingle();
|
||||
result.Z = h3.Z.ToSingle();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Half3 to OpenTK.Vector3d.</summary>
|
||||
/// <param name="h3">The Half3 to convert.</param>
|
||||
/// <returns>The resulting Vector3d.</returns>
|
||||
public static explicit operator Vector3d(Vector3h h3)
|
||||
{
|
||||
Vector3d result = new Vector3d();
|
||||
result.X = h3.X.ToSingle();
|
||||
result.Y = h3.Y.ToSingle();
|
||||
result.Z = h3.Z.ToSingle();
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Conversions
|
||||
|
||||
#region Constants
|
||||
|
||||
/// <summary>The size in bytes for an instance of the Half3 struct is 6.</summary>
|
||||
public static readonly int SizeInBytes = 6;
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region ISerializable
|
||||
|
||||
/// <summary>Constructor used by ISerializable to deserialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public Vector3h(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
this.X = (Half)info.GetValue("X", typeof(Half));
|
||||
this.Y = (Half)info.GetValue("Y", typeof(Half));
|
||||
this.Z = (Half)info.GetValue("Z", typeof(Half));
|
||||
}
|
||||
|
||||
/// <summary>Used by ISerialize to serialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
info.AddValue("X", this.X);
|
||||
info.AddValue("Y", this.Y);
|
||||
info.AddValue("Z", this.Z);
|
||||
}
|
||||
|
||||
#endregion ISerializable
|
||||
|
||||
#region Binary dump
|
||||
|
||||
/// <summary>Updates the X,Y and Z components of this instance by reading from a Stream.</summary>
|
||||
/// <param name="bin">A BinaryReader instance associated with an open Stream.</param>
|
||||
public void FromBinaryStream(BinaryReader bin)
|
||||
{
|
||||
X.FromBinaryStream(bin);
|
||||
Y.FromBinaryStream(bin);
|
||||
Z.FromBinaryStream(bin);
|
||||
}
|
||||
|
||||
/// <summary>Writes the X,Y and Z components of this instance into a Stream.</summary>
|
||||
/// <param name="bin">A BinaryWriter instance associated with an open Stream.</param>
|
||||
public void ToBinaryStream(BinaryWriter bin)
|
||||
{
|
||||
X.ToBinaryStream(bin);
|
||||
Y.ToBinaryStream(bin);
|
||||
Z.ToBinaryStream(bin);
|
||||
}
|
||||
|
||||
#endregion Binary dump
|
||||
|
||||
#region IEquatable<Half3> Members
|
||||
|
||||
/// <summary>Returns a value indicating whether this instance is equal to a specified OpenTK.Half3 vector.</summary>
|
||||
/// <param name="other">OpenTK.Half3 to compare to this instance..</param>
|
||||
/// <returns>True, if other is equal to this instance; false otherwise.</returns>
|
||||
public bool Equals(Vector3h other)
|
||||
{
|
||||
return (this.X.Equals(other.X) && this.Y.Equals(other.Y) && this.Z.Equals(other.Z));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ToString()
|
||||
|
||||
/// <summary>Returns a string that contains this Half3's numbers in human-legible form.</summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("({0}, {1}, {2})", X.ToString(), Y.ToString(), Z.ToString());
|
||||
}
|
||||
|
||||
#endregion ToString()
|
||||
|
||||
#region BitConverter
|
||||
|
||||
/// <summary>Returns the Half3 as an array of bytes.</summary>
|
||||
/// <param name="h">The Half3 to convert.</param>
|
||||
/// <returns>The input as byte array.</returns>
|
||||
public static byte[] GetBytes(Vector3h h)
|
||||
{
|
||||
byte[] result = new byte[SizeInBytes];
|
||||
|
||||
byte[] temp = Half.GetBytes(h.X);
|
||||
result[0] = temp[0];
|
||||
result[1] = temp[1];
|
||||
temp = Half.GetBytes(h.Y);
|
||||
result[2] = temp[0];
|
||||
result[3] = temp[1];
|
||||
temp = Half.GetBytes(h.Z);
|
||||
result[4] = temp[0];
|
||||
result[5] = temp[1];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts an array of bytes into Half3.</summary>
|
||||
/// <param name="value">A Half3 in it's byte[] representation.</param>
|
||||
/// <param name="startIndex">The starting position within value.</param>
|
||||
/// <returns>A new Half3 instance.</returns>
|
||||
public static Vector3h FromBytes(byte[] value, int startIndex)
|
||||
{
|
||||
Vector3h h3 = new Vector3h();
|
||||
h3.X = Half.FromBytes(value, startIndex);
|
||||
h3.Y = Half.FromBytes(value, startIndex + 2);
|
||||
h3.Z = Half.FromBytes(value, startIndex + 4);
|
||||
return h3;
|
||||
}
|
||||
|
||||
#endregion BitConverter
|
||||
}
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,444 @@
|
|||
#region --- License ---
|
||||
/*
|
||||
Copyright (c) 2006 - 2008 The Open Toolkit library.
|
||||
|
||||
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
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning disable 3021
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// 4-component Vector of the Half type. Occupies 8 Byte total.
|
||||
/// </summary>
|
||||
[Serializable, StructLayout(LayoutKind.Sequential)]
|
||||
public struct Vector4h : ISerializable, IEquatable<Vector4h>
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>The X component of the Half4.</summary>
|
||||
public Half X;
|
||||
|
||||
/// <summary>The Y component of the Half4.</summary>
|
||||
public Half Y;
|
||||
|
||||
/// <summary>The Z component of the Half4.</summary>
|
||||
public Half Z;
|
||||
|
||||
/// <summary>The W component of the Half4.</summary>
|
||||
public Half W;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The value that will initialize this instance.</param>
|
||||
public Vector4h(Half value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
Z = value;
|
||||
W = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The value that will initialize this instance.</param>
|
||||
public Vector4h(Single value)
|
||||
{
|
||||
X = new Half(value);
|
||||
Y = new Half(value);
|
||||
Z = new Half(value);
|
||||
W = new Half(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will avoid conversion and copy directly from the Half parameters.
|
||||
/// </summary>
|
||||
/// <param name="x">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
/// <param name="y">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
/// <param name="z">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
/// <param name="w">An Half instance of a 16-bit half-precision floating-point number.</param>
|
||||
public Vector4h(Half x, Half y, Half z, Half w)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Z = z;
|
||||
this.W = w;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="x">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="y">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="z">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="w">32-bit single-precision floating-point number.</param>
|
||||
public Vector4h(Single x, Single y, Single z, Single w)
|
||||
{
|
||||
X = new Half(x);
|
||||
Y = new Half(y);
|
||||
Z = new Half(z);
|
||||
W = new Half(w);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="x">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="y">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="z">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="w">32-bit single-precision floating-point number.</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector4h(Single x, Single y, Single z, Single w, bool throwOnError)
|
||||
{
|
||||
X = new Half(x, throwOnError);
|
||||
Y = new Half(y, throwOnError);
|
||||
Z = new Half(z, throwOnError);
|
||||
W = new Half(w, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector4h(Vector4 v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
W = new Half(v.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector4h(Vector4 v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
W = new Half(v.W, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
|
||||
/// This is the fastest constructor.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4</param>
|
||||
public Vector4h(ref Vector4 v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
W = new Half(v.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector4h(ref Vector4 v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
W = new Half(v.W, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4d</param>
|
||||
public Vector4h(Vector4d v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
W = new Half(v.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4d</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
public Vector4h(Vector4d v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
W = new Half(v.W, throwOnError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
|
||||
/// This is the faster constructor.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4d</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector4h(ref Vector4d v)
|
||||
{
|
||||
X = new Half(v.X);
|
||||
Y = new Half(v.Y);
|
||||
Z = new Half(v.Z);
|
||||
W = new Half(v.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
|
||||
/// </summary>
|
||||
/// <param name="v">OpenTK.Vector4d</param>
|
||||
/// <param name="throwOnError">Enable checks that will throw if the conversion result is not meaningful.</param>
|
||||
[CLSCompliant(false)]
|
||||
public Vector4h(ref Vector4d v, bool throwOnError)
|
||||
{
|
||||
X = new Half(v.X, throwOnError);
|
||||
Y = new Half(v.Y, throwOnError);
|
||||
Z = new Half(v.Z, throwOnError);
|
||||
W = new Half(v.W, throwOnError);
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Swizzle
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an OpenTK.Vector2h with the X and Y components of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector2h Xy { get { return new Vector2h(X, Y); } set { X = value.X; Y = value.Y; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an OpenTK.Vector3h with the X, Y and Z components of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector3h Xyz { get { return new Vector3h(X, Y, Z); } set { X = value.X; Y = value.Y; Z = value.Z; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Half -> Single
|
||||
|
||||
/// <summary>
|
||||
/// Returns this Half4 instance's contents as Vector4.
|
||||
/// </summary>
|
||||
/// <returns>OpenTK.Vector4</returns>
|
||||
public Vector4 ToVector4()
|
||||
{
|
||||
return new Vector4(X, Y, Z, W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns this Half4 instance's contents as Vector4d.
|
||||
/// </summary>
|
||||
public Vector4d ToVector4d()
|
||||
{
|
||||
return new Vector4d(X, Y, Z, W);
|
||||
}
|
||||
|
||||
#endregion Half -> Single
|
||||
|
||||
#region Conversions
|
||||
|
||||
/// <summary>Converts OpenTK.Vector4 to OpenTK.Half4.</summary>
|
||||
/// <param name="v4f">The Vector4 to convert.</param>
|
||||
/// <returns>The resulting Half vector.</returns>
|
||||
public static explicit operator Vector4h(Vector4 v4f)
|
||||
{
|
||||
return new Vector4h(v4f);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Vector4d to OpenTK.Half4.</summary>
|
||||
/// <param name="v4d">The Vector4d to convert.</param>
|
||||
/// <returns>The resulting Half vector.</returns>
|
||||
public static explicit operator Vector4h(Vector4d v4d)
|
||||
{
|
||||
return new Vector4h(v4d);
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Half4 to OpenTK.Vector4.</summary>
|
||||
/// <param name="h4">The Half4 to convert.</param>
|
||||
/// <returns>The resulting Vector4.</returns>
|
||||
public static explicit operator Vector4(Vector4h h4)
|
||||
{
|
||||
Vector4 result = new Vector4();
|
||||
result.X = h4.X.ToSingle();
|
||||
result.Y = h4.Y.ToSingle();
|
||||
result.Z = h4.Z.ToSingle();
|
||||
result.W = h4.W.ToSingle();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts OpenTK.Half4 to OpenTK.Vector4d.</summary>
|
||||
/// <param name="h4">The Half4 to convert.</param>
|
||||
/// <returns>The resulting Vector4d.</returns>
|
||||
public static explicit operator Vector4d(Vector4h h4)
|
||||
{
|
||||
Vector4d result = new Vector4d();
|
||||
result.X = h4.X.ToSingle();
|
||||
result.Y = h4.Y.ToSingle();
|
||||
result.Z = h4.Z.ToSingle();
|
||||
result.W = h4.W.ToSingle();
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Conversions
|
||||
|
||||
#region Constants
|
||||
|
||||
/// <summary>The size in bytes for an instance of the Half4 struct is 8.</summary>
|
||||
public static readonly int SizeInBytes = 8;
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region ISerializable
|
||||
|
||||
/// <summary>Constructor used by ISerializable to deserialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public Vector4h(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
this.X = (Half)info.GetValue("X", typeof(Half));
|
||||
this.Y = (Half)info.GetValue("Y", typeof(Half));
|
||||
this.Z = (Half)info.GetValue("Z", typeof(Half));
|
||||
this.W = (Half)info.GetValue("W", typeof(Half));
|
||||
}
|
||||
|
||||
/// <summary>Used by ISerialize to serialize the object.</summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="context"></param>
|
||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
info.AddValue("X", this.X);
|
||||
info.AddValue("Y", this.Y);
|
||||
info.AddValue("Z", this.Z);
|
||||
info.AddValue("W", this.W);
|
||||
}
|
||||
|
||||
#endregion ISerializable
|
||||
|
||||
#region Binary dump
|
||||
|
||||
/// <summary>Updates the X,Y,Z and W components of this instance by reading from a Stream.</summary>
|
||||
/// <param name="bin">A BinaryReader instance associated with an open Stream.</param>
|
||||
public void FromBinaryStream(BinaryReader bin)
|
||||
{
|
||||
X.FromBinaryStream(bin);
|
||||
Y.FromBinaryStream(bin);
|
||||
Z.FromBinaryStream(bin);
|
||||
W.FromBinaryStream(bin);
|
||||
}
|
||||
|
||||
/// <summary>Writes the X,Y,Z and W components of this instance into a Stream.</summary>
|
||||
/// <param name="bin">A BinaryWriter instance associated with an open Stream.</param>
|
||||
public void ToBinaryStream(BinaryWriter bin)
|
||||
{
|
||||
X.ToBinaryStream(bin);
|
||||
Y.ToBinaryStream(bin);
|
||||
Z.ToBinaryStream(bin);
|
||||
W.ToBinaryStream(bin);
|
||||
}
|
||||
|
||||
#endregion Binary dump
|
||||
|
||||
#region IEquatable<Half4> Members
|
||||
|
||||
/// <summary>Returns a value indicating whether this instance is equal to a specified OpenTK.Half4 vector.</summary>
|
||||
/// <param name="other">OpenTK.Half4 to compare to this instance..</param>
|
||||
/// <returns>True, if other is equal to this instance; false otherwise.</returns>
|
||||
public bool Equals(Vector4h other)
|
||||
{
|
||||
return (this.X.Equals(other.X) && this.Y.Equals(other.Y) && this.Z.Equals(other.Z) && this.W.Equals(other.W));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ToString()
|
||||
|
||||
/// <summary>Returns a string that contains this Half4's numbers in human-legible form.</summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("({0}, {1}, {2}, {3})", X.ToString(), Y.ToString(), Z.ToString(), W.ToString());
|
||||
}
|
||||
|
||||
#endregion ToString()
|
||||
|
||||
#region BitConverter
|
||||
|
||||
/// <summary>Returns the Half4 as an array of bytes.</summary>
|
||||
/// <param name="h">The Half4 to convert.</param>
|
||||
/// <returns>The input as byte array.</returns>
|
||||
public static byte[] GetBytes(Vector4h h)
|
||||
{
|
||||
byte[] result = new byte[SizeInBytes];
|
||||
|
||||
byte[] temp = Half.GetBytes(h.X);
|
||||
result[0] = temp[0];
|
||||
result[1] = temp[1];
|
||||
temp = Half.GetBytes(h.Y);
|
||||
result[2] = temp[0];
|
||||
result[3] = temp[1];
|
||||
temp = Half.GetBytes(h.Z);
|
||||
result[4] = temp[0];
|
||||
result[5] = temp[1];
|
||||
temp = Half.GetBytes(h.W);
|
||||
result[6] = temp[0];
|
||||
result[7] = temp[1];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts an array of bytes into Half4.</summary>
|
||||
/// <param name="value">A Half4 in it's byte[] representation.</param>
|
||||
/// <param name="startIndex">The starting position within value.</param>
|
||||
/// <returns>A new Half4 instance.</returns>
|
||||
public static Vector4h FromBytes(byte[] value, int startIndex)
|
||||
{
|
||||
Vector4h h4 = new Vector4h();
|
||||
h4.X = Half.FromBytes(value, startIndex);
|
||||
h4.Y = Half.FromBytes(value, startIndex + 2);
|
||||
h4.Z = Half.FromBytes(value, startIndex + 4);
|
||||
h4.W = Half.FromBytes(value, startIndex + 6);
|
||||
return h4;
|
||||
}
|
||||
|
||||
#endregion BitConverter
|
||||
}
|
||||
}
|
||||
|
||||
// flibit Added This!!!
|
||||
#pragma warning restore 3021
|
Загрузка…
Ссылка в новой задаче