Initial commit with FNA-Template project.
commit
89074ca417
|
@ -0,0 +1,8 @@
|
|||
bin/
|
||||
obj/
|
||||
obj_core/
|
||||
*.pidb
|
||||
*.user
|
||||
*.userprefs
|
||||
*.suo
|
||||
*.vs
|
|
@ -0,0 +1,15 @@
|
|||
[submodule "lib/SDL2-CS"]
|
||||
path = lib/SDL2-CS
|
||||
url = git://github.com/flibitijibibo/SDL2-CS.git
|
||||
[submodule "lib/OpenAL-CS"]
|
||||
path = lib/OpenAL-CS
|
||||
url = git://github.com/flibitijibibo/OpenAL-CS.git
|
||||
[submodule "lib/MojoShader-CS"]
|
||||
path = lib/MojoShader-CS
|
||||
url = git://github.com/flibitijibibo/MojoShader-CS.git
|
||||
[submodule "lib/Vorbisfile-CS"]
|
||||
path = lib/Vorbisfile-CS
|
||||
url = git://github.com/flibitijibibo/Vorbisfile-CS.git
|
||||
[submodule "lib/Theorafile"]
|
||||
path = lib/Theorafile
|
||||
url = git://github.com/FNA-XNA/Theorafile.git
|
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
<PropertyGroup Condition="$(MSBuildProjectName.Contains('FNA.Core'))">
|
||||
<BaseIntermediateOutputPath>obj_core\</BaseIntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,376 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableDefaultItems>false</EnableDefaultItems>
|
||||
<AssemblyName>FNA</AssemblyName>
|
||||
<RootNamespace>Microsoft.Xna.Framework</RootNamespace>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="src\Audio\AudioCategory.cs" />
|
||||
<Compile Include="src\Audio\AudioChannels.cs" />
|
||||
<Compile Include="src\Audio\AudioDevice.cs" />
|
||||
<Compile Include="src\Audio\AudioEmitter.cs" />
|
||||
<Compile Include="src\Audio\AudioEngine.cs" />
|
||||
<Compile Include="src\Audio\AudioListener.cs" />
|
||||
<Compile Include="src\Audio\AudioStopOptions.cs" />
|
||||
<Compile Include="src\Audio\Cue.cs" />
|
||||
<Compile Include="src\Audio\CueData.cs" />
|
||||
<Compile Include="src\Audio\DynamicSoundEffectInstance.cs" />
|
||||
<Compile Include="src\Audio\InstancePlayLimitException.cs" />
|
||||
<Compile Include="src\Audio\Microphone.cs" />
|
||||
<Compile Include="src\Audio\MicrophoneState.cs" />
|
||||
<Compile Include="src\Audio\NoAudioHardwareException.cs" />
|
||||
<Compile Include="src\Audio\NoMicrophoneConnectedException.cs" />
|
||||
<Compile Include="src\Audio\RendererDetail.cs" />
|
||||
<Compile Include="src\Audio\SoundBank.cs" />
|
||||
<Compile Include="src\Audio\SoundEffect.cs" />
|
||||
<Compile Include="src\Audio\SoundEffectInstance.cs" />
|
||||
<Compile Include="src\Audio\SoundState.cs" />
|
||||
<Compile Include="src\Audio\WaveBank.cs" />
|
||||
<Compile Include="src\Audio\XACTInternal.cs" />
|
||||
<Compile Include="src\BoundingBox.cs" />
|
||||
<Compile Include="src\BoundingFrustum.cs" />
|
||||
<Compile Include="src\BoundingSphere.cs" />
|
||||
<Compile Include="src\Color.cs" />
|
||||
<Compile Include="src\ContainmentType.cs" />
|
||||
<Compile Include="src\Content\ContentExtensions.cs" />
|
||||
<Compile Include="src\Content\ContentLoadException.cs" />
|
||||
<Compile Include="src\Content\ContentManager.cs" />
|
||||
<Compile Include="src\Content\ContentReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\AlphaTestEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ArrayReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BasicEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BooleanReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BoundingBoxReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BoundingFrustumReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BoundingSphereReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ByteReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\CharReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ColorReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\CurveReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DateTimeReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DecimalReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DictionaryReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DoubleReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DualTextureEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EffectMaterialReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EnumReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EnvironmentMapEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ExternalReferenceReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\IndexBufferReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Int16Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Int32Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Int64Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ListReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\MatrixReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ModelReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\NullableReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\PlaneReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\PointReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\QuaternionReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\RayReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\RectangleReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ReflectiveReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SByteReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SingleReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SkinnedEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SongReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SoundEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SpriteFontReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\StringReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Texture2DReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Texture3DReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\TextureCubeReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\TextureReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\TimeSpanReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\UInt16Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\UInt32Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\UInt64Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Vector2Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Vector3Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Vector4Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\VertexBufferReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\VertexDeclarationReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\VideoReader.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerCollectionItemNameAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerIgnoreAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerRuntimeTypeAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerTypeVersionAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentTypeReader.cs" />
|
||||
<Compile Include="src\Content\ContentTypeReaderManager.cs" />
|
||||
<Compile Include="src\Content\LzxDecoder.cs" />
|
||||
<Compile Include="src\Content\ResourceContentManager.cs" />
|
||||
<Compile Include="src\Curve.cs" />
|
||||
<Compile Include="src\CurveContinuity.cs" />
|
||||
<Compile Include="src\CurveKey.cs" />
|
||||
<Compile Include="src\CurveKeyCollection.cs" />
|
||||
<Compile Include="src\CurveLoopType.cs" />
|
||||
<Compile Include="src\CurveTangent.cs" />
|
||||
<Compile Include="src\Design\BoundingBoxConverter.cs" />
|
||||
<Compile Include="src\Design\BoundingSphereConverter.cs" />
|
||||
<Compile Include="src\Design\ColorConverter.cs" />
|
||||
<Compile Include="src\Design\MathTypeConverter.cs" />
|
||||
<Compile Include="src\Design\MatrixConverter.cs" />
|
||||
<Compile Include="src\Design\PlaneConverter.cs" />
|
||||
<Compile Include="src\Design\PointConverter.cs" />
|
||||
<Compile Include="src\Design\QuaternionConverter.cs" />
|
||||
<Compile Include="src\Design\RayConverter.cs" />
|
||||
<Compile Include="src\Design\RectangleConverter.cs" />
|
||||
<Compile Include="src\Design\Vector2Converter.cs" />
|
||||
<Compile Include="src\Design\Vector3Converter.cs" />
|
||||
<Compile Include="src\Design\Vector4Converter.cs" />
|
||||
<Compile Include="src\DisplayOrientation.cs" />
|
||||
<Compile Include="src\DrawableGameComponent.cs" />
|
||||
<Compile Include="src\FNALoggerEXT.cs" />
|
||||
<Compile Include="src\FNAPlatform\FNAPlatform.cs" />
|
||||
<Compile Include="src\FNAPlatform\FNAWindow.cs" />
|
||||
<Compile Include="src\FNAPlatform\IALDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\IGLDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\ModernGLDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\ModernGLDevice_GL.cs" />
|
||||
<Compile Include="src\FNAPlatform\NullALDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\OpenALDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\OpenGLDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\OpenGLDevice_GL.cs" />
|
||||
<Compile Include="src\FNAPlatform\SDL2_FNAPlatform.cs" />
|
||||
<Compile Include="src\FrameworkDispatcher.cs" />
|
||||
<Compile Include="src\Game.cs" />
|
||||
<Compile Include="src\GameComponent.cs" />
|
||||
<Compile Include="src\GameComponentCollection.cs" />
|
||||
<Compile Include="src\GameComponentCollectionEventArgs.cs" />
|
||||
<Compile Include="src\GameServiceContainer.cs" />
|
||||
<Compile Include="src\GameTime.cs" />
|
||||
<Compile Include="src\GameWindow.cs" />
|
||||
<Compile Include="src\Graphics\ClearOptions.cs" />
|
||||
<Compile Include="src\Graphics\ColorWriteChannels.cs" />
|
||||
<Compile Include="src\Graphics\CubeMapFace.cs" />
|
||||
<Compile Include="src\Graphics\DepthFormat.cs" />
|
||||
<Compile Include="src\Graphics\DeviceLostException.cs" />
|
||||
<Compile Include="src\Graphics\DeviceNotResetException.cs" />
|
||||
<Compile Include="src\Graphics\DirectionalLight.cs" />
|
||||
<Compile Include="src\Graphics\DisplayMode.cs" />
|
||||
<Compile Include="src\Graphics\DisplayModeCollection.cs" />
|
||||
<Compile Include="src\Graphics\DxtUtil.cs" />
|
||||
<Compile Include="src\Graphics\Effect\Effect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectAnnotation.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectAnnotationCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectMaterial.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameter.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameterClass.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameterCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameterType.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectPass.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectPassCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectTechnique.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectTechniqueCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\IEffectFog.cs" />
|
||||
<Compile Include="src\Graphics\Effect\IEffectLights.cs" />
|
||||
<Compile Include="src\Graphics\Effect\IEffectMatrices.cs" />
|
||||
<Compile Include="src\Graphics\Effect\Resources.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\AlphaTestEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\BasicEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\DualTextureEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\EffectHelpers.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\EnvironmentMapEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\SkinnedEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\SpriteEffect.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsAdapter.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsDevice.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsDeviceStatus.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsProfile.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsResource.cs" />
|
||||
<Compile Include="src\Graphics\IGraphicsDeviceService.cs" />
|
||||
<Compile Include="src\Graphics\IRenderTarget.cs" />
|
||||
<Compile Include="src\Graphics\Model.cs" />
|
||||
<Compile Include="src\Graphics\ModelBone.cs" />
|
||||
<Compile Include="src\Graphics\ModelBoneCollection.cs" />
|
||||
<Compile Include="src\Graphics\ModelEffectCollection.cs" />
|
||||
<Compile Include="src\Graphics\ModelMesh.cs" />
|
||||
<Compile Include="src\Graphics\ModelMeshCollection.cs" />
|
||||
<Compile Include="src\Graphics\ModelMeshPart.cs" />
|
||||
<Compile Include="src\Graphics\ModelMeshPartCollection.cs" />
|
||||
<Compile Include="src\Graphics\NoSuitableGraphicsDeviceException.cs" />
|
||||
<Compile Include="src\Graphics\OcclusionQuery.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Alpha8.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Bgr565.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Bgra4444.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Bgra5551.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Byte4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfSingle.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfTypeHelper.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfVector2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfVector4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\IPackedVector.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedByte2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedByte4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedShort2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedShort4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Rg32.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Rgba64.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Rgba1010102.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Short2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Short4.cs" />
|
||||
<Compile Include="src\Graphics\PresentationParameters.cs" />
|
||||
<Compile Include="src\Graphics\PresentInterval.cs" />
|
||||
<Compile Include="src\Graphics\PrimitiveType.cs" />
|
||||
<Compile Include="src\Graphics\RenderTarget2D.cs" />
|
||||
<Compile Include="src\Graphics\RenderTargetBinding.cs" />
|
||||
<Compile Include="src\Graphics\RenderTargetCube.cs" />
|
||||
<Compile Include="src\Graphics\RenderTargetUsage.cs" />
|
||||
<Compile Include="src\Graphics\ResourceCreatedEventArgs.cs" />
|
||||
<Compile Include="src\Graphics\ResourceDestroyedEventArgs.cs" />
|
||||
<Compile Include="src\Graphics\SamplerStateCollection.cs" />
|
||||
<Compile Include="src\Graphics\SetDataOptions.cs" />
|
||||
<Compile Include="src\Graphics\SpriteBatch.cs" />
|
||||
<Compile Include="src\Graphics\SpriteEffects.cs" />
|
||||
<Compile Include="src\Graphics\SpriteFont.cs" />
|
||||
<Compile Include="src\Graphics\SpriteSortMode.cs" />
|
||||
<Compile Include="src\Graphics\States\Blend.cs" />
|
||||
<Compile Include="src\Graphics\States\BlendFunction.cs" />
|
||||
<Compile Include="src\Graphics\States\BlendState.cs" />
|
||||
<Compile Include="src\Graphics\States\CompareFunction.cs" />
|
||||
<Compile Include="src\Graphics\States\CullMode.cs" />
|
||||
<Compile Include="src\Graphics\States\DepthStencilState.cs" />
|
||||
<Compile Include="src\Graphics\States\FillMode.cs" />
|
||||
<Compile Include="src\Graphics\States\RasterizerState.cs" />
|
||||
<Compile Include="src\Graphics\States\SamplerState.cs" />
|
||||
<Compile Include="src\Graphics\States\StencilOperation.cs" />
|
||||
<Compile Include="src\Graphics\States\TextureAddressMode.cs" />
|
||||
<Compile Include="src\Graphics\States\TextureFilter.cs" />
|
||||
<Compile Include="src\Graphics\SurfaceFormat.cs" />
|
||||
<Compile Include="src\Graphics\Texture.cs" />
|
||||
<Compile Include="src\Graphics\Texture2D.cs" />
|
||||
<Compile Include="src\Graphics\Texture3D.cs" />
|
||||
<Compile Include="src\Graphics\TextureCollection.cs" />
|
||||
<Compile Include="src\Graphics\TextureCube.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\BufferUsage.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\DynamicIndexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\DynamicVertexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\IndexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\IndexElementSize.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\IVertexType.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexBufferBinding.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexDeclaration.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexDeclarationCache.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexElement.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexElementFormat.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexElementUsage.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionColor.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionColorTexture.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionNormalTexture.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionTexture.cs" />
|
||||
<Compile Include="src\Graphics\Viewport.cs" />
|
||||
<Compile Include="src\Graphics\X360TexUtil.cs" />
|
||||
<Compile Include="src\GraphicsDeviceInformation.cs" />
|
||||
<Compile Include="src\GraphicsDeviceManager.cs" />
|
||||
<Compile Include="src\IDrawable.cs" />
|
||||
<Compile Include="src\IGameComponent.cs" />
|
||||
<Compile Include="src\IGraphicsDeviceManager.cs" />
|
||||
<Compile Include="src\Input\Buttons.cs" />
|
||||
<Compile Include="src\Input\ButtonState.cs" />
|
||||
<Compile Include="src\Input\GamePad.cs" />
|
||||
<Compile Include="src\Input\GamePadButtons.cs" />
|
||||
<Compile Include="src\Input\GamePadCapabilities.cs" />
|
||||
<Compile Include="src\Input\GamePadDeadZone.cs" />
|
||||
<Compile Include="src\Input\GamePadDPad.cs" />
|
||||
<Compile Include="src\Input\GamePadState.cs" />
|
||||
<Compile Include="src\Input\GamePadThumbSticks.cs" />
|
||||
<Compile Include="src\Input\GamePadTriggers.cs" />
|
||||
<Compile Include="src\Input\GamePadType.cs" />
|
||||
<Compile Include="src\Input\Keyboard.cs" />
|
||||
<Compile Include="src\Input\KeyboardState.cs" />
|
||||
<Compile Include="src\Input\Keys.cs" />
|
||||
<Compile Include="src\Input\KeyState.cs" />
|
||||
<Compile Include="src\Input\Mouse.cs" />
|
||||
<Compile Include="src\Input\MouseState.cs" />
|
||||
<Compile Include="src\Input\TextInputEXT.cs" />
|
||||
<Compile Include="src\Input\Touch\GestureSample.cs" />
|
||||
<Compile Include="src\Input\Touch\GestureType.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchCollection.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchLocation.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchLocationState.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchPanel.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchPanelCapabilities.cs" />
|
||||
<Compile Include="src\IUpdateable.cs" />
|
||||
<Compile Include="src\LaunchParameters.cs" />
|
||||
<Compile Include="src\MathHelper.cs" />
|
||||
<Compile Include="src\Matrix.cs" />
|
||||
<Compile Include="src\Media\MediaPlayer.cs" />
|
||||
<Compile Include="src\Media\MediaQueue.cs" />
|
||||
<Compile Include="src\Media\MediaState.cs" />
|
||||
<Compile Include="src\Media\SongCollection.cs" />
|
||||
<Compile Include="src\Media\VideoSoundtrackType.cs" />
|
||||
<Compile Include="src\Media\VisualizationData.cs" />
|
||||
<Compile Include="src\Media\Xiph\Song.cs" />
|
||||
<Compile Include="src\Media\Xiph\Video.cs" />
|
||||
<Compile Include="src\Media\Xiph\VideoPlayer.cs" />
|
||||
<Compile Include="src\NamespaceDocs.cs" />
|
||||
<Compile Include="src\Plane.cs" />
|
||||
<Compile Include="src\PlaneIntersectionType.cs" />
|
||||
<Compile Include="src\PlayerIndex.cs" />
|
||||
<Compile Include="src\Point.cs" />
|
||||
<Compile Include="src\PreparingDeviceSettingsEventArgs.cs" />
|
||||
<Compile Include="src\Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="src\Quaternion.cs" />
|
||||
<Compile Include="src\Ray.cs" />
|
||||
<Compile Include="src\Rectangle.cs" />
|
||||
<Compile Include="src\Storage\StorageContainer.cs" />
|
||||
<Compile Include="src\Storage\StorageDevice.cs" />
|
||||
<Compile Include="src\Storage\StorageDeviceNotConnectedException.cs" />
|
||||
<Compile Include="src\TitleContainer.cs" />
|
||||
<Compile Include="src\TitleLocation.cs" />
|
||||
<Compile Include="src\Utilities\AssemblyHelper.cs" />
|
||||
<Compile Include="src\Utilities\FileHelpers.cs" />
|
||||
<Compile Include="src\Utilities\FNAInternalExtensions.cs" />
|
||||
<Compile Include="src\Vector2.cs" />
|
||||
<Compile Include="src\Vector3.cs" />
|
||||
<Compile Include="src\Vector4.cs" />
|
||||
<Compile Include="lib\SDL2-CS\src\SDL2.cs" />
|
||||
<Compile Include="lib\SDL2-CS\src\SDL2_image.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\ALC10.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\ALC11.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\AL10.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\AL11.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\ALEXT.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\EFX.cs" />
|
||||
<Compile Include="lib\MojoShader-CS\MojoShader.cs" />
|
||||
<Compile Include="lib\Vorbisfile-CS\Vorbisfile.cs" />
|
||||
<Compile Include="lib\Theorafile\csharp\Theorafile.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="FNA.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\AlphaTestEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.AlphaTestEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\BasicEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.BasicEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\DualTextureEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.DualTextureEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\EnvironmentMapEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.EnvironmentMapEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\SkinnedEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.SkinnedEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\SpriteEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.SpriteEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\YUVToRGBA\YUVToRGBAEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.YUVToRGBAEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,444 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{35253CE1-C864-4CD3-8249-4D1319748E8F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Microsoft.Xna.Framework</RootNamespace>
|
||||
<AssemblyName>FNA</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="src\Audio\AudioCategory.cs" />
|
||||
<Compile Include="src\Audio\AudioChannels.cs" />
|
||||
<Compile Include="src\Audio\AudioDevice.cs" />
|
||||
<Compile Include="src\Audio\AudioEmitter.cs" />
|
||||
<Compile Include="src\Audio\AudioEngine.cs" />
|
||||
<Compile Include="src\Audio\AudioListener.cs" />
|
||||
<Compile Include="src\Audio\AudioStopOptions.cs" />
|
||||
<Compile Include="src\Audio\Cue.cs" />
|
||||
<Compile Include="src\Audio\CueData.cs" />
|
||||
<Compile Include="src\Audio\DynamicSoundEffectInstance.cs" />
|
||||
<Compile Include="src\Audio\InstancePlayLimitException.cs" />
|
||||
<Compile Include="src\Audio\Microphone.cs" />
|
||||
<Compile Include="src\Audio\MicrophoneState.cs" />
|
||||
<Compile Include="src\Audio\NoAudioHardwareException.cs" />
|
||||
<Compile Include="src\Audio\NoMicrophoneConnectedException.cs" />
|
||||
<Compile Include="src\Audio\RendererDetail.cs" />
|
||||
<Compile Include="src\Audio\SoundBank.cs" />
|
||||
<Compile Include="src\Audio\SoundEffect.cs" />
|
||||
<Compile Include="src\Audio\SoundEffectInstance.cs" />
|
||||
<Compile Include="src\Audio\SoundState.cs" />
|
||||
<Compile Include="src\Audio\WaveBank.cs" />
|
||||
<Compile Include="src\Audio\XACTInternal.cs" />
|
||||
<Compile Include="src\BoundingBox.cs" />
|
||||
<Compile Include="src\BoundingFrustum.cs" />
|
||||
<Compile Include="src\BoundingSphere.cs" />
|
||||
<Compile Include="src\Color.cs" />
|
||||
<Compile Include="src\ContainmentType.cs" />
|
||||
<Compile Include="src\Content\ContentExtensions.cs" />
|
||||
<Compile Include="src\Content\ContentLoadException.cs" />
|
||||
<Compile Include="src\Content\ContentManager.cs" />
|
||||
<Compile Include="src\Content\ContentReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\AlphaTestEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ArrayReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BasicEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BooleanReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BoundingBoxReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BoundingFrustumReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\BoundingSphereReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ByteReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\CharReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ColorReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\CurveReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DateTimeReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DecimalReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DictionaryReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DoubleReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\DualTextureEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EffectMaterialReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EnumReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\EnvironmentMapEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ExternalReferenceReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\IndexBufferReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Int16Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Int32Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Int64Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ListReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\MatrixReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ModelReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\NullableReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\PlaneReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\PointReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\QuaternionReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\RayReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\RectangleReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\ReflectiveReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SByteReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SingleReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SkinnedEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SongReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SoundEffectReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\SpriteFontReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\StringReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Texture2DReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Texture3DReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\TextureCubeReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\TextureReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\TimeSpanReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\UInt16Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\UInt32Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\UInt64Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Vector2Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Vector3Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\Vector4Reader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\VertexBufferReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\VertexDeclarationReader.cs" />
|
||||
<Compile Include="src\Content\ContentReaders\VideoReader.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerCollectionItemNameAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerIgnoreAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerRuntimeTypeAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentSerializerTypeVersionAttribute.cs" />
|
||||
<Compile Include="src\Content\ContentTypeReader.cs" />
|
||||
<Compile Include="src\Content\ContentTypeReaderManager.cs" />
|
||||
<Compile Include="src\Content\LzxDecoder.cs" />
|
||||
<Compile Include="src\Content\ResourceContentManager.cs" />
|
||||
<Compile Include="src\Curve.cs" />
|
||||
<Compile Include="src\CurveContinuity.cs" />
|
||||
<Compile Include="src\CurveKey.cs" />
|
||||
<Compile Include="src\CurveKeyCollection.cs" />
|
||||
<Compile Include="src\CurveLoopType.cs" />
|
||||
<Compile Include="src\CurveTangent.cs" />
|
||||
<Compile Include="src\Design\BoundingBoxConverter.cs" />
|
||||
<Compile Include="src\Design\BoundingSphereConverter.cs" />
|
||||
<Compile Include="src\Design\ColorConverter.cs" />
|
||||
<Compile Include="src\Design\MathTypeConverter.cs" />
|
||||
<Compile Include="src\Design\MatrixConverter.cs" />
|
||||
<Compile Include="src\Design\PlaneConverter.cs" />
|
||||
<Compile Include="src\Design\PointConverter.cs" />
|
||||
<Compile Include="src\Design\QuaternionConverter.cs" />
|
||||
<Compile Include="src\Design\RayConverter.cs" />
|
||||
<Compile Include="src\Design\RectangleConverter.cs" />
|
||||
<Compile Include="src\Design\Vector2Converter.cs" />
|
||||
<Compile Include="src\Design\Vector3Converter.cs" />
|
||||
<Compile Include="src\Design\Vector4Converter.cs" />
|
||||
<Compile Include="src\DisplayOrientation.cs" />
|
||||
<Compile Include="src\DrawableGameComponent.cs" />
|
||||
<Compile Include="src\FNALoggerEXT.cs" />
|
||||
<Compile Include="src\FNAPlatform\FNAPlatform.cs" />
|
||||
<Compile Include="src\FNAPlatform\FNAWindow.cs" />
|
||||
<Compile Include="src\FNAPlatform\IALDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\IGLDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\ModernGLDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\ModernGLDevice_GL.cs" />
|
||||
<Compile Include="src\FNAPlatform\NullALDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\OpenALDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\OpenGLDevice.cs" />
|
||||
<Compile Include="src\FNAPlatform\OpenGLDevice_GL.cs" />
|
||||
<Compile Include="src\FNAPlatform\SDL2_FNAPlatform.cs" />
|
||||
<Compile Include="src\FrameworkDispatcher.cs" />
|
||||
<Compile Include="src\Game.cs" />
|
||||
<Compile Include="src\GameComponent.cs" />
|
||||
<Compile Include="src\GameComponentCollection.cs" />
|
||||
<Compile Include="src\GameComponentCollectionEventArgs.cs" />
|
||||
<Compile Include="src\GameServiceContainer.cs" />
|
||||
<Compile Include="src\GameTime.cs" />
|
||||
<Compile Include="src\GameWindow.cs" />
|
||||
<Compile Include="src\Graphics\ClearOptions.cs" />
|
||||
<Compile Include="src\Graphics\ColorWriteChannels.cs" />
|
||||
<Compile Include="src\Graphics\CubeMapFace.cs" />
|
||||
<Compile Include="src\Graphics\DepthFormat.cs" />
|
||||
<Compile Include="src\Graphics\DeviceLostException.cs" />
|
||||
<Compile Include="src\Graphics\DeviceNotResetException.cs" />
|
||||
<Compile Include="src\Graphics\DirectionalLight.cs" />
|
||||
<Compile Include="src\Graphics\DisplayMode.cs" />
|
||||
<Compile Include="src\Graphics\DisplayModeCollection.cs" />
|
||||
<Compile Include="src\Graphics\DxtUtil.cs" />
|
||||
<Compile Include="src\Graphics\Effect\Effect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectAnnotation.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectAnnotationCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectMaterial.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameter.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameterClass.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameterCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectParameterType.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectPass.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectPassCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectTechnique.cs" />
|
||||
<Compile Include="src\Graphics\Effect\EffectTechniqueCollection.cs" />
|
||||
<Compile Include="src\Graphics\Effect\IEffectFog.cs" />
|
||||
<Compile Include="src\Graphics\Effect\IEffectLights.cs" />
|
||||
<Compile Include="src\Graphics\Effect\IEffectMatrices.cs" />
|
||||
<Compile Include="src\Graphics\Effect\Resources.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\AlphaTestEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\BasicEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\DualTextureEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\EffectHelpers.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\EnvironmentMapEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\SkinnedEffect.cs" />
|
||||
<Compile Include="src\Graphics\Effect\StockEffects\SpriteEffect.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsAdapter.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsDevice.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsDeviceStatus.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsProfile.cs" />
|
||||
<Compile Include="src\Graphics\GraphicsResource.cs" />
|
||||
<Compile Include="src\Graphics\IGraphicsDeviceService.cs" />
|
||||
<Compile Include="src\Graphics\IRenderTarget.cs" />
|
||||
<Compile Include="src\Graphics\Model.cs" />
|
||||
<Compile Include="src\Graphics\ModelBone.cs" />
|
||||
<Compile Include="src\Graphics\ModelBoneCollection.cs" />
|
||||
<Compile Include="src\Graphics\ModelEffectCollection.cs" />
|
||||
<Compile Include="src\Graphics\ModelMesh.cs" />
|
||||
<Compile Include="src\Graphics\ModelMeshCollection.cs" />
|
||||
<Compile Include="src\Graphics\ModelMeshPart.cs" />
|
||||
<Compile Include="src\Graphics\ModelMeshPartCollection.cs" />
|
||||
<Compile Include="src\Graphics\NoSuitableGraphicsDeviceException.cs" />
|
||||
<Compile Include="src\Graphics\OcclusionQuery.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Alpha8.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Bgr565.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Bgra4444.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Bgra5551.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Byte4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfSingle.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfTypeHelper.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfVector2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\HalfVector4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\IPackedVector.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedByte2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedByte4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedShort2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\NormalizedShort4.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Rg32.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Rgba64.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Rgba1010102.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Short2.cs" />
|
||||
<Compile Include="src\Graphics\PackedVector\Short4.cs" />
|
||||
<Compile Include="src\Graphics\PresentationParameters.cs" />
|
||||
<Compile Include="src\Graphics\PresentInterval.cs" />
|
||||
<Compile Include="src\Graphics\PrimitiveType.cs" />
|
||||
<Compile Include="src\Graphics\RenderTarget2D.cs" />
|
||||
<Compile Include="src\Graphics\RenderTargetBinding.cs" />
|
||||
<Compile Include="src\Graphics\RenderTargetCube.cs" />
|
||||
<Compile Include="src\Graphics\RenderTargetUsage.cs" />
|
||||
<Compile Include="src\Graphics\ResourceCreatedEventArgs.cs" />
|
||||
<Compile Include="src\Graphics\ResourceDestroyedEventArgs.cs" />
|
||||
<Compile Include="src\Graphics\SamplerStateCollection.cs" />
|
||||
<Compile Include="src\Graphics\SetDataOptions.cs" />
|
||||
<Compile Include="src\Graphics\SpriteBatch.cs" />
|
||||
<Compile Include="src\Graphics\SpriteEffects.cs" />
|
||||
<Compile Include="src\Graphics\SpriteFont.cs" />
|
||||
<Compile Include="src\Graphics\SpriteSortMode.cs" />
|
||||
<Compile Include="src\Graphics\States\Blend.cs" />
|
||||
<Compile Include="src\Graphics\States\BlendFunction.cs" />
|
||||
<Compile Include="src\Graphics\States\BlendState.cs" />
|
||||
<Compile Include="src\Graphics\States\CompareFunction.cs" />
|
||||
<Compile Include="src\Graphics\States\CullMode.cs" />
|
||||
<Compile Include="src\Graphics\States\DepthStencilState.cs" />
|
||||
<Compile Include="src\Graphics\States\FillMode.cs" />
|
||||
<Compile Include="src\Graphics\States\RasterizerState.cs" />
|
||||
<Compile Include="src\Graphics\States\SamplerState.cs" />
|
||||
<Compile Include="src\Graphics\States\StencilOperation.cs" />
|
||||
<Compile Include="src\Graphics\States\TextureAddressMode.cs" />
|
||||
<Compile Include="src\Graphics\States\TextureFilter.cs" />
|
||||
<Compile Include="src\Graphics\SurfaceFormat.cs" />
|
||||
<Compile Include="src\Graphics\Texture.cs" />
|
||||
<Compile Include="src\Graphics\Texture2D.cs" />
|
||||
<Compile Include="src\Graphics\Texture3D.cs" />
|
||||
<Compile Include="src\Graphics\TextureCollection.cs" />
|
||||
<Compile Include="src\Graphics\TextureCube.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\BufferUsage.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\DynamicIndexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\DynamicVertexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\IndexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\IndexElementSize.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\IVertexType.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexBuffer.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexBufferBinding.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexDeclaration.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexDeclarationCache.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexElement.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexElementFormat.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexElementUsage.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionColor.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionColorTexture.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionNormalTexture.cs" />
|
||||
<Compile Include="src\Graphics\Vertices\VertexPositionTexture.cs" />
|
||||
<Compile Include="src\Graphics\Viewport.cs" />
|
||||
<Compile Include="src\Graphics\X360TexUtil.cs" />
|
||||
<Compile Include="src\GraphicsDeviceInformation.cs" />
|
||||
<Compile Include="src\GraphicsDeviceManager.cs" />
|
||||
<Compile Include="src\IDrawable.cs" />
|
||||
<Compile Include="src\IGameComponent.cs" />
|
||||
<Compile Include="src\IGraphicsDeviceManager.cs" />
|
||||
<Compile Include="src\Input\Buttons.cs" />
|
||||
<Compile Include="src\Input\ButtonState.cs" />
|
||||
<Compile Include="src\Input\GamePad.cs" />
|
||||
<Compile Include="src\Input\GamePadButtons.cs" />
|
||||
<Compile Include="src\Input\GamePadCapabilities.cs" />
|
||||
<Compile Include="src\Input\GamePadDeadZone.cs" />
|
||||
<Compile Include="src\Input\GamePadDPad.cs" />
|
||||
<Compile Include="src\Input\GamePadState.cs" />
|
||||
<Compile Include="src\Input\GamePadThumbSticks.cs" />
|
||||
<Compile Include="src\Input\GamePadTriggers.cs" />
|
||||
<Compile Include="src\Input\GamePadType.cs" />
|
||||
<Compile Include="src\Input\Keyboard.cs" />
|
||||
<Compile Include="src\Input\KeyboardState.cs" />
|
||||
<Compile Include="src\Input\Keys.cs" />
|
||||
<Compile Include="src\Input\KeyState.cs" />
|
||||
<Compile Include="src\Input\Mouse.cs" />
|
||||
<Compile Include="src\Input\MouseState.cs" />
|
||||
<Compile Include="src\Input\TextInputEXT.cs" />
|
||||
<Compile Include="src\Input\Touch\GestureSample.cs" />
|
||||
<Compile Include="src\Input\Touch\GestureType.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchCollection.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchLocation.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchLocationState.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchPanel.cs" />
|
||||
<Compile Include="src\Input\Touch\TouchPanelCapabilities.cs" />
|
||||
<Compile Include="src\IUpdateable.cs" />
|
||||
<Compile Include="src\LaunchParameters.cs" />
|
||||
<Compile Include="src\MathHelper.cs" />
|
||||
<Compile Include="src\Matrix.cs" />
|
||||
<Compile Include="src\Media\MediaPlayer.cs" />
|
||||
<Compile Include="src\Media\MediaQueue.cs" />
|
||||
<Compile Include="src\Media\MediaState.cs" />
|
||||
<Compile Include="src\Media\SongCollection.cs" />
|
||||
<Compile Include="src\Media\VideoSoundtrackType.cs" />
|
||||
<Compile Include="src\Media\VisualizationData.cs" />
|
||||
<Compile Include="src\Media\Xiph\Song.cs" />
|
||||
<Compile Include="src\Media\Xiph\Video.cs" />
|
||||
<Compile Include="src\Media\Xiph\VideoPlayer.cs" />
|
||||
<Compile Include="src\NamespaceDocs.cs" />
|
||||
<Compile Include="src\Plane.cs" />
|
||||
<Compile Include="src\PlaneIntersectionType.cs" />
|
||||
<Compile Include="src\PlayerIndex.cs" />
|
||||
<Compile Include="src\Point.cs" />
|
||||
<Compile Include="src\PreparingDeviceSettingsEventArgs.cs" />
|
||||
<Compile Include="src\Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="src\Quaternion.cs" />
|
||||
<Compile Include="src\Ray.cs" />
|
||||
<Compile Include="src\Rectangle.cs" />
|
||||
<Compile Include="src\Storage\StorageContainer.cs" />
|
||||
<Compile Include="src\Storage\StorageDevice.cs" />
|
||||
<Compile Include="src\Storage\StorageDeviceNotConnectedException.cs" />
|
||||
<Compile Include="src\TitleContainer.cs" />
|
||||
<Compile Include="src\TitleLocation.cs" />
|
||||
<Compile Include="src\Utilities\AssemblyHelper.cs" />
|
||||
<Compile Include="src\Utilities\FileHelpers.cs" />
|
||||
<Compile Include="src\Utilities\FNAInternalExtensions.cs" />
|
||||
<Compile Include="src\Vector2.cs" />
|
||||
<Compile Include="src\Vector3.cs" />
|
||||
<Compile Include="src\Vector4.cs" />
|
||||
<Compile Include="lib\SDL2-CS\src\SDL2.cs" />
|
||||
<Compile Include="lib\SDL2-CS\src\SDL2_image.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\ALC10.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\ALC11.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\AL10.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\AL11.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\ALEXT.cs" />
|
||||
<Compile Include="lib\OpenAL-CS\src\EFX.cs" />
|
||||
<Compile Include="lib\MojoShader-CS\MojoShader.cs" />
|
||||
<Compile Include="lib\Vorbisfile-CS\Vorbisfile.cs" />
|
||||
<Compile Include="lib\Theorafile\csharp\Theorafile.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="FNA.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\AlphaTestEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.AlphaTestEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\BasicEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.BasicEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\DualTextureEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.DualTextureEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\EnvironmentMapEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.EnvironmentMapEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\SkinnedEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.SkinnedEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\StockEffects\FXB\SpriteEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.SpriteEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="src\Graphics\Effect\YUVToRGBA\YUVToRGBAEffect.fxb">
|
||||
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.YUVToRGBAEffect.fxb</LogicalName>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<dllmap dll="SDL2.dll" os="windows" target="SDL2.dll"/>
|
||||
<dllmap dll="SDL2.dll" os="osx" target="libSDL2-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2.dll" os="linux,freebsd,netbsd" target="libSDL2-2.0.so.0"/>
|
||||
<dllmap dll="SDL2.dll" os="openbsd" target="libSDL2.so.0"/>
|
||||
|
||||
<dllmap dll="SDL2_image.dll" os="windows" target="SDL2_image.dll"/>
|
||||
<dllmap dll="SDL2_image.dll" os="osx" target="libSDL2_image-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_image.dll" os="linux,freebsd,netbsd" target="libSDL2_image-2.0.so.0"/>
|
||||
<dllmap dll="SDL2_image.dll" os="openbsd" target="libSDL2_image.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,freebsd,netbsd" target="libopenal.so.1"/>
|
||||
<dllmap dll="soft_oal.dll" os="openbsd" target="libopenal.so"/>
|
||||
|
||||
<dllmap dll="MojoShader.dll" os="windows" target="MojoShader.dll"/>
|
||||
<dllmap dll="MojoShader.dll" os="osx" target="libmojoshader.dylib"/>
|
||||
<dllmap dll="MojoShader.dll" os="linux,freebsd,openbsd,netbsd" target="libmojoshader.so"/>
|
||||
|
||||
<dllmap dll="libvorbisfile.dll" os="windows" target="libvorbisfile.dll"/>
|
||||
<dllmap dll="libvorbisfile.dll" os="osx" target="libvorbisfile.3.dylib"/>
|
||||
<dllmap dll="libvorbisfile.dll" os="linux,freebsd,netbsd" target="libvorbisfile.so.3"/>
|
||||
<dllmap dll="libvorbisfile.dll" os="openbsd" target="libvorbisfile.so"/>
|
||||
|
||||
<dllmap dll="libtheorafile.dll" os="windows" target="libtheorafile.dll"/>
|
||||
<dllmap dll="libtheorafile.dll" os="osx" target="libtheorafile.dylib"/>
|
||||
<dllmap dll="libtheorafile.dll" os="linux,freebsd,openbsd,netbsd" target="libtheorafile.so"/>
|
||||
</configuration>
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
Debug|AnyCPU = Debug|AnyCPU
|
||||
Release|AnyCPU = Release|AnyCPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.Build.0 = Debug|x86
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.ActiveCfg = Release|x86
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.Build.0 = Release|x86
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x64.Build.0 = Debug|x64
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x64.ActiveCfg = Release|x64
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x64.Build.0 = Release|x64
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
|
||||
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|AnyCPU.Build.0 = Release|AnyCPU
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = FNA.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,372 @@
|
|||
# Makefile for FNA
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
# Source Lists
|
||||
SRC = \
|
||||
src/Audio/AudioCategory.cs \
|
||||
src/Audio/AudioChannels.cs \
|
||||
src/Audio/AudioDevice.cs \
|
||||
src/Audio/AudioEmitter.cs \
|
||||
src/Audio/AudioEngine.cs \
|
||||
src/Audio/AudioListener.cs \
|
||||
src/Audio/AudioStopOptions.cs \
|
||||
src/Audio/Cue.cs \
|
||||
src/Audio/CueData.cs \
|
||||
src/Audio/DynamicSoundEffectInstance.cs \
|
||||
src/Audio/InstancePlayLimitException.cs \
|
||||
src/Audio/Microphone.cs \
|
||||
src/Audio/MicrophoneState.cs \
|
||||
src/Audio/NoAudioHardwareException.cs \
|
||||
src/Audio/NoMicrophoneConnectedException.cs \
|
||||
src/Audio/RendererDetail.cs \
|
||||
src/Audio/SoundBank.cs \
|
||||
src/Audio/SoundEffect.cs \
|
||||
src/Audio/SoundEffectInstance.cs \
|
||||
src/Audio/SoundState.cs \
|
||||
src/Audio/WaveBank.cs \
|
||||
src/Audio/XACTInternal.cs \
|
||||
src/BoundingBox.cs \
|
||||
src/BoundingFrustum.cs \
|
||||
src/BoundingSphere.cs \
|
||||
src/Color.cs \
|
||||
src/ContainmentType.cs \
|
||||
src/Content/ContentExtensions.cs \
|
||||
src/Content/ContentLoadException.cs \
|
||||
src/Content/ContentManager.cs \
|
||||
src/Content/ContentReader.cs \
|
||||
src/Content/ContentReaders/AlphaTestEffectReader.cs \
|
||||
src/Content/ContentReaders/ArrayReader.cs \
|
||||
src/Content/ContentReaders/BasicEffectReader.cs \
|
||||
src/Content/ContentReaders/BooleanReader.cs \
|
||||
src/Content/ContentReaders/BoundingBoxReader.cs \
|
||||
src/Content/ContentReaders/BoundingFrustumReader.cs \
|
||||
src/Content/ContentReaders/BoundingSphereReader.cs \
|
||||
src/Content/ContentReaders/ByteReader.cs \
|
||||
src/Content/ContentReaders/CharReader.cs \
|
||||
src/Content/ContentReaders/ColorReader.cs \
|
||||
src/Content/ContentReaders/CurveReader.cs \
|
||||
src/Content/ContentReaders/DateTimeReader.cs \
|
||||
src/Content/ContentReaders/DecimalReader.cs \
|
||||
src/Content/ContentReaders/DictionaryReader.cs \
|
||||
src/Content/ContentReaders/DoubleReader.cs \
|
||||
src/Content/ContentReaders/DualTextureEffectReader.cs \
|
||||
src/Content/ContentReaders/EffectMaterialReader.cs \
|
||||
src/Content/ContentReaders/EffectReader.cs \
|
||||
src/Content/ContentReaders/EnumReader.cs \
|
||||
src/Content/ContentReaders/EnvironmentMapEffectReader.cs \
|
||||
src/Content/ContentReaders/ExternalReferenceReader.cs \
|
||||
src/Content/ContentReaders/IndexBufferReader.cs \
|
||||
src/Content/ContentReaders/Int16Reader.cs \
|
||||
src/Content/ContentReaders/Int32Reader.cs \
|
||||
src/Content/ContentReaders/Int64Reader.cs \
|
||||
src/Content/ContentReaders/ListReader.cs \
|
||||
src/Content/ContentReaders/MatrixReader.cs \
|
||||
src/Content/ContentReaders/ModelReader.cs \
|
||||
src/Content/ContentReaders/NullableReader.cs \
|
||||
src/Content/ContentReaders/PlaneReader.cs \
|
||||
src/Content/ContentReaders/PointReader.cs \
|
||||
src/Content/ContentReaders/QuaternionReader.cs \
|
||||
src/Content/ContentReaders/RayReader.cs \
|
||||
src/Content/ContentReaders/RectangleReader.cs \
|
||||
src/Content/ContentReaders/ReflectiveReader.cs \
|
||||
src/Content/ContentReaders/SByteReader.cs \
|
||||
src/Content/ContentReaders/SingleReader.cs \
|
||||
src/Content/ContentReaders/SkinnedEffectReader.cs \
|
||||
src/Content/ContentReaders/SongReader.cs \
|
||||
src/Content/ContentReaders/SoundEffectReader.cs \
|
||||
src/Content/ContentReaders/SpriteFontReader.cs \
|
||||
src/Content/ContentReaders/StringReader.cs \
|
||||
src/Content/ContentReaders/Texture2DReader.cs \
|
||||
src/Content/ContentReaders/Texture3DReader.cs \
|
||||
src/Content/ContentReaders/TextureCubeReader.cs \
|
||||
src/Content/ContentReaders/TextureReader.cs \
|
||||
src/Content/ContentReaders/TimeSpanReader.cs \
|
||||
src/Content/ContentReaders/UInt16Reader.cs \
|
||||
src/Content/ContentReaders/UInt32Reader.cs \
|
||||
src/Content/ContentReaders/UInt64Reader.cs \
|
||||
src/Content/ContentReaders/Vector2Reader.cs \
|
||||
src/Content/ContentReaders/Vector3Reader.cs \
|
||||
src/Content/ContentReaders/Vector4Reader.cs \
|
||||
src/Content/ContentReaders/VertexBufferReader.cs \
|
||||
src/Content/ContentReaders/VertexDeclarationReader.cs \
|
||||
src/Content/ContentReaders/VideoReader.cs \
|
||||
src/Content/ContentSerializerAttribute.cs \
|
||||
src/Content/ContentSerializerCollectionItemNameAttribute.cs \
|
||||
src/Content/ContentSerializerIgnoreAttribute.cs \
|
||||
src/Content/ContentSerializerRuntimeTypeAttribute.cs \
|
||||
src/Content/ContentSerializerTypeVersionAttribute.cs \
|
||||
src/Content/ContentTypeReader.cs \
|
||||
src/Content/ContentTypeReaderManager.cs \
|
||||
src/Content/LzxDecoder.cs \
|
||||
src/Content/ResourceContentManager.cs \
|
||||
src/Curve.cs \
|
||||
src/CurveContinuity.cs \
|
||||
src/CurveKey.cs \
|
||||
src/CurveKeyCollection.cs \
|
||||
src/CurveLoopType.cs \
|
||||
src/CurveTangent.cs \
|
||||
src/Design/BoundingBoxConverter.cs \
|
||||
src/Design/BoundingSphereConverter.cs \
|
||||
src/Design/ColorConverter.cs \
|
||||
src/Design/MathTypeConverter.cs \
|
||||
src/Design/MatrixConverter.cs \
|
||||
src/Design/PlaneConverter.cs \
|
||||
src/Design/PointConverter.cs \
|
||||
src/Design/QuaternionConverter.cs \
|
||||
src/Design/RayConverter.cs \
|
||||
src/Design/RectangleConverter.cs \
|
||||
src/Design/Vector2Converter.cs \
|
||||
src/Design/Vector3Converter.cs \
|
||||
src/Design/Vector4Converter.cs \
|
||||
src/DisplayOrientation.cs \
|
||||
src/DrawableGameComponent.cs \
|
||||
src/FNALoggerEXT.cs \
|
||||
src/FNAPlatform/FNAPlatform.cs \
|
||||
src/FNAPlatform/FNAWindow.cs \
|
||||
src/FNAPlatform/IALDevice.cs \
|
||||
src/FNAPlatform/IGLDevice.cs \
|
||||
src/FNAPlatform/ModernGLDevice.cs \
|
||||
src/FNAPlatform/ModernGLDevice_GL.cs \
|
||||
src/FNAPlatform/NullALDevice.cs \
|
||||
src/FNAPlatform/OpenALDevice.cs \
|
||||
src/FNAPlatform/OpenGLDevice.cs \
|
||||
src/FNAPlatform/OpenGLDevice_GL.cs \
|
||||
src/FNAPlatform/SDL2_FNAPlatform.cs \
|
||||
src/FrameworkDispatcher.cs \
|
||||
src/Game.cs \
|
||||
src/GameComponent.cs \
|
||||
src/GameComponentCollection.cs \
|
||||
src/GameComponentCollectionEventArgs.cs \
|
||||
src/GameServiceContainer.cs \
|
||||
src/GameTime.cs \
|
||||
src/GameWindow.cs \
|
||||
src/Graphics/ClearOptions.cs \
|
||||
src/Graphics/ColorWriteChannels.cs \
|
||||
src/Graphics/CubeMapFace.cs \
|
||||
src/Graphics/DepthFormat.cs \
|
||||
src/Graphics/DeviceLostException.cs \
|
||||
src/Graphics/DeviceNotResetException.cs \
|
||||
src/Graphics/DirectionalLight.cs \
|
||||
src/Graphics/DisplayMode.cs \
|
||||
src/Graphics/DisplayModeCollection.cs \
|
||||
src/Graphics/DxtUtil.cs \
|
||||
src/Graphics/Effect/Effect.cs \
|
||||
src/Graphics/Effect/EffectAnnotation.cs \
|
||||
src/Graphics/Effect/EffectAnnotationCollection.cs \
|
||||
src/Graphics/Effect/EffectMaterial.cs \
|
||||
src/Graphics/Effect/EffectParameter.cs \
|
||||
src/Graphics/Effect/EffectParameterClass.cs \
|
||||
src/Graphics/Effect/EffectParameterCollection.cs \
|
||||
src/Graphics/Effect/EffectParameterType.cs \
|
||||
src/Graphics/Effect/EffectPass.cs \
|
||||
src/Graphics/Effect/EffectPassCollection.cs \
|
||||
src/Graphics/Effect/EffectTechnique.cs \
|
||||
src/Graphics/Effect/EffectTechniqueCollection.cs \
|
||||
src/Graphics/Effect/IEffectFog.cs \
|
||||
src/Graphics/Effect/IEffectLights.cs \
|
||||
src/Graphics/Effect/IEffectMatrices.cs \
|
||||
src/Graphics/Effect/Resources.cs \
|
||||
src/Graphics/Effect/StockEffects/AlphaTestEffect.cs \
|
||||
src/Graphics/Effect/StockEffects/BasicEffect.cs \
|
||||
src/Graphics/Effect/StockEffects/DualTextureEffect.cs \
|
||||
src/Graphics/Effect/StockEffects/EffectHelpers.cs \
|
||||
src/Graphics/Effect/StockEffects/EnvironmentMapEffect.cs \
|
||||
src/Graphics/Effect/StockEffects/SkinnedEffect.cs \
|
||||
src/Graphics/Effect/StockEffects/SpriteEffect.cs \
|
||||
src/Graphics/GraphicsAdapter.cs \
|
||||
src/Graphics/GraphicsDevice.cs \
|
||||
src/Graphics/GraphicsDeviceStatus.cs \
|
||||
src/Graphics/GraphicsProfile.cs \
|
||||
src/Graphics/GraphicsResource.cs \
|
||||
src/Graphics/IGraphicsDeviceService.cs \
|
||||
src/Graphics/IRenderTarget.cs \
|
||||
src/Graphics/Model.cs \
|
||||
src/Graphics/ModelBone.cs \
|
||||
src/Graphics/ModelBoneCollection.cs \
|
||||
src/Graphics/ModelEffectCollection.cs \
|
||||
src/Graphics/ModelMesh.cs \
|
||||
src/Graphics/ModelMeshCollection.cs \
|
||||
src/Graphics/ModelMeshPart.cs \
|
||||
src/Graphics/ModelMeshPartCollection.cs \
|
||||
src/Graphics/NoSuitableGraphicsDeviceException.cs \
|
||||
src/Graphics/OcclusionQuery.cs \
|
||||
src/Graphics/PackedVector/Alpha8.cs \
|
||||
src/Graphics/PackedVector/Bgr565.cs \
|
||||
src/Graphics/PackedVector/Bgra4444.cs \
|
||||
src/Graphics/PackedVector/Bgra5551.cs \
|
||||
src/Graphics/PackedVector/Byte4.cs \
|
||||
src/Graphics/PackedVector/HalfSingle.cs \
|
||||
src/Graphics/PackedVector/HalfTypeHelper.cs \
|
||||
src/Graphics/PackedVector/HalfVector2.cs \
|
||||
src/Graphics/PackedVector/HalfVector4.cs \
|
||||
src/Graphics/PackedVector/IPackedVector.cs \
|
||||
src/Graphics/PackedVector/NormalizedByte2.cs \
|
||||
src/Graphics/PackedVector/NormalizedByte4.cs \
|
||||
src/Graphics/PackedVector/NormalizedShort2.cs \
|
||||
src/Graphics/PackedVector/NormalizedShort4.cs \
|
||||
src/Graphics/PackedVector/Rg32.cs \
|
||||
src/Graphics/PackedVector/Rgba64.cs \
|
||||
src/Graphics/PackedVector/Rgba1010102.cs \
|
||||
src/Graphics/PackedVector/Short2.cs \
|
||||
src/Graphics/PackedVector/Short4.cs \
|
||||
src/Graphics/PresentationParameters.cs \
|
||||
src/Graphics/PresentInterval.cs \
|
||||
src/Graphics/PrimitiveType.cs \
|
||||
src/Graphics/RenderTarget2D.cs \
|
||||
src/Graphics/RenderTargetBinding.cs \
|
||||
src/Graphics/RenderTargetCube.cs \
|
||||
src/Graphics/RenderTargetUsage.cs \
|
||||
src/Graphics/ResourceCreatedEventArgs.cs \
|
||||
src/Graphics/ResourceDestroyedEventArgs.cs \
|
||||
src/Graphics/SamplerStateCollection.cs \
|
||||
src/Graphics/SetDataOptions.cs \
|
||||
src/Graphics/SpriteBatch.cs \
|
||||
src/Graphics/SpriteEffects.cs \
|
||||
src/Graphics/SpriteFont.cs \
|
||||
src/Graphics/SpriteSortMode.cs \
|
||||
src/Graphics/States/Blend.cs \
|
||||
src/Graphics/States/BlendFunction.cs \
|
||||
src/Graphics/States/BlendState.cs \
|
||||
src/Graphics/States/CompareFunction.cs \
|
||||
src/Graphics/States/CullMode.cs \
|
||||
src/Graphics/States/DepthStencilState.cs \
|
||||
src/Graphics/States/FillMode.cs \
|
||||
src/Graphics/States/RasterizerState.cs \
|
||||
src/Graphics/States/SamplerState.cs \
|
||||
src/Graphics/States/StencilOperation.cs \
|
||||
src/Graphics/States/TextureAddressMode.cs \
|
||||
src/Graphics/States/TextureFilter.cs \
|
||||
src/Graphics/SurfaceFormat.cs \
|
||||
src/Graphics/Texture.cs \
|
||||
src/Graphics/Texture2D.cs \
|
||||
src/Graphics/Texture3D.cs \
|
||||
src/Graphics/TextureCollection.cs \
|
||||
src/Graphics/TextureCube.cs \
|
||||
src/Graphics/Vertices/BufferUsage.cs \
|
||||
src/Graphics/Vertices/DynamicIndexBuffer.cs \
|
||||
src/Graphics/Vertices/DynamicVertexBuffer.cs \
|
||||
src/Graphics/Vertices/IndexBuffer.cs \
|
||||
src/Graphics/Vertices/IndexElementSize.cs \
|
||||
src/Graphics/Vertices/IVertexType.cs \
|
||||
src/Graphics/Vertices/VertexBuffer.cs \
|
||||
src/Graphics/Vertices/VertexBufferBinding.cs \
|
||||
src/Graphics/Vertices/VertexDeclaration.cs \
|
||||
src/Graphics/Vertices/VertexDeclarationCache.cs \
|
||||
src/Graphics/Vertices/VertexElement.cs \
|
||||
src/Graphics/Vertices/VertexElementFormat.cs \
|
||||
src/Graphics/Vertices/VertexElementUsage.cs \
|
||||
src/Graphics/Vertices/VertexPositionColor.cs \
|
||||
src/Graphics/Vertices/VertexPositionColorTexture.cs \
|
||||
src/Graphics/Vertices/VertexPositionNormalTexture.cs \
|
||||
src/Graphics/Vertices/VertexPositionTexture.cs \
|
||||
src/Graphics/Viewport.cs \
|
||||
src/Graphics/X360TexUtil.cs \
|
||||
src/GraphicsDeviceInformation.cs \
|
||||
src/GraphicsDeviceManager.cs \
|
||||
src/IDrawable.cs \
|
||||
src/IGameComponent.cs \
|
||||
src/IGraphicsDeviceManager.cs \
|
||||
src/Input/Buttons.cs \
|
||||
src/Input/ButtonState.cs \
|
||||
src/Input/GamePad.cs \
|
||||
src/Input/GamePadButtons.cs \
|
||||
src/Input/GamePadCapabilities.cs \
|
||||
src/Input/GamePadDeadZone.cs \
|
||||
src/Input/GamePadDPad.cs \
|
||||
src/Input/GamePadState.cs \
|
||||
src/Input/GamePadThumbSticks.cs \
|
||||
src/Input/GamePadTriggers.cs \
|
||||
src/Input/GamePadType.cs \
|
||||
src/Input/Keyboard.cs \
|
||||
src/Input/KeyboardState.cs \
|
||||
src/Input/Keys.cs \
|
||||
src/Input/KeyState.cs \
|
||||
src/Input/Mouse.cs \
|
||||
src/Input/MouseState.cs \
|
||||
src/Input/TextInputEXT.cs \
|
||||
src/Input/Touch/GestureSample.cs \
|
||||
src/Input/Touch/GestureType.cs \
|
||||
src/Input/Touch/TouchCollection.cs \
|
||||
src/Input/Touch/TouchLocation.cs \
|
||||
src/Input/Touch/TouchLocationState.cs \
|
||||
src/Input/Touch/TouchPanel.cs \
|
||||
src/Input/Touch/TouchPanelCapabilities.cs \
|
||||
src/IUpdateable.cs \
|
||||
src/LaunchParameters.cs \
|
||||
src/MathHelper.cs \
|
||||
src/Matrix.cs \
|
||||
src/Media/MediaPlayer.cs \
|
||||
src/Media/MediaQueue.cs \
|
||||
src/Media/MediaState.cs \
|
||||
src/Media/SongCollection.cs \
|
||||
src/Media/VideoSoundtrackType.cs \
|
||||
src/Media/VisualizationData.cs \
|
||||
src/Media/Xiph/Song.cs \
|
||||
src/Media/Xiph/Video.cs \
|
||||
src/Media/Xiph/VideoPlayer.cs \
|
||||
src/NamespaceDocs.cs \
|
||||
src/Plane.cs \
|
||||
src/PlaneIntersectionType.cs \
|
||||
src/PlayerIndex.cs \
|
||||
src/Point.cs \
|
||||
src/PreparingDeviceSettingsEventArgs.cs \
|
||||
src/Properties/AssemblyInfo.cs \
|
||||
src/Quaternion.cs \
|
||||
src/Ray.cs \
|
||||
src/Rectangle.cs \
|
||||
src/Storage/StorageContainer.cs \
|
||||
src/Storage/StorageDevice.cs \
|
||||
src/Storage/StorageDeviceNotConnectedException.cs \
|
||||
src/TitleContainer.cs \
|
||||
src/TitleLocation.cs \
|
||||
src/Utilities/AssemblyHelper.cs \
|
||||
src/Utilities/FileHelpers.cs \
|
||||
src/Utilities/FNAInternalExtensions.cs \
|
||||
src/Vector2.cs \
|
||||
src/Vector3.cs \
|
||||
src/Vector4.cs \
|
||||
lib/SDL2-CS/src/SDL2.cs \
|
||||
lib/SDL2-CS/src/SDL2_image.cs \
|
||||
lib/OpenAL-CS/src/ALC10.cs \
|
||||
lib/OpenAL-CS/src/ALC11.cs \
|
||||
lib/OpenAL-CS/src/AL10.cs \
|
||||
lib/OpenAL-CS/src/AL11.cs \
|
||||
lib/OpenAL-CS/src/ALEXT.cs \
|
||||
lib/OpenAL-CS/src/EFX.cs \
|
||||
lib/MojoShader-CS/MojoShader.cs \
|
||||
lib/Vorbisfile-CS/Vorbisfile.cs \
|
||||
lib/Theorafile/csharp/Theorafile.cs
|
||||
|
||||
RESDIR = src/Graphics/Effect/StockEffects/FXB
|
||||
RESNAME = Microsoft.Xna.Framework.Graphics.Effect.Resources
|
||||
RES = \
|
||||
-resource:$(RESDIR)/AlphaTestEffect.fxb,$(RESNAME).AlphaTestEffect.fxb \
|
||||
-resource:$(RESDIR)/BasicEffect.fxb,$(RESNAME).BasicEffect.fxb \
|
||||
-resource:$(RESDIR)/DualTextureEffect.fxb,$(RESNAME).DualTextureEffect.fxb \
|
||||
-resource:$(RESDIR)/EnvironmentMapEffect.fxb,$(RESNAME).EnvironmentMapEffect.fxb \
|
||||
-resource:$(RESDIR)/SkinnedEffect.fxb,$(RESNAME).SkinnedEffect.fxb \
|
||||
-resource:$(RESDIR)/SpriteEffect.fxb,$(RESNAME).SpriteEffect.fxb \
|
||||
-resource:src/Graphics/Effect/YUVToRGBA/YUVToRGBAEffect.fxb,$(RESNAME).YUVToRGBAEffect.fxb
|
||||
|
||||
# Targets
|
||||
|
||||
debug: clean-debug
|
||||
mkdir -p bin/Debug
|
||||
cp FNA.dll.config bin/Debug
|
||||
dmcs /unsafe -debug -define:DEBUG -out:bin/Debug/FNA.dll -target:library $(SRC) $(RES)
|
||||
|
||||
clean-debug:
|
||||
rm -rf bin/Debug
|
||||
|
||||
release: clean-release
|
||||
mkdir -p bin/Release
|
||||
cp FNA.dll.config bin/Release
|
||||
dmcs /unsafe -optimize -out:bin/Release/FNA.dll -target:library $(SRC) $(RES)
|
||||
|
||||
clean-release:
|
||||
rm -rf bin/Release
|
||||
|
||||
clean: clean-debug clean-release
|
||||
rm -rf bin
|
||||
|
||||
all: debug release
|
|
@ -0,0 +1,29 @@
|
|||
This is FNA, an XNA4 reimplementation that focuses solely on developing a fully
|
||||
accurate XNA4 runtime for the desktop.
|
||||
|
||||
Project Website: http://fna-xna.github.io/
|
||||
|
||||
License
|
||||
-------
|
||||
FNA is released under the Microsoft Public License. See LICENSE for details.
|
||||
|
||||
FNA uses LzxDecoder.cs, released under a dual MSPL/LGPL license.
|
||||
See lzxdecoder.LICENSE for details.
|
||||
|
||||
FNA uses code from the unxwb project, specially released under the MonoGame
|
||||
project license. See unxwb.LICENSE for details.
|
||||
|
||||
FNA uses code from the Mono.Xna project, released under the MIT license.
|
||||
See monoxna.LICENSE for details.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
Documentation for FNA can be found on the FNA wiki:
|
||||
|
||||
https://github.com/FNA-XNA/FNA/wiki
|
||||
|
||||
Found an issue?
|
||||
---------------
|
||||
Issues and patches can be reported via GitHub:
|
||||
|
||||
https://github.com/FNA-XNA/FNA/issues
|
|
@ -0,0 +1,12 @@
|
|||
R: Gendarme.Rules.Design.AvoidRefAndOutParametersRule
|
||||
A: FNA
|
||||
|
||||
R: Gendarme.Rules.Naming.AvoidDeepNamespaceHierarchyRule
|
||||
A: FNA
|
||||
|
||||
# Ignore everything from the lib folder
|
||||
@ sdl2.ignore
|
||||
@ openal.ignore
|
||||
@ mojoshader.ignore
|
||||
@ vorbisfile.ignore
|
||||
@ theorafile.ignore
|
|
@ -0,0 +1,344 @@
|
|||
R: Gendarme.Rules.Performance.AvoidConcatenatingCharsRule
|
||||
M: System.Byte[] MojoShader::UTF8_ToNative(System.String)
|
||||
|
||||
R: Gendarme.Rules.Design.Generic.AvoidDeclaringCustomDelegatesRule
|
||||
T: MojoShader/MOJOSHADER_malloc
|
||||
T: MojoShader/MOJOSHADER_free
|
||||
T: MojoShader/MOJOSHADER_glGetProcAddress
|
||||
|
||||
R: Gendarme.Rules.Performance.AvoidLargeStructureRule
|
||||
T: MojoShader/MOJOSHADER_symbol
|
||||
T: MojoShader/MOJOSHADER_preshaderInstruction
|
||||
T: MojoShader/MOJOSHADER_preshader
|
||||
T: MojoShader/MOJOSHADER_parseData
|
||||
T: MojoShader/MOJOSHADER_effectValue
|
||||
T: MojoShader/MOJOSHADER_effectState
|
||||
T: MojoShader/MOJOSHADER_effectSamplerState
|
||||
T: MojoShader/MOJOSHADER_effectAnnotation
|
||||
T: MojoShader/MOJOSHADER_effectParam
|
||||
T: MojoShader/MOJOSHADER_effectShader
|
||||
T: MojoShader/MOJOSHADER_effectObject
|
||||
T: MojoShader/MOJOSHADER_effect
|
||||
|
||||
R: Gendarme.Rules.Naming.AvoidNonAlphanumericIdentifierRule
|
||||
T: MojoShader
|
||||
M: System.Int32 MojoShader::MOJOSHADER_version()
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_changeset()
|
||||
M: System.Int32 MojoShader::MOJOSHADER_maxShaderModel(System.String)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parse(System.String,System.String,System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_freeParseData(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parsePreshader(System.Byte[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_freePreshader(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parseEffect(System.String,System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_freeEffect(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_cloneEffect(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_effectSetRawValueHandle(System.IntPtr,System.IntPtr,System.UInt32,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_effectSetRawValueName(System.IntPtr,System.String,System.IntPtr,System.UInt32,System.UInt32)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_effectGetCurrentTechnique(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_effectSetTechnique(System.IntPtr,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_effectFindNextValidTechnique(System.IntPtr,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glCompileEffect(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDeleteEffect(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectBegin(System.IntPtr,System.UInt32&,System.Int32,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectBeginPass(System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectCommitChanges(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectEndPass(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectEnd(System.IntPtr)
|
||||
M: System.Int32 MojoShader::MOJOSHADER_glAvailableProfiles(MojoShader/MOJOSHADER_glGetProcAddress,System.IntPtr,System.IntPtr[],System.Int32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.String MojoShader::MOJOSHADER_glBestProfile(MojoShader/MOJOSHADER_glGetProcAddress,System.IntPtr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glCreateContext(System.String,MojoShader/MOJOSHADER_glGetProcAddress,System.IntPtr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glMakeContextCurrent(System.IntPtr)
|
||||
M: System.String MojoShader::MOJOSHADER_glGetError()
|
||||
M: System.Int32 MojoShader::MOJOSHADER_glMaxUniforms(MojoShader/MOJOSHADER_shaderType)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glCompileShader(System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glGetShaderParseData(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glLinkProgram(System.IntPtr,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glBindProgram(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glBindShaders(System.IntPtr,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetVertexShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetVertexShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetVertexShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetPixelShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetPixelShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetPixelShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetPixelShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetPixelShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetPixelShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetLegacyBumpMapEnv(System.UInt32,System.Single,System.Single,System.Single,System.Single,System.Single,System.Single)
|
||||
M: System.Int32 MojoShader::MOJOSHADER_glGetVertexAttribLocation(MojoShader/MOJOSHADER_usage,System.Int32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexAttribute(MojoShader/MOJOSHADER_usage,System.Int32,System.UInt32,MojoShader/MOJOSHADER_attributeType,System.Int32,System.UInt32,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexAttribDivisor(MojoShader/MOJOSHADER_usage,System.Int32,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glProgramReady()
|
||||
M: System.Void MojoShader::MOJOSHADER_glProgramViewportFlip(System.Int32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDeleteProgram(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDeleteShader(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDestroyContext(System.IntPtr)
|
||||
T: MojoShader/MOJOSHADER_malloc
|
||||
T: MojoShader/MOJOSHADER_free
|
||||
T: MojoShader/MOJOSHADER_shaderType
|
||||
T: MojoShader/MOJOSHADER_attributeType
|
||||
T: MojoShader/MOJOSHADER_uniformType
|
||||
T: MojoShader/MOJOSHADER_uniform
|
||||
T: MojoShader/MOJOSHADER_constant
|
||||
T: MojoShader/MOJOSHADER_samplerType
|
||||
T: MojoShader/MOJOSHADER_sampler
|
||||
T: MojoShader/MOJOSHADER_samplerMap
|
||||
T: MojoShader/MOJOSHADER_usage
|
||||
T: MojoShader/MOJOSHADER_attribute
|
||||
T: MojoShader/MOJOSHADER_swizzle
|
||||
T: MojoShader/MOJOSHADER_symbolRegisterSet
|
||||
T: MojoShader/MOJOSHADER_symbolClass
|
||||
T: MojoShader/MOJOSHADER_symbolType
|
||||
T: MojoShader/MOJOSHADER_symbolTypeInfo
|
||||
T: MojoShader/MOJOSHADER_symbolStructMember
|
||||
T: MojoShader/MOJOSHADER_symbol
|
||||
T: MojoShader/MOJOSHADER_error
|
||||
T: MojoShader/MOJOSHADER_preshaderOpcode
|
||||
T: MojoShader/MOJOSHADER_preshaderOperandType
|
||||
T: MojoShader/MOJOSHADER_preshaderOperand
|
||||
T: MojoShader/MOJOSHADER_preshaderInstruction
|
||||
T: MojoShader/MOJOSHADER_preshader
|
||||
T: MojoShader/MOJOSHADER_parseData
|
||||
T: MojoShader/MOJOSHADER_renderStateType
|
||||
T: MojoShader/MOJOSHADER_zBufferType
|
||||
T: MojoShader/MOJOSHADER_fillMode
|
||||
T: MojoShader/MOJOSHADER_shadeMode
|
||||
T: MojoShader/MOJOSHADER_blendMode
|
||||
T: MojoShader/MOJOSHADER_cullMode
|
||||
T: MojoShader/MOJOSHADER_compareFunc
|
||||
T: MojoShader/MOJOSHADER_fogMode
|
||||
T: MojoShader/MOJOSHADER_stencilOp
|
||||
T: MojoShader/MOJOSHADER_materialColorSource
|
||||
T: MojoShader/MOJOSHADER_vertexBlendFlags
|
||||
T: MojoShader/MOJOSHADER_patchedEdgeStyle
|
||||
T: MojoShader/MOJOSHADER_debugMonitorTokens
|
||||
T: MojoShader/MOJOSHADER_blendOp
|
||||
T: MojoShader/MOJOSHADER_degreeType
|
||||
T: MojoShader/MOJOSHADER_samplerStateType
|
||||
T: MojoShader/MOJOSHADER_textureAddress
|
||||
T: MojoShader/MOJOSHADER_textureFilterType
|
||||
T: MojoShader/MOJOSHADER_effectValue
|
||||
T: MojoShader/MOJOSHADER_effectState
|
||||
T: MojoShader/MOJOSHADER_effectSamplerState
|
||||
T: MojoShader/MOJOSHADER_effectAnnotation
|
||||
T: MojoShader/MOJOSHADER_effectParam
|
||||
T: MojoShader/MOJOSHADER_effectPass
|
||||
T: MojoShader/MOJOSHADER_effectTechnique
|
||||
T: MojoShader/MOJOSHADER_effectShader
|
||||
T: MojoShader/MOJOSHADER_effectSamplerMap
|
||||
T: MojoShader/MOJOSHADER_effectString
|
||||
T: MojoShader/MOJOSHADER_effectTexture
|
||||
T: MojoShader/MOJOSHADER_effectObject
|
||||
T: MojoShader/MOJOSHADER_samplerStateRegister
|
||||
T: MojoShader/MOJOSHADER_effectStateChanges
|
||||
T: MojoShader/MOJOSHADER_effect
|
||||
T: MojoShader/MOJOSHADER_glGetProcAddress
|
||||
|
||||
R: Gendarme.Rules.BadPractice.AvoidVisibleConstantFieldRule
|
||||
T: MojoShader
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidVisibleFieldsRule
|
||||
T: MojoShader/MOJOSHADER_uniform
|
||||
T: MojoShader/MOJOSHADER_constant
|
||||
T: MojoShader/MOJOSHADER_sampler
|
||||
T: MojoShader/MOJOSHADER_samplerMap
|
||||
T: MojoShader/MOJOSHADER_attribute
|
||||
T: MojoShader/MOJOSHADER_swizzle
|
||||
T: MojoShader/MOJOSHADER_symbolTypeInfo
|
||||
T: MojoShader/MOJOSHADER_symbolStructMember
|
||||
T: MojoShader/MOJOSHADER_symbol
|
||||
T: MojoShader/MOJOSHADER_error
|
||||
T: MojoShader/MOJOSHADER_preshaderOperand
|
||||
T: MojoShader/MOJOSHADER_preshaderInstruction
|
||||
T: MojoShader/MOJOSHADER_preshader
|
||||
T: MojoShader/MOJOSHADER_parseData
|
||||
T: MojoShader/MOJOSHADER_effectValue
|
||||
T: MojoShader/MOJOSHADER_effectState
|
||||
T: MojoShader/MOJOSHADER_effectSamplerState
|
||||
T: MojoShader/MOJOSHADER_effectAnnotation
|
||||
T: MojoShader/MOJOSHADER_effectParam
|
||||
T: MojoShader/MOJOSHADER_effectPass
|
||||
T: MojoShader/MOJOSHADER_effectTechnique
|
||||
T: MojoShader/MOJOSHADER_effectShader
|
||||
T: MojoShader/MOJOSHADER_effectSamplerMap
|
||||
T: MojoShader/MOJOSHADER_effectString
|
||||
T: MojoShader/MOJOSHADER_effectTexture
|
||||
T: MojoShader/MOJOSHADER_effectObject
|
||||
T: MojoShader/MOJOSHADER_samplerStateRegister
|
||||
T: MojoShader/MOJOSHADER_effectStateChanges
|
||||
T: MojoShader/MOJOSHADER_effect
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidVisibleNestedTypesRule
|
||||
T: MojoShader/MOJOSHADER_malloc
|
||||
T: MojoShader/MOJOSHADER_free
|
||||
T: MojoShader/MOJOSHADER_shaderType
|
||||
T: MojoShader/MOJOSHADER_attributeType
|
||||
T: MojoShader/MOJOSHADER_uniformType
|
||||
T: MojoShader/MOJOSHADER_uniform
|
||||
T: MojoShader/MOJOSHADER_constant
|
||||
T: MojoShader/MOJOSHADER_constant/<f>__FixedBuffer0
|
||||
T: MojoShader/MOJOSHADER_constant/<i>__FixedBuffer1
|
||||
T: MojoShader/MOJOSHADER_samplerType
|
||||
T: MojoShader/MOJOSHADER_sampler
|
||||
T: MojoShader/MOJOSHADER_samplerMap
|
||||
T: MojoShader/MOJOSHADER_usage
|
||||
T: MojoShader/MOJOSHADER_attribute
|
||||
T: MojoShader/MOJOSHADER_swizzle
|
||||
T: MojoShader/MOJOSHADER_swizzle/<swizzles>__FixedBuffer2
|
||||
T: MojoShader/MOJOSHADER_symbolRegisterSet
|
||||
T: MojoShader/MOJOSHADER_symbolClass
|
||||
T: MojoShader/MOJOSHADER_symbolType
|
||||
T: MojoShader/MOJOSHADER_symbolTypeInfo
|
||||
T: MojoShader/MOJOSHADER_symbolStructMember
|
||||
T: MojoShader/MOJOSHADER_symbol
|
||||
T: MojoShader/MOJOSHADER_error
|
||||
T: MojoShader/MOJOSHADER_preshaderOpcode
|
||||
T: MojoShader/MOJOSHADER_preshaderOperandType
|
||||
T: MojoShader/MOJOSHADER_preshaderOperand
|
||||
T: MojoShader/MOJOSHADER_preshaderInstruction
|
||||
T: MojoShader/MOJOSHADER_preshader
|
||||
T: MojoShader/MOJOSHADER_parseData
|
||||
T: MojoShader/MOJOSHADER_renderStateType
|
||||
T: MojoShader/MOJOSHADER_zBufferType
|
||||
T: MojoShader/MOJOSHADER_fillMode
|
||||
T: MojoShader/MOJOSHADER_shadeMode
|
||||
T: MojoShader/MOJOSHADER_blendMode
|
||||
T: MojoShader/MOJOSHADER_cullMode
|
||||
T: MojoShader/MOJOSHADER_compareFunc
|
||||
T: MojoShader/MOJOSHADER_fogMode
|
||||
T: MojoShader/MOJOSHADER_stencilOp
|
||||
T: MojoShader/MOJOSHADER_materialColorSource
|
||||
T: MojoShader/MOJOSHADER_vertexBlendFlags
|
||||
T: MojoShader/MOJOSHADER_patchedEdgeStyle
|
||||
T: MojoShader/MOJOSHADER_debugMonitorTokens
|
||||
T: MojoShader/MOJOSHADER_blendOp
|
||||
T: MojoShader/MOJOSHADER_degreeType
|
||||
T: MojoShader/MOJOSHADER_samplerStateType
|
||||
T: MojoShader/MOJOSHADER_textureAddress
|
||||
T: MojoShader/MOJOSHADER_textureFilterType
|
||||
T: MojoShader/MOJOSHADER_effectValue
|
||||
T: MojoShader/MOJOSHADER_effectState
|
||||
T: MojoShader/MOJOSHADER_effectSamplerState
|
||||
T: MojoShader/MOJOSHADER_effectAnnotation
|
||||
T: MojoShader/MOJOSHADER_effectParam
|
||||
T: MojoShader/MOJOSHADER_effectPass
|
||||
T: MojoShader/MOJOSHADER_effectTechnique
|
||||
T: MojoShader/MOJOSHADER_effectShader
|
||||
T: MojoShader/MOJOSHADER_effectSamplerMap
|
||||
T: MojoShader/MOJOSHADER_effectString
|
||||
T: MojoShader/MOJOSHADER_effectTexture
|
||||
T: MojoShader/MOJOSHADER_effectObject
|
||||
T: MojoShader/MOJOSHADER_samplerStateRegister
|
||||
T: MojoShader/MOJOSHADER_effectStateChanges
|
||||
T: MojoShader/MOJOSHADER_effect
|
||||
T: MojoShader/MOJOSHADER_glGetProcAddress
|
||||
|
||||
R: Gendarme.Rules.Interoperability.CentralizePInvokesIntoNativeMethodsTypeRule
|
||||
M: System.Int32 MojoShader::MOJOSHADER_version()
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_changeset()
|
||||
M: System.Int32 MojoShader::MOJOSHADER_maxShaderModel(System.Byte[])
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parse(System.Byte[],System.Byte[],System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_freeParseData(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parsePreshader(System.Byte[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_freePreshader(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parseEffect(System.Byte[],System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_freeEffect(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_cloneEffect(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_effectSetRawValueHandle(System.IntPtr,System.IntPtr,System.UInt32,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_effectSetRawValueName(System.IntPtr,System.Byte[],System.IntPtr,System.UInt32,System.UInt32)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_effectGetCurrentTechnique(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_effectSetTechnique(System.IntPtr,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_effectFindNextValidTechnique(System.IntPtr,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glCompileEffect(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDeleteEffect(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectBegin(System.IntPtr,System.UInt32&,System.Int32,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectBeginPass(System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectCommitChanges(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectEndPass(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glEffectEnd(System.IntPtr)
|
||||
M: System.Int32 MojoShader::MOJOSHADER_glAvailableProfiles(MojoShader/MOJOSHADER_glGetProcAddress,System.IntPtr,System.IntPtr[],System.Int32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::INTERNAL_glBestProfile(MojoShader/MOJOSHADER_glGetProcAddress,System.IntPtr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glCreateContext(System.Byte[],MojoShader/MOJOSHADER_glGetProcAddress,System.IntPtr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glMakeContextCurrent(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::INTERNAL_glGetError()
|
||||
M: System.Int32 MojoShader::MOJOSHADER_glMaxUniforms(MojoShader/MOJOSHADER_shaderType)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glCompileShader(System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glGetShaderParseData(System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_glLinkProgram(System.IntPtr,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glBindProgram(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glBindShaders(System.IntPtr,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetVertexShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetVertexShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetVertexShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetPixelShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetPixelShaderUniformF(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetPixelShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetPixelShaderUniformI(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetPixelShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glGetPixelShaderUniformB(System.UInt32,System.IntPtr,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetLegacyBumpMapEnv(System.UInt32,System.Single,System.Single,System.Single,System.Single,System.Single,System.Single)
|
||||
M: System.Int32 MojoShader::MOJOSHADER_glGetVertexAttribLocation(MojoShader/MOJOSHADER_usage,System.Int32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexAttribute(MojoShader/MOJOSHADER_usage,System.Int32,System.UInt32,MojoShader/MOJOSHADER_attributeType,System.Int32,System.UInt32,System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glSetVertexAttribDivisor(MojoShader/MOJOSHADER_usage,System.Int32,System.UInt32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glProgramReady()
|
||||
M: System.Void MojoShader::MOJOSHADER_glProgramViewportFlip(System.Int32)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDeleteProgram(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDeleteShader(System.IntPtr)
|
||||
M: System.Void MojoShader::MOJOSHADER_glDestroyContext(System.IntPtr)
|
||||
|
||||
R: Gendarme.Rules.Naming.DoNotPrefixValuesWithEnumNameRule
|
||||
T: MojoShader/MOJOSHADER_usage
|
||||
T: MojoShader/MOJOSHADER_stencilOp
|
||||
T: MojoShader/MOJOSHADER_blendOp
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithAssemblyVersionRule
|
||||
A: MojoShader-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithCLSCompliantRule
|
||||
A: MojoShader-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithComVisibleRule
|
||||
A: MojoShader-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Security.NativeFieldsShouldNotBeVisibleRule
|
||||
T: MojoShader/MOJOSHADER_uniform
|
||||
T: MojoShader/MOJOSHADER_sampler
|
||||
T: MojoShader/MOJOSHADER_attribute
|
||||
T: MojoShader/MOJOSHADER_symbolTypeInfo
|
||||
T: MojoShader/MOJOSHADER_symbolStructMember
|
||||
T: MojoShader/MOJOSHADER_symbol
|
||||
T: MojoShader/MOJOSHADER_error
|
||||
T: MojoShader/MOJOSHADER_preshader
|
||||
T: MojoShader/MOJOSHADER_parseData
|
||||
T: MojoShader/MOJOSHADER_effectValue
|
||||
T: MojoShader/MOJOSHADER_effectAnnotation
|
||||
T: MojoShader/MOJOSHADER_effectParam
|
||||
T: MojoShader/MOJOSHADER_effectPass
|
||||
T: MojoShader/MOJOSHADER_effectTechnique
|
||||
T: MojoShader/MOJOSHADER_effectShader
|
||||
T: MojoShader/MOJOSHADER_effectSamplerMap
|
||||
T: MojoShader/MOJOSHADER_effectString
|
||||
T: MojoShader/MOJOSHADER_samplerStateRegister
|
||||
T: MojoShader/MOJOSHADER_effectStateChanges
|
||||
T: MojoShader/MOJOSHADER_effect
|
||||
|
||||
R: Gendarme.Rules.Naming.UseCorrectCasingRule
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parseEffect(System.Byte[],System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
M: System.IntPtr MojoShader::MOJOSHADER_parseEffect(System.String,System.Byte[],System.UInt32,MojoShader/MOJOSHADER_swizzle[],System.UInt32,MojoShader/MOJOSHADER_samplerMap[],System.UInt32,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,System.IntPtr)
|
||||
|
||||
R: Gendarme.Rules.Naming.UseCorrectSuffixRule
|
||||
T: MojoShader/MOJOSHADER_attribute
|
||||
T: MojoShader/MOJOSHADER_vertexBlendFlags
|
||||
|
||||
R: Gendarme.Rules.Naming.UseSingularNameInEnumsUnlessAreFlagsRule
|
||||
T: MojoShader/MOJOSHADER_symbolClass
|
||||
T: MojoShader/MOJOSHADER_vertexBlendFlags
|
||||
T: MojoShader/MOJOSHADER_debugMonitorTokens
|
||||
T: MojoShader/MOJOSHADER_textureAddress
|
||||
|
|
@ -0,0 +1,326 @@
|
|||
R: Gendarme.Rules.Naming.AvoidNonAlphanumericIdentifierRule
|
||||
T: OpenAL.ALC10
|
||||
T: OpenAL.ALC11
|
||||
T: OpenAL.AL10
|
||||
T: OpenAL.AL11
|
||||
T: OpenAL.ALEXT
|
||||
T: OpenAL.EFX
|
||||
|
||||
R: Gendarme.Rules.BadPractice.AvoidVisibleConstantFieldRule
|
||||
T: OpenAL.ALC10
|
||||
T: OpenAL.ALC11
|
||||
T: OpenAL.AL10
|
||||
T: OpenAL.AL11
|
||||
T: OpenAL.ALEXT
|
||||
T: OpenAL.EFX
|
||||
|
||||
R: Gendarme.Rules.Interoperability.CentralizePInvokesIntoNativeMethodsTypeRule
|
||||
M: System.IntPtr OpenAL.ALC10::alcCreateContext(System.IntPtr,System.Int32[])
|
||||
M: System.Boolean OpenAL.ALC10::alcMakeContextCurrent(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC10::alcDestroyContext(System.IntPtr)
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetCurrentContext()
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetContextsDevice(System.IntPtr)
|
||||
M: System.IntPtr OpenAL.ALC10::alcOpenDevice(System.String)
|
||||
M: System.Boolean OpenAL.ALC10::alcCloseDevice(System.IntPtr)
|
||||
M: System.Int32 OpenAL.ALC10::alcGetError(System.IntPtr)
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetProcAddress(System.IntPtr,System.String)
|
||||
M: System.Int32 OpenAL.ALC10::alcGetEnumValue(System.IntPtr,System.String)
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetString(System.IntPtr,System.Int32)
|
||||
M: System.Void OpenAL.ALC10::alcGetIntegerv(System.IntPtr,System.Int32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.ALC11::alcProcessContext(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcSuspendContext(System.IntPtr)
|
||||
M: System.Boolean OpenAL.ALC11::alcIsExtensionPresent(System.IntPtr,System.String)
|
||||
M: System.IntPtr OpenAL.ALC11::alcCaptureOpenDevice(System.String,System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Boolean OpenAL.ALC11::alcCaptureCloseDevice(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcCaptureStart(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcCaptureStop(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcCaptureSamples(System.IntPtr,System.IntPtr,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alDopplerFactor(System.Single)
|
||||
M: System.Void OpenAL.AL10::alDistanceModel(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alEnable(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alDisable(System.Int32)
|
||||
M: System.Boolean OpenAL.AL10::alIsEnabled(System.Int32)
|
||||
M: System.IntPtr OpenAL.AL10::INTERNAL_alGetString(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alGetBooleanv(System.Int32,System.Boolean[])
|
||||
M: System.Void OpenAL.AL10::alGetIntegerv(System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetFloatv(System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetDoublev(System.Int32,System.Double[])
|
||||
M: System.Boolean OpenAL.AL10::alGetBoolean(System.Int32)
|
||||
M: System.Int32 OpenAL.AL10::alGetInteger(System.Int32)
|
||||
M: System.Single OpenAL.AL10::alGetFloat(System.Int32)
|
||||
M: System.Double OpenAL.AL10::alGetDouble(System.Int32)
|
||||
M: System.Int32 OpenAL.AL10::alGetError()
|
||||
M: System.Boolean OpenAL.AL10::alIsExtensionPresent(System.String)
|
||||
M: System.IntPtr OpenAL.AL10::alGetProcAddress(System.String)
|
||||
M: System.Int32 OpenAL.AL10::alGetEnumValue(System.String)
|
||||
M: System.Void OpenAL.AL10::alListenerf(System.Int32,System.Single)
|
||||
M: System.Void OpenAL.AL10::alListener3f(System.Int32,System.Single,System.Single,System.Single)
|
||||
M: System.Void OpenAL.AL10::alListenerfv(System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alListeneri(System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alListener3i(System.Int32,System.Int32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alListeneriv(System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetListenerf(System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetListener3f(System.Int32,System.Single&,System.Single&,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetListenerfv(System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetListeneri(System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetListener3i(System.Int32,System.Int32&,System.Int32&,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetListeneriv(System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGenSources(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alGenSources(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alDeleteSources(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alDeleteSources(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.AL10::alIsSource(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourcef(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.AL10::alSource3f(System.UInt32,System.Int32,System.Single,System.Single,System.Single)
|
||||
M: System.Void OpenAL.AL10::alSourcefv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alSourcei(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alSource3i(System.UInt32,System.Int32,System.Int32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alSourceiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetSourcef(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetSource3f(System.UInt32,System.Int32,System.Single&,System.Single&,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetSourcefv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetSourcei(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetSource3i(System.UInt32,System.Int32,System.Int32&,System.Int32&,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetSourceiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alSourcePlayv(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceStopv(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceRewindv(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourcePausev(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourcePlay(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourceStop(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourceRewind(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourcePause(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourceQueueBuffers(System.UInt32,System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceQueueBuffers(System.UInt32,System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alSourceUnqueueBuffers(System.UInt32,System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceUnqueueBuffers(System.UInt32,System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alGenBuffers(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alGenBuffers(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alDeleteBuffers(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alDeleteBuffers(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.AL10::alIsBuffer(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.IntPtr,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Byte[],System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Int16[],System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Single[],System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.AL10::alBuffer3f(System.UInt32,System.Int32,System.Single,System.Single,System.Single)
|
||||
M: System.Void OpenAL.AL10::alBufferfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alBufferi(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBuffer3i(System.UInt32,System.Int32,System.Int32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetBufferf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetBuffer3f(System.UInt32,System.Int32,System.Single&,System.Single&,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetBufferfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetBufferi(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetBuffer3i(System.UInt32,System.Int32,System.Int32&,System.Int32&,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetBufferiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL11::alSpeedOfSound(System.Single)
|
||||
M: System.Void OpenAL.ALEXT::alGetBufferSamplesSOFT(System.UInt32,System.Int32,System.Int32,System.Int32,System.Int32,System.IntPtr)
|
||||
M: System.Void OpenAL.EFX::alGenEffects(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alGenEffects(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.EFX::alDeleteEffects(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alDeleteEffects(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.EFX::alIsEffect(System.UInt32)
|
||||
M: System.Void OpenAL.EFX::alEffecti(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.EFX::alEffectiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alEffectf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.EFX::alEffectfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGetEffecti(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.EFX::alGetEffectiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alGetEffectf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.EFX::alGetEffectfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGenFilters(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alGenFilters(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.EFX::alDeleteFilters(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alDeleteFilters(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.EFX::alIsFilter(System.UInt32)
|
||||
M: System.Void OpenAL.EFX::alFilteri(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.EFX::alFilteriv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alFilterf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.EFX::alFilterfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGetFilteri(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.EFX::alGetFilteriv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alGetFilterf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.EFX::alGetFilterfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGenAuxiliaryEffectSlots(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alGenAuxiliaryEffectSlots(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.EFX::alDeleteAuxiliaryEffectSlots(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alDeleteAuxiliaryEffectSlots(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.EFX::alIsAuxiliaryEffectSlot(System.UInt32)
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSloti(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSlotiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSlotf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSlotfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSloti(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSlotiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSlotf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSlotfv(System.UInt32,System.Int32,System.Single[])
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithAssemblyVersionRule
|
||||
A: OpenAL-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithCLSCompliantRule
|
||||
A: OpenAL-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithComVisibleRule
|
||||
A: OpenAL-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Interoperability.MarshalBooleansInPInvokeDeclarationsRule
|
||||
M: System.Boolean OpenAL.ALC10::alcMakeContextCurrent(System.IntPtr)
|
||||
M: System.Boolean OpenAL.ALC10::alcCloseDevice(System.IntPtr)
|
||||
M: System.Boolean OpenAL.ALC11::alcIsExtensionPresent(System.IntPtr,System.String)
|
||||
M: System.Boolean OpenAL.ALC11::alcCaptureCloseDevice(System.IntPtr)
|
||||
M: System.Boolean OpenAL.AL10::alIsEnabled(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alGetBooleanv(System.Int32,System.Boolean[])
|
||||
M: System.Boolean OpenAL.AL10::alGetBoolean(System.Int32)
|
||||
M: System.Boolean OpenAL.AL10::alIsExtensionPresent(System.String)
|
||||
M: System.Boolean OpenAL.AL10::alIsSource(System.UInt32)
|
||||
M: System.Boolean OpenAL.AL10::alIsBuffer(System.UInt32)
|
||||
M: System.Boolean OpenAL.EFX::alIsEffect(System.UInt32)
|
||||
M: System.Boolean OpenAL.EFX::alIsFilter(System.UInt32)
|
||||
M: System.Boolean OpenAL.EFX::alIsAuxiliaryEffectSlot(System.UInt32)
|
||||
|
||||
R: Gendarme.Rules.Naming.UseCorrectCasingRule
|
||||
M: System.IntPtr OpenAL.ALC10::alcCreateContext(System.IntPtr,System.Int32[])
|
||||
M: System.Boolean OpenAL.ALC10::alcMakeContextCurrent(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC10::alcDestroyContext(System.IntPtr)
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetCurrentContext()
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetContextsDevice(System.IntPtr)
|
||||
M: System.IntPtr OpenAL.ALC10::alcOpenDevice(System.String)
|
||||
M: System.Boolean OpenAL.ALC10::alcCloseDevice(System.IntPtr)
|
||||
M: System.Int32 OpenAL.ALC10::alcGetError(System.IntPtr)
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetProcAddress(System.IntPtr,System.String)
|
||||
M: System.Int32 OpenAL.ALC10::alcGetEnumValue(System.IntPtr,System.String)
|
||||
M: System.IntPtr OpenAL.ALC10::alcGetString(System.IntPtr,System.Int32)
|
||||
M: System.Void OpenAL.ALC10::alcGetIntegerv(System.IntPtr,System.Int32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.ALC11::alcProcessContext(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcSuspendContext(System.IntPtr)
|
||||
M: System.Boolean OpenAL.ALC11::alcIsExtensionPresent(System.IntPtr,System.String)
|
||||
M: System.IntPtr OpenAL.ALC11::alcCaptureOpenDevice(System.String,System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Boolean OpenAL.ALC11::alcCaptureCloseDevice(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcCaptureStart(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcCaptureStop(System.IntPtr)
|
||||
M: System.Void OpenAL.ALC11::alcCaptureSamples(System.IntPtr,System.IntPtr,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alDopplerFactor(System.Single)
|
||||
M: System.Void OpenAL.AL10::alDistanceModel(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alEnable(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alDisable(System.Int32)
|
||||
M: System.Boolean OpenAL.AL10::alIsEnabled(System.Int32)
|
||||
M: System.String OpenAL.AL10::alGetString(System.Int32)
|
||||
M: System.Void OpenAL.AL10::alGetBooleanv(System.Int32,System.Boolean[])
|
||||
M: System.Void OpenAL.AL10::alGetIntegerv(System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetFloatv(System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetDoublev(System.Int32,System.Double[])
|
||||
M: System.Boolean OpenAL.AL10::alGetBoolean(System.Int32)
|
||||
M: System.Int32 OpenAL.AL10::alGetInteger(System.Int32)
|
||||
M: System.Single OpenAL.AL10::alGetFloat(System.Int32)
|
||||
M: System.Double OpenAL.AL10::alGetDouble(System.Int32)
|
||||
M: System.Int32 OpenAL.AL10::alGetError()
|
||||
M: System.Boolean OpenAL.AL10::alIsExtensionPresent(System.String)
|
||||
M: System.IntPtr OpenAL.AL10::alGetProcAddress(System.String)
|
||||
M: System.Int32 OpenAL.AL10::alGetEnumValue(System.String)
|
||||
M: System.Void OpenAL.AL10::alListenerf(System.Int32,System.Single)
|
||||
M: System.Void OpenAL.AL10::alListener3f(System.Int32,System.Single,System.Single,System.Single)
|
||||
M: System.Void OpenAL.AL10::alListenerfv(System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alListeneri(System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alListener3i(System.Int32,System.Int32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alListeneriv(System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetListenerf(System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetListener3f(System.Int32,System.Single&,System.Single&,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetListenerfv(System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetListeneri(System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetListener3i(System.Int32,System.Int32&,System.Int32&,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetListeneriv(System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGenSources(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alGenSources(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alDeleteSources(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alDeleteSources(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.AL10::alIsSource(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourcef(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.AL10::alSource3f(System.UInt32,System.Int32,System.Single,System.Single,System.Single)
|
||||
M: System.Void OpenAL.AL10::alSourcefv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alSourcei(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alSource3i(System.UInt32,System.Int32,System.Int32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alSourceiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetSourcef(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetSource3f(System.UInt32,System.Int32,System.Single&,System.Single&,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetSourcefv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetSourcei(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetSource3i(System.UInt32,System.Int32,System.Int32&,System.Int32&,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetSourceiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alSourcePlayv(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceStopv(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceRewindv(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourcePausev(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourcePlay(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourceStop(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourceRewind(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourcePause(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alSourceQueueBuffers(System.UInt32,System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceQueueBuffers(System.UInt32,System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alSourceUnqueueBuffers(System.UInt32,System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alSourceUnqueueBuffers(System.UInt32,System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alGenBuffers(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alGenBuffers(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.AL10::alDeleteBuffers(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.AL10::alDeleteBuffers(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.AL10::alIsBuffer(System.UInt32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.IntPtr,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Byte[],System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Int16[],System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Single[],System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.AL10::alBuffer3f(System.UInt32,System.Int32,System.Single,System.Single,System.Single)
|
||||
M: System.Void OpenAL.AL10::alBufferfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alBufferi(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBuffer3i(System.UInt32,System.Int32,System.Int32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.AL10::alBufferiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL10::alGetBufferf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetBuffer3f(System.UInt32,System.Int32,System.Single&,System.Single&,System.Single&)
|
||||
M: System.Void OpenAL.AL10::alGetBufferfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.AL10::alGetBufferi(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetBuffer3i(System.UInt32,System.Int32,System.Int32&,System.Int32&,System.Int32&)
|
||||
M: System.Void OpenAL.AL10::alGetBufferiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.AL11::alSpeedOfSound(System.Single)
|
||||
M: System.Void OpenAL.ALEXT::alGetBufferSamplesSOFT(System.UInt32,System.Int32,System.Int32,System.Int32,System.Int32,System.IntPtr)
|
||||
M: System.Void OpenAL.EFX::alGenEffects(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alGenEffects(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.EFX::alDeleteEffects(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alDeleteEffects(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.EFX::alIsEffect(System.UInt32)
|
||||
M: System.Void OpenAL.EFX::alEffecti(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.EFX::alEffectiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alEffectf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.EFX::alEffectfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGetEffecti(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.EFX::alGetEffectiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alGetEffectf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.EFX::alGetEffectfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGenFilters(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alGenFilters(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.EFX::alDeleteFilters(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alDeleteFilters(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.EFX::alIsFilter(System.UInt32)
|
||||
M: System.Void OpenAL.EFX::alFilteri(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.EFX::alFilteriv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alFilterf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.EFX::alFilterfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGetFilteri(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.EFX::alGetFilteriv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alGetFilterf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.EFX::alGetFilterfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGenAuxiliaryEffectSlots(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alGenAuxiliaryEffectSlots(System.Int32,System.UInt32&)
|
||||
M: System.Void OpenAL.EFX::alDeleteAuxiliaryEffectSlots(System.Int32,System.UInt32[])
|
||||
M: System.Void OpenAL.EFX::alDeleteAuxiliaryEffectSlots(System.Int32,System.UInt32&)
|
||||
M: System.Boolean OpenAL.EFX::alIsAuxiliaryEffectSlot(System.UInt32)
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSloti(System.UInt32,System.Int32,System.Int32)
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSlotiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSlotf(System.UInt32,System.Int32,System.Single)
|
||||
M: System.Void OpenAL.EFX::alAuxiliaryEffectSlotfv(System.UInt32,System.Int32,System.Single[])
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSloti(System.UInt32,System.Int32,System.Int32&)
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSlotiv(System.UInt32,System.Int32,System.Int32[])
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSlotf(System.UInt32,System.Int32,System.Single&)
|
||||
M: System.Void OpenAL.EFX::alGetAuxiliaryEffectSlotfv(System.UInt32,System.Int32,System.Single[])
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Filename of the FNA assembly output
|
||||
ASSEMBLYNAME="../bin/Debug/FNA.dll"
|
||||
|
||||
# Move to script's directory
|
||||
cd "`dirname "$0"`"
|
||||
|
||||
# Run Gendarme using the FNA ruleset
|
||||
gendarme --ignore fna.ignore --html gendarme.html $ASSEMBLYNAME
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,84 @@
|
|||
R: Gendarme.Rules.Performance.AvoidConcatenatingCharsRule
|
||||
M: System.Byte[] Theorafile::UTF8_ToNative(System.String)
|
||||
|
||||
R: Gendarme.Rules.Design.Generic.AvoidDeclaringCustomDelegatesRule
|
||||
T: Theorafile/read_func
|
||||
T: Theorafile/seek_func
|
||||
T: Theorafile/close_func
|
||||
|
||||
R: Gendarme.Rules.Naming.AvoidNonAlphanumericIdentifierRule
|
||||
M: System.Int32 Theorafile::tf_open_callbacks(System.IntPtr,System.IntPtr&,Theorafile/tf_callbacks)
|
||||
M: System.Int32 Theorafile::tf_fopen(System.String,System.IntPtr&)
|
||||
M: System.Int32 Theorafile::tf_close(System.IntPtr&)
|
||||
M: System.Int32 Theorafile::tf_hasaudio(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_hasvideo(System.IntPtr)
|
||||
M: System.Void Theorafile::tf_videoinfo(System.IntPtr,System.Int32&,System.Int32&,System.Double&)
|
||||
M: System.Void Theorafile::tf_audioinfo(System.IntPtr,System.Int32&,System.Int32&)
|
||||
M: System.Int32 Theorafile::tf_eos(System.IntPtr)
|
||||
M: System.Void Theorafile::tf_reset(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_readvideo(System.IntPtr,System.IntPtr,System.Int32)
|
||||
M: System.Int32 Theorafile::tf_readaudio(System.IntPtr,System.IntPtr,System.Int32)
|
||||
T: Theorafile/SeekWhence
|
||||
T: Theorafile/read_func
|
||||
T: Theorafile/seek_func
|
||||
T: Theorafile/close_func
|
||||
T: Theorafile/tf_callbacks
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidRefAndOutParametersRule
|
||||
M: System.Int32 Theorafile::tf_open_callbacks(System.IntPtr,System.IntPtr&,Theorafile/tf_callbacks)
|
||||
M: System.Int32 Theorafile::tf_fopen(System.String,System.IntPtr&)
|
||||
M: System.Int32 Theorafile::tf_close(System.IntPtr&)
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidVisibleFieldsRule
|
||||
T: Theorafile/tf_callbacks
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidVisibleNestedTypesRule
|
||||
T: Theorafile/SeekWhence
|
||||
T: Theorafile/read_func
|
||||
T: Theorafile/seek_func
|
||||
T: Theorafile/close_func
|
||||
T: Theorafile/tf_callbacks
|
||||
|
||||
R: Gendarme.Rules.Interoperability.CentralizePInvokesIntoNativeMethodsTypeRule
|
||||
M: System.IntPtr Theorafile::malloc(System.IntPtr)
|
||||
M: System.Void Theorafile::free(System.IntPtr)
|
||||
M: System.Int32 Theorafile::INTERNAL_tf_open_callbacks(System.IntPtr,System.IntPtr,Theorafile/tf_callbacks)
|
||||
M: System.Int32 Theorafile::INTERNAL_tf_fopen(System.Byte[],System.IntPtr)
|
||||
M: System.Int32 Theorafile::INTERNAL_tf_close(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_hasaudio(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_hasvideo(System.IntPtr)
|
||||
M: System.Void Theorafile::tf_videoinfo(System.IntPtr,System.Int32&,System.Int32&,System.Double&)
|
||||
M: System.Void Theorafile::tf_audioinfo(System.IntPtr,System.Int32&,System.Int32&)
|
||||
M: System.Int32 Theorafile::tf_eos(System.IntPtr)
|
||||
M: System.Void Theorafile::tf_reset(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_readvideo(System.IntPtr,System.IntPtr,System.Int32)
|
||||
M: System.Int32 Theorafile::tf_readaudio(System.IntPtr,System.IntPtr,System.Int32)
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithAssemblyVersionRule
|
||||
A: Theorafile-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithCLSCompliantRule
|
||||
A: Theorafile-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithComVisibleRule
|
||||
A: Theorafile-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Naming.UseCorrectCasingRule
|
||||
M: System.IntPtr Theorafile::malloc(System.IntPtr)
|
||||
M: System.Void Theorafile::free(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_open_callbacks(System.IntPtr,System.IntPtr&,Theorafile/tf_callbacks)
|
||||
M: System.Int32 Theorafile::tf_fopen(System.String,System.IntPtr&)
|
||||
M: System.Int32 Theorafile::tf_close(System.IntPtr&)
|
||||
M: System.Int32 Theorafile::tf_hasaudio(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_hasvideo(System.IntPtr)
|
||||
M: System.Void Theorafile::tf_videoinfo(System.IntPtr,System.Int32&,System.Int32&,System.Double&)
|
||||
M: System.Void Theorafile::tf_audioinfo(System.IntPtr,System.Int32&,System.Int32&)
|
||||
M: System.Int32 Theorafile::tf_eos(System.IntPtr)
|
||||
M: System.Void Theorafile::tf_reset(System.IntPtr)
|
||||
M: System.Int32 Theorafile::tf_readvideo(System.IntPtr,System.IntPtr,System.Int32)
|
||||
M: System.Int32 Theorafile::tf_readaudio(System.IntPtr,System.IntPtr,System.Int32)
|
||||
T: Theorafile/read_func
|
||||
T: Theorafile/seek_func
|
||||
T: Theorafile/close_func
|
||||
T: Theorafile/tf_callbacks
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
R: Gendarme.Rules.Design.Generic.AvoidDeclaringCustomDelegatesRule
|
||||
T: Vorbisfile/read_func
|
||||
T: Vorbisfile/seek_func
|
||||
T: Vorbisfile/close_func
|
||||
T: Vorbisfile/tell_func
|
||||
|
||||
R: Gendarme.Rules.Naming.AvoidNonAlphanumericIdentifierRule
|
||||
M: System.Int32 Vorbisfile::ov_fopen(System.String,System.IntPtr&)
|
||||
M: System.Int32 Vorbisfile::ov_open_callbacks(System.IntPtr,System.IntPtr&,System.IntPtr,System.IntPtr,Vorbisfile/ov_callbacks)
|
||||
M: Vorbisfile/vorbis_info Vorbisfile::ov_info(System.IntPtr,System.Int32)
|
||||
M: Vorbisfile/vorbis_comment Vorbisfile::ov_comment(System.IntPtr,System.Int32)
|
||||
M: System.Double Vorbisfile::ov_time_total(System.IntPtr,System.Int32)
|
||||
M: System.IntPtr Vorbisfile::ov_read(System.IntPtr,System.Byte[],System.Int32,System.Int32,System.Int32,System.Int32,System.Int32&)
|
||||
M: System.IntPtr Vorbisfile::ov_read(System.IntPtr,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32&)
|
||||
M: System.Int32 Vorbisfile::ov_time_seek(System.IntPtr,System.Double)
|
||||
M: System.Int32 Vorbisfile::ov_clear(System.IntPtr&)
|
||||
T: Vorbisfile/SeekWhence
|
||||
T: Vorbisfile/read_func
|
||||
T: Vorbisfile/seek_func
|
||||
T: Vorbisfile/close_func
|
||||
T: Vorbisfile/tell_func
|
||||
T: Vorbisfile/vorbis_info
|
||||
T: Vorbisfile/vorbis_comment
|
||||
T: Vorbisfile/ov_callbacks
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidRefAndOutParametersRule
|
||||
M: System.Int32 Vorbisfile::ov_fopen(System.String,System.IntPtr&)
|
||||
M: System.Int32 Vorbisfile::ov_open_callbacks(System.IntPtr,System.IntPtr&,System.IntPtr,System.IntPtr,Vorbisfile/ov_callbacks)
|
||||
M: System.Int32 Vorbisfile::ov_clear(System.IntPtr&)
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidVisibleFieldsRule
|
||||
T: Vorbisfile/vorbis_info
|
||||
T: Vorbisfile/vorbis_comment
|
||||
T: Vorbisfile/ov_callbacks
|
||||
|
||||
R: Gendarme.Rules.Design.AvoidVisibleNestedTypesRule
|
||||
T: Vorbisfile/SeekWhence
|
||||
T: Vorbisfile/read_func
|
||||
T: Vorbisfile/seek_func
|
||||
T: Vorbisfile/close_func
|
||||
T: Vorbisfile/tell_func
|
||||
T: Vorbisfile/vorbis_info
|
||||
T: Vorbisfile/vorbis_comment
|
||||
T: Vorbisfile/ov_callbacks
|
||||
|
||||
R: Gendarme.Rules.Interoperability.CentralizePInvokesIntoNativeMethodsTypeRule
|
||||
M: System.IntPtr Vorbisfile::malloc(System.IntPtr)
|
||||
M: System.Void Vorbisfile::free(System.IntPtr)
|
||||
M: System.Int32 Vorbisfile::INTERNAL_ov_fopen(System.String,System.IntPtr)
|
||||
M: System.Int32 Vorbisfile::INTERNAL_ov_open_callbacks(System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr,Vorbisfile/ov_callbacks)
|
||||
M: System.IntPtr Vorbisfile::INTERNAL_ov_info(System.IntPtr,System.Int32)
|
||||
M: System.IntPtr Vorbisfile::INTERNAL_ov_comment(System.IntPtr,System.Int32)
|
||||
M: System.Double Vorbisfile::ov_time_total(System.IntPtr,System.Int32)
|
||||
M: System.IntPtr Vorbisfile::ov_read(System.IntPtr,System.Byte[],System.Int32,System.Int32,System.Int32,System.Int32,System.Int32&)
|
||||
M: System.IntPtr Vorbisfile::ov_read(System.IntPtr,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32&)
|
||||
M: System.Int32 Vorbisfile::ov_time_seek(System.IntPtr,System.Double)
|
||||
M: System.Int32 Vorbisfile::INTERNAL_ov_clear(System.IntPtr)
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithAssemblyVersionRule
|
||||
A: Vorbisfile-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithCLSCompliantRule
|
||||
A: Vorbisfile-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Design.MarkAssemblyWithComVisibleRule
|
||||
A: Vorbisfile-CS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
|
||||
R: Gendarme.Rules.Security.NativeFieldsShouldNotBeVisibleRule
|
||||
T: Vorbisfile/vorbis_info
|
||||
T: Vorbisfile/vorbis_comment
|
||||
|
||||
R: Gendarme.Rules.Naming.UseCorrectCasingRule
|
||||
M: System.IntPtr Vorbisfile::malloc(System.IntPtr)
|
||||
M: System.Void Vorbisfile::free(System.IntPtr)
|
||||
M: System.Int32 Vorbisfile::ov_fopen(System.String,System.IntPtr&)
|
||||
M: System.Int32 Vorbisfile::ov_open_callbacks(System.IntPtr,System.IntPtr&,System.IntPtr,System.IntPtr,Vorbisfile/ov_callbacks)
|
||||
M: Vorbisfile/vorbis_info Vorbisfile::ov_info(System.IntPtr,System.Int32)
|
||||
M: Vorbisfile/vorbis_comment Vorbisfile::ov_comment(System.IntPtr,System.Int32)
|
||||
M: System.Double Vorbisfile::ov_time_total(System.IntPtr,System.Int32)
|
||||
M: System.IntPtr Vorbisfile::ov_read(System.IntPtr,System.Byte[],System.Int32,System.Int32,System.Int32,System.Int32,System.Int32&)
|
||||
M: System.IntPtr Vorbisfile::ov_read(System.IntPtr,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32&)
|
||||
M: System.Int32 Vorbisfile::ov_time_seek(System.IntPtr,System.Double)
|
||||
M: System.Int32 Vorbisfile::ov_clear(System.IntPtr&)
|
||||
T: Vorbisfile/read_func
|
||||
T: Vorbisfile/seek_func
|
||||
T: Vorbisfile/close_func
|
||||
T: Vorbisfile/tell_func
|
||||
T: Vorbisfile/vorbis_info
|
||||
T: Vorbisfile/vorbis_comment
|
||||
T: Vorbisfile/ov_callbacks
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
bin/
|
||||
obj/
|
||||
*.pidb
|
||||
*.userprefs
|
||||
*.suo
|
|
@ -0,0 +1,25 @@
|
|||
/* MojoShader# - C# Wrapper for MojoShader
|
||||
*
|
||||
* Copyright (c) 2014-2017 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>
|
||||
*
|
||||
*/
|
|
@ -0,0 +1,10 @@
|
|||
# Makefile for MojoShader#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
build: clean
|
||||
mkdir bin
|
||||
cp MojoShader-CS.dll.config bin
|
||||
dmcs /unsafe -debug -out:bin/MojoShader-CS.dll -target:library MojoShader.cs
|
||||
|
||||
clean:
|
||||
rm -rf bin
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{19767B10-6A26-42B4-9413-5738E49DF437}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MojoShader</RootNamespace>
|
||||
<AssemblyName>MojoShader-CS</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="MojoShader.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
<configuration>
|
||||
<dllmap os="windows" dll="MojoShader.dll" target="MojoShader.dll"/>
|
||||
<dllmap os="osx" dll="MojoShader.dll" target="libmojoshader.dylib"/>
|
||||
<dllmap os="linux" dll="MojoShader.dll" target="libmojoshader.so"/>
|
||||
</configuration>
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MojoShader-CS", "MojoShader-CS.csproj", "{19767B10-6A26-42B4-9413-5738E49DF437}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{19767B10-6A26-42B4-9413-5738E49DF437}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{19767B10-6A26-42B4-9413-5738E49DF437}.Debug|x86.Build.0 = Debug|x86
|
||||
{19767B10-6A26-42B4-9413-5738E49DF437}.Release|x86.ActiveCfg = Release|x86
|
||||
{19767B10-6A26-42B4-9413-5738E49DF437}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = MojoShader-CS.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,17 @@
|
|||
This is MojoShader#, a C# wrapper for MojoShader, a library to work with
|
||||
Direct3D shaders on alternate 3D APIs and non-Windows platforms.
|
||||
|
||||
License
|
||||
-------
|
||||
MojoShader# is released under the zlib license. See LICENSE for details.
|
||||
|
||||
About MojoShader
|
||||
----------------
|
||||
For more information about MojoShader, visit the website:
|
||||
|
||||
http://icculus.org/mojoshader/
|
||||
|
||||
About the C# Wrapper
|
||||
--------------------
|
||||
MojoShader# was written to be used for FNA's Effect shader support. We wrap this
|
||||
around MojoShader compiled as a shared library.
|
|
@ -0,0 +1,5 @@
|
|||
bin/
|
||||
obj/
|
||||
*.pidb
|
||||
*.userprefs
|
||||
*.suo
|
|
@ -0,0 +1,25 @@
|
|||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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>
|
||||
*
|
||||
*/
|
|
@ -0,0 +1,34 @@
|
|||
# Makefile for OpenAL#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
# Source Lists
|
||||
SRC = \
|
||||
src/ALC10.cs \
|
||||
src/ALC11.cs \
|
||||
src/AL10.cs \
|
||||
src/AL11.cs \
|
||||
src/ALEXT.cs \
|
||||
src/EFX.cs
|
||||
|
||||
# Targets
|
||||
|
||||
debug: clean-debug
|
||||
mkdir -p bin/Debug
|
||||
cp OpenAL-CS.dll.config bin/Debug
|
||||
dmcs /unsafe -debug -out:bin/Debug/OpenAL-CS.dll -target:library $(SRC)
|
||||
|
||||
clean-debug:
|
||||
rm -rf bin/Debug
|
||||
|
||||
release: clean-release
|
||||
mkdir -p bin/Release
|
||||
cp OpenAL-CS.dll.config bin/Release
|
||||
dmcs /unsafe -optimize -out:bin/Release/OpenAL-CS.dll -target:library $(SRC)
|
||||
|
||||
clean-release:
|
||||
rm -rf bin/Release
|
||||
|
||||
clean: clean-debug clean-release
|
||||
rm -rf bin
|
||||
|
||||
all: debug release
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4FF0E874-ADB4-4AE5-B059-DD6116C4A370}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>OpenAL</RootNamespace>
|
||||
<AssemblyName>OpenAL-CS</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="src\ALC10.cs" />
|
||||
<Compile Include="src\ALC11.cs" />
|
||||
<Compile Include="src\AL10.cs" />
|
||||
<Compile Include="src\AL11.cs" />
|
||||
<Compile Include="src\ALEXT.cs" />
|
||||
<Compile Include="src\EFX.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="OpenAL-CS.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<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,20 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAL-CS", "OpenAL-CS.csproj", "{4FF0E874-ADB4-4AE5-B059-DD6116C4A370}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4FF0E874-ADB4-4AE5-B059-DD6116C4A370}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{4FF0E874-ADB4-4AE5-B059-DD6116C4A370}.Debug|x86.Build.0 = Debug|x86
|
||||
{4FF0E874-ADB4-4AE5-B059-DD6116C4A370}.Release|x86.ActiveCfg = Release|x86
|
||||
{4FF0E874-ADB4-4AE5-B059-DD6116C4A370}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = OpenAL-CS.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,31 @@
|
|||
This is OpenAL#, a C# wrapper for OpenAL Soft.
|
||||
|
||||
Project Website: https://github.com/flibitijibibo/OpenAL-CS
|
||||
|
||||
License
|
||||
-------
|
||||
OpenAL# is released under the zlib license. See LICENSE for details.
|
||||
|
||||
OpenAL Soft, however, is released under the GNU LGPLv2. See below for details.
|
||||
|
||||
About OpenAL Soft
|
||||
-----------------
|
||||
For more information about OpenAL Soft and its license, visit the website:
|
||||
|
||||
http://kcat.strangesoft.net/openal.html
|
||||
|
||||
About the C# Wrapper
|
||||
--------------------
|
||||
The C# wrapper was written to be used for FNA's audio support. However, this
|
||||
is written in a way that can be used for any general C# application.
|
||||
|
||||
OpenAL# is a pure port of the C headers. The naming schemes for this library
|
||||
will be exactly as they are done in the C library, with little-to-no concern
|
||||
for "appropriate" C# style. The namespace indicates that this is OpenAL, the
|
||||
class names will indicate which OpenAL standard version the
|
||||
function/type/value exists in, and everything else will be as close to the C
|
||||
version as technically possible.
|
||||
|
||||
Also note that we do not use alGetProcAddress to obtain extension functions.
|
||||
Since this wrapper specifically supports OpenAL Soft only, we will be
|
||||
accessing the library's entry points directly.
|
|
@ -0,0 +1,593 @@
|
|||
#region License
|
||||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace OpenAL
|
||||
{
|
||||
public static class AL10
|
||||
{
|
||||
private const string nativeLibName = "soft_oal.dll";
|
||||
|
||||
/* typedef int ALenum; */
|
||||
public const int AL_NONE = 0x0000;
|
||||
public const int AL_FALSE = 0x0000;
|
||||
public const int AL_TRUE = 0x0001;
|
||||
|
||||
public const int AL_SOURCE_RELATIVE = 0x0202;
|
||||
|
||||
public const int AL_CONE_INNER_ANGLE = 0x1001;
|
||||
public const int AL_CONE_OUTER_ANGLE = 0x1002;
|
||||
|
||||
public const int AL_PITCH = 0x1003;
|
||||
public const int AL_POSITION = 0x1004;
|
||||
public const int AL_DIRECTION = 0x1005;
|
||||
public const int AL_VELOCITY = 0x1006;
|
||||
public const int AL_LOOPING = 0x1007;
|
||||
public const int AL_BUFFER = 0x1009;
|
||||
public const int AL_GAIN = 0x100A;
|
||||
public const int AL_MIN_GAIN = 0x100D;
|
||||
public const int AL_MAX_GAIN = 0x100E;
|
||||
public const int AL_ORIENTATION = 0x100F;
|
||||
|
||||
public const int AL_SOURCE_STATE = 0x1010;
|
||||
public const int AL_INITIAL = 0x1011;
|
||||
public const int AL_PLAYING = 0x1012;
|
||||
public const int AL_PAUSED = 0x1013;
|
||||
public const int AL_STOPPED = 0x1014;
|
||||
|
||||
public const int AL_BUFFERS_QUEUED = 0x1015;
|
||||
public const int AL_BUFFERS_PROCESSED = 0x1016;
|
||||
|
||||
public const int AL_REFERENCE_DISTANCE = 0x1020;
|
||||
public const int AL_ROLLOFF_FACTOR = 0x1021;
|
||||
public const int AL_CONE_OUTER_GAIN = 0x1022;
|
||||
|
||||
public const int AL_MAX_DISTANCE = 0x1023;
|
||||
|
||||
public const int AL_SOURCE_TYPE = 0x1027;
|
||||
public const int AL_STATIC = 0x1028;
|
||||
public const int AL_STREAMING = 0x1029;
|
||||
public const int AL_UNDETERMINED = 0x1030;
|
||||
|
||||
public const int AL_FORMAT_MONO8 = 0x1100;
|
||||
public const int AL_FORMAT_MONO16 = 0x1101;
|
||||
public const int AL_FORMAT_STEREO8 = 0x1102;
|
||||
public const int AL_FORMAT_STEREO16 = 0x1103;
|
||||
|
||||
public const int AL_FREQUENCY = 0x2001;
|
||||
public const int AL_BITS = 0x2002;
|
||||
public const int AL_CHANNELS = 0x2003;
|
||||
public const int AL_SIZE = 0x2004;
|
||||
|
||||
public const int AL_NO_ERROR = 0x0000;
|
||||
public const int AL_INVALID_NAME = 0xA001;
|
||||
public const int AL_INVALID_ENUM = 0xA002;
|
||||
public const int AL_INVALID_VALUE = 0xA003;
|
||||
public const int AL_INVALID_OPERATION = 0xA004;
|
||||
public const int AL_OUT_OF_MEMORY = 0xA005;
|
||||
|
||||
public const int AL_VENDOR = 0xB001;
|
||||
public const int AL_VERSION = 0xB002;
|
||||
public const int AL_RENDERER = 0xB003;
|
||||
public const int AL_EXTENSIONS = 0xB004;
|
||||
|
||||
public const int AL_DOPPLER_FACTOR = 0xC000;
|
||||
/* Deprecated! */
|
||||
public const int AL_DOPPLER_VELOCITY = 0xC001;
|
||||
|
||||
public const int AL_DISTANCE_MODEL = 0xD000;
|
||||
public const int AL_INVERSE_DISTANCE = 0xD001;
|
||||
public const int AL_INVERSE_DISTANCE_CLAMPED = 0xD002;
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDopplerFactor(float value);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDistanceModel(int distanceModel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alEnable(int capability);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDisable(int capability);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsEnabled(int capability);
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "alGetString", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_alGetString(int param);
|
||||
public static string alGetString(int param)
|
||||
{
|
||||
return Marshal.PtrToStringAnsi(INTERNAL_alGetString(param));
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBooleanv(int param, bool[] values);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetIntegerv(int param, int[] values);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetFloatv(int param, float[] values);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetDoublev(int param, double[] values);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alGetBoolean(int param);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int alGetInteger(int param);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float alGetFloat(int param);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern double alGetDouble(int param);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int alGetError();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsExtensionPresent(
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string extname
|
||||
);
|
||||
|
||||
/* IntPtr refers to a function pointer */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alGetProcAddress(
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string fname
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int alGetEnumValue(
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string ename
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alListenerf(
|
||||
int param,
|
||||
float value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alListener3f(
|
||||
int param,
|
||||
float value1,
|
||||
float value2,
|
||||
float value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alListenerfv(
|
||||
int param,
|
||||
float[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alListeneri(
|
||||
int param,
|
||||
int value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alListener3i(
|
||||
int param,
|
||||
int value1,
|
||||
int value2,
|
||||
int value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alListeneriv(
|
||||
int param,
|
||||
int[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetListenerf(
|
||||
int param,
|
||||
out float value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetListener3f(
|
||||
int param,
|
||||
out float value1,
|
||||
out float value2,
|
||||
out float value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetListenerfv(
|
||||
int param,
|
||||
float[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetListeneri(
|
||||
int param,
|
||||
out int value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetListener3i(
|
||||
int param,
|
||||
out int value1,
|
||||
out int value2,
|
||||
out int value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetListeneriv(
|
||||
int param,
|
||||
int[] values
|
||||
);
|
||||
|
||||
/* n refers to a ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenSources(int n, uint[] sources);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenSources(int n, out uint sources);
|
||||
|
||||
/* n refers to a ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteSources(int n, uint[] sources);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteSources(int n, ref uint sources);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsSource(uint source);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcef(
|
||||
uint source,
|
||||
int param,
|
||||
float value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSource3f(
|
||||
uint source,
|
||||
int param,
|
||||
float value1,
|
||||
float value2,
|
||||
float value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcefv(
|
||||
uint source,
|
||||
int param,
|
||||
float[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcei(
|
||||
uint source,
|
||||
int param,
|
||||
int value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSource3i(
|
||||
uint source,
|
||||
int param,
|
||||
int value1,
|
||||
int value2,
|
||||
int value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceiv(
|
||||
uint source,
|
||||
int param,
|
||||
int[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetSourcef(
|
||||
uint source,
|
||||
int param,
|
||||
out float value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetSource3f(
|
||||
uint source,
|
||||
int param,
|
||||
out float value1,
|
||||
out float value2,
|
||||
out float value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetSourcefv(
|
||||
uint source,
|
||||
int param,
|
||||
float[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetSourcei(
|
||||
uint source,
|
||||
int param,
|
||||
out int value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetSource3i(
|
||||
uint source,
|
||||
int param,
|
||||
out int value1,
|
||||
out int value2,
|
||||
out int value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetSourceiv(
|
||||
uint source,
|
||||
int param,
|
||||
int[] values
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcePlayv(
|
||||
int n,
|
||||
uint[] sources
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceStopv(
|
||||
int n,
|
||||
uint[] sources
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceRewindv(
|
||||
int n,
|
||||
uint[] sources
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcePausev(
|
||||
int n,
|
||||
uint[] sources
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcePlay(uint source);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceStop(uint source);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceRewind(uint source);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourcePause(uint source);
|
||||
|
||||
/* nb refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceQueueBuffers(
|
||||
uint source,
|
||||
int nb,
|
||||
uint[] buffers
|
||||
);
|
||||
|
||||
/* nb refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceQueueBuffers(
|
||||
uint source,
|
||||
int nb,
|
||||
ref uint buffers
|
||||
);
|
||||
|
||||
/* nb refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceUnqueueBuffers(
|
||||
uint source,
|
||||
int nb,
|
||||
uint[] buffers
|
||||
);
|
||||
|
||||
/* nb refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSourceUnqueueBuffers(
|
||||
uint source,
|
||||
int nb,
|
||||
ref uint buffers
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenBuffers(int n, uint[] buffers);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenBuffers(int n, out uint buffers);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteBuffers(int n, uint[] buffers);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteBuffers(int n, ref uint buffers);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsBuffer(uint buffer);
|
||||
|
||||
/* data refers to a void*, size and freq to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferData(
|
||||
uint buffer,
|
||||
int format,
|
||||
IntPtr data,
|
||||
int size,
|
||||
int freq
|
||||
);
|
||||
|
||||
/* size and freq refer to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferData(
|
||||
uint buffer,
|
||||
int format,
|
||||
byte[] data,
|
||||
int size,
|
||||
int freq
|
||||
);
|
||||
|
||||
/* size and freq refer to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferData(
|
||||
uint buffer,
|
||||
int format,
|
||||
short[] data,
|
||||
int size,
|
||||
int freq
|
||||
);
|
||||
|
||||
/* size and freq refer to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferData(
|
||||
uint buffer,
|
||||
int format,
|
||||
float[] data,
|
||||
int size,
|
||||
int freq
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferf(
|
||||
uint buffer,
|
||||
int param,
|
||||
float value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBuffer3f(
|
||||
uint buffer,
|
||||
int param,
|
||||
float value1,
|
||||
float value2,
|
||||
float value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferfv(
|
||||
uint buffer,
|
||||
int param,
|
||||
float[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferi(
|
||||
uint buffer,
|
||||
int param,
|
||||
int value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBuffer3i(
|
||||
uint buffer,
|
||||
int param,
|
||||
int value1,
|
||||
int value2,
|
||||
int value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alBufferiv(
|
||||
uint buffer,
|
||||
int param,
|
||||
int[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBufferf(
|
||||
uint buffer,
|
||||
int param,
|
||||
out float value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBuffer3f(
|
||||
uint buffer,
|
||||
int param,
|
||||
out float value1,
|
||||
out float value2,
|
||||
out float value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBufferfv(
|
||||
uint buffer,
|
||||
int param,
|
||||
float[] values
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBufferi(
|
||||
uint buffer,
|
||||
int param,
|
||||
out int value
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBuffer3i(
|
||||
uint buffer,
|
||||
int param,
|
||||
out int value1,
|
||||
out int value2,
|
||||
out int value3
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBufferiv(
|
||||
uint buffer,
|
||||
int param,
|
||||
int[] values
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
#region License
|
||||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace OpenAL
|
||||
{
|
||||
public static class AL11
|
||||
{
|
||||
private const string nativeLibName = "soft_oal.dll";
|
||||
|
||||
/* typedef int ALenum; */
|
||||
public const int AL_SEC_OFFSET = 0x1024;
|
||||
public const int AL_SAMPLE_OFFSET = 0x1025;
|
||||
public const int AL_BYTE_OFFSET = 0x1026;
|
||||
|
||||
public const int AL_SPEED_OF_SOUND = 0xC004;
|
||||
|
||||
public const int AL_LINEAR_DISTANCE = 0xD003;
|
||||
public const int AL_LINEAR_DISTANCE_CLAMPED = 0xD004;
|
||||
public const int AL_EXPONENT_DISTANCE = 0xD005;
|
||||
public const int AL_EXPONENT_DISTANCE_CLAMED = 0xD006;
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alSpeedOfSound(float value);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
#region License
|
||||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace OpenAL
|
||||
{
|
||||
public static class ALC10
|
||||
{
|
||||
private const string nativeLibName = "soft_oal.dll";
|
||||
|
||||
/* typedef int ALenum; */
|
||||
public const int ALC_FALSE = 0x0000;
|
||||
public const int ALC_TRUE = 0x0001;
|
||||
public const int ALC_FREQUENCY = 0x1007;
|
||||
public const int ALC_REFRESH = 0x1008;
|
||||
public const int ALC_SYNC = 0x1009;
|
||||
|
||||
public const int ALC_NO_ERROR = 0x0000;
|
||||
public const int ALC_INVALID_DEVICE = 0xA001;
|
||||
public const int ALC_INVALID_CONTEXT = 0xA002;
|
||||
public const int ALC_INVALID_ENUM = 0xA003;
|
||||
public const int ALC_INVALID_VALUE = 0xA004;
|
||||
public const int ALC_OUT_OF_MEMORY = 0xA005;
|
||||
|
||||
public const int ALC_ATTRIBUTES_SIZE = 0x1002;
|
||||
public const int ALC_ALL_ATTRIBUTES = 0x1003;
|
||||
public const int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
|
||||
public const int ALC_DEVICE_SPECIFIER = 0x1005;
|
||||
public const int ALC_EXTENSIONS = 0x1006;
|
||||
|
||||
/* IntPtr refers to an ALCcontext*, device to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcCreateContext(
|
||||
IntPtr device,
|
||||
int[] attrList
|
||||
);
|
||||
|
||||
/* context refers to an ALCcontext* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alcMakeContextCurrent(IntPtr context);
|
||||
|
||||
/* context refers to an ALCcontext* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcDestroyContext(IntPtr context);
|
||||
|
||||
/* IntPtr refers to an ALCcontext* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcGetCurrentContext();
|
||||
|
||||
/* IntPtr refers to an ALCdevice*, context to an ALCcontext* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcGetContextsDevice(IntPtr context);
|
||||
|
||||
/* IntPtr refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcOpenDevice(
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string devicename
|
||||
);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alcCloseDevice(IntPtr device);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int alcGetError(IntPtr device);
|
||||
|
||||
/* IntPtr refers to a function pointer, device to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcGetProcAddress(
|
||||
IntPtr device,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string funcname
|
||||
);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int alcGetEnumValue(
|
||||
IntPtr device,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string enumname
|
||||
);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcGetString(IntPtr device, int param);
|
||||
|
||||
/* device refers to an ALCdevice*, size to an ALCsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcGetIntegerv(
|
||||
IntPtr device,
|
||||
int param,
|
||||
int size,
|
||||
int[] values
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
#region License
|
||||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace OpenAL
|
||||
{
|
||||
public static class ALC11
|
||||
{
|
||||
private const string nativeLibName = "soft_oal.dll";
|
||||
|
||||
/* typedef int ALenum */
|
||||
public const int ALC_MONO_SOURCES = 0x1010;
|
||||
public const int ALC_STEREO_SOURCES = 0x1011;
|
||||
|
||||
public const int ALC_CAPTURE_DEVICE_SPECIFIER = 0x0310;
|
||||
public const int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x0311;
|
||||
public const int ALC_CAPTURE_SAMPLES = 0x0312;
|
||||
public const int ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012;
|
||||
public const int ALC_ALL_DEVICES_SPECIFIER = 0x1013;
|
||||
|
||||
/* context refers to an ALCcontext* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcProcessContext(IntPtr context);
|
||||
|
||||
/* context refers to an ALCcontext* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcSuspendContext(IntPtr context);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alcIsExtensionPresent(
|
||||
IntPtr device,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string extname
|
||||
);
|
||||
|
||||
/* IntPtr refers to an ALCdevice*, buffersize to an ALCsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr alcCaptureOpenDevice(
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string devicename,
|
||||
uint frequency,
|
||||
int format,
|
||||
int buffersize
|
||||
);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alcCaptureCloseDevice(IntPtr device);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcCaptureStart(IntPtr device);
|
||||
|
||||
/* device refers to an ALCdevice* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcCaptureStop(IntPtr device);
|
||||
|
||||
/* device refers to an ALCdevice*, samples to an ALCsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alcCaptureSamples(
|
||||
IntPtr device,
|
||||
IntPtr buffer,
|
||||
int samples
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
#region License
|
||||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace OpenAL
|
||||
{
|
||||
public static class ALEXT
|
||||
{
|
||||
private const string nativeLibName = "soft_oal.dll";
|
||||
|
||||
/* TODO: All OpenAL Soft extensions! Complete as needed. */
|
||||
|
||||
/* typedef int ALenum */
|
||||
public const int AL_FORMAT_MONO_FLOAT32 = 0x10010;
|
||||
public const int AL_FORMAT_STEREO_FLOAT32 = 0x10011;
|
||||
|
||||
public const int AL_LOOP_POINTS_SOFT = 0x2015;
|
||||
|
||||
public const int AL_UNPACK_BLOCK_ALIGNMENT_SOFT = 0x200C;
|
||||
public const int AL_PACK_BLOCK_ALIGNMENT_SOFT = 0x200D;
|
||||
|
||||
public const int AL_FORMAT_MONO_MSADPCM_SOFT = 0x1302;
|
||||
public const int AL_FORMAT_STEREO_MSADPCM_SOFT = 0x1303;
|
||||
|
||||
public const int AL_BYTE_SOFT = 0x1400;
|
||||
public const int AL_SHORT_SOFT = 0x1402;
|
||||
public const int AL_FLOAT_SOFT = 0x1406;
|
||||
|
||||
public const int AL_MONO_SOFT = 0x1500;
|
||||
public const int AL_STEREO_SOFT = 0x1501;
|
||||
|
||||
public const int AL_GAIN_LIMIT_SOFT = 0x200E;
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetBufferSamplesSOFT(
|
||||
uint buffer,
|
||||
int offset,
|
||||
int samples,
|
||||
int channels,
|
||||
int type,
|
||||
IntPtr data
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,435 @@
|
|||
#region License
|
||||
/* OpenAL# - C# Wrapper for OpenAL Soft
|
||||
*
|
||||
* Copyright (c) 2014-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace OpenAL
|
||||
{
|
||||
public static class EFX
|
||||
{
|
||||
private const string nativeLibName = "soft_oal.dll";
|
||||
|
||||
/* typedef int ALenum; */
|
||||
public const int AL_METERS_PER_UNIT = 0x20004;
|
||||
|
||||
public const int AL_DIRECT_FILTER = 0x20005;
|
||||
public const int AL_AUXILIARY_SEND_FILTER = 0x20006;
|
||||
public const int AL_AIR_ABSORPTION_FACTOR = 0x20007;
|
||||
public const int AL_ROOM_ROLLOFF_FACTOR = 0x20008;
|
||||
public const int AL_CONE_OUTER_GAINHF = 0x20009;
|
||||
public const int AL_DIRECT_FILTER_GAINHF_AUTO = 0x2000A;
|
||||
public const int AL_AUXILIARY_SEND_FILTER_GAIN_AUTO = 0x2000B;
|
||||
public const int AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO = 0x2000C;
|
||||
|
||||
public const int AL_REVERB_DENSITY = 0x0001;
|
||||
public const int AL_REVERB_DIFFUSION = 0x0002;
|
||||
public const int AL_REVERB_GAIN = 0x0003;
|
||||
public const int AL_REVERB_GAINHF = 0x0004;
|
||||
public const int AL_REVERB_DECAY_TIME = 0x0005;
|
||||
public const int AL_REVERB_DECAY_HFRATIO = 0x0006;
|
||||
public const int AL_REVERB_REFLECTIONS_GAIN = 0x0007;
|
||||
public const int AL_REVERB_REFLECTIONS_DELAY = 0x0008;
|
||||
public const int AL_REVERB_LATE_REVERB_GAIN = 0x0009;
|
||||
public const int AL_REVERB_LATE_REVERB_DELAY = 0x000A;
|
||||
public const int AL_REVERB_AIR_ABSORPTION_FACTOR = 0x000B;
|
||||
public const int AL_REVERB_ROOM_ROLLOFF_FACTOR = 0x000C;
|
||||
public const int AL_REVERB_DECAY_HFLIMIT = 0x000D;
|
||||
|
||||
public const int AL_EAXREVERB_DENSITY = 0x0001;
|
||||
public const int AL_EAXREVERB_DIFFUSION = 0x0002;
|
||||
public const int AL_EAXREVERB_GAIN = 0x0003;
|
||||
public const int AL_EAXREVERB_GAINHF = 0x0004;
|
||||
public const int AL_EAXREVERB_GAINLF = 0x0005;
|
||||
public const int AL_EAXREVERB_DECAY_TIME = 0x0006;
|
||||
public const int AL_EAXREVERB_DECAY_HFRATIO = 0x0007;
|
||||
public const int AL_EAXREVERB_DECAY_LFRATIO = 0x0008;
|
||||
public const int AL_EAXREVERB_REFLECTIONS_GAIN = 0x0009;
|
||||
public const int AL_EAXREVERB_REFLECTIONS_DELAY = 0x000A;
|
||||
public const int AL_EAXREVERB_REFLECTIONS_PAN = 0x000B;
|
||||
public const int AL_EAXREVERB_LATE_REVERB_GAIN = 0x000C;
|
||||
public const int AL_EAXREVERB_LATE_REVERB_DELAY = 0x000D;
|
||||
public const int AL_EAXREVERB_LATE_REVERT_PAN = 0x000E;
|
||||
public const int AL_EAXREVERB_ECHO_TIME = 0x000F;
|
||||
public const int AL_EAXREVERB_ECHO_DEPTH = 0x0010;
|
||||
public const int AL_EAXREVERB_MODULATION_TIME = 0x0011;
|
||||
public const int AL_EAXREVERB_MODULATION_DEPTH = 0x0012;
|
||||
public const int AL_EAXREVERB_AIR_ABSORPTION_GAINHF = 0x0013;
|
||||
public const int AL_EAXREVERB_HFREFERENCE = 0x0014;
|
||||
public const int AL_EAXREVERB_LFREFERENCE = 0x0015;
|
||||
public const int AL_EAXREVERB_ROOM_ROLLOFF_FACTOR = 0x0016;
|
||||
public const int AL_EAXREVERB_DECAY_HFLIMIT = 0x0017;
|
||||
|
||||
public const int AL_CHORUS_WAVEFORM = 0x0001;
|
||||
public const int AL_CHORUS_PHASE = 0x0002;
|
||||
public const int AL_CHORUS_RATE = 0x0003;
|
||||
public const int AL_CHORUS_DEPTH = 0x0004;
|
||||
public const int AL_CHORUS_FEEDBACK = 0x0005;
|
||||
public const int AL_CHORUS_DELAY = 0x0006;
|
||||
|
||||
public const int AL_DISTORTION_EDGE = 0x0001;
|
||||
public const int AL_DISTORTION_GAIN = 0x0002;
|
||||
public const int AL_DISTORTION_LOWPASS_CUTOFF = 0x0003;
|
||||
public const int AL_DISTORTION_EQCENTER = 0x0004;
|
||||
public const int AL_DISTORTION_EQBANDWIDTH = 0x0005;
|
||||
|
||||
public const int AL_ECHO_DELAY = 0x0001;
|
||||
public const int AL_ECHO_LRDELAY = 0x0002;
|
||||
public const int AL_ECHO_DAMPING = 0x0003;
|
||||
public const int AL_ECHO_FEEDBACK = 0x0004;
|
||||
public const int AL_ECHO_SPREAD = 0x0005;
|
||||
|
||||
public const int AL_FLANGER_WAVEFORM = 0x0001;
|
||||
public const int AL_FLANGER_PHASE = 0x0002;
|
||||
public const int AL_FLANGER_RATE = 0x0003;
|
||||
public const int AL_FLANGER_DEPTH = 0x0004;
|
||||
public const int AL_FLANGER_FEEDBACK = 0x0005;
|
||||
public const int AL_FLANGER_DELAY = 0x0006;
|
||||
|
||||
public const int AL_FREQUENCY_SHIFTER_FREQUENCY = 0x0001;
|
||||
public const int AL_FREQUENCY_SHIFTER_LEFT_DIRECTION = 0x0002;
|
||||
public const int AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION = 0x0003;
|
||||
|
||||
public const int AL_VOCAL_MORPHER_PHONEMEA = 0x0001;
|
||||
public const int AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING = 0x0002;
|
||||
public const int AL_VOCAL_MORPHER_PHONEMEB = 0x0003;
|
||||
public const int AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING = 0x0004;
|
||||
public const int AL_VOCAL_MORPHER_WAVEFORM = 0x0005;
|
||||
public const int AL_VOCAL_MORPHER_RATE = 0x0006;
|
||||
|
||||
public const int AL_PITCH_SHIFTER_COARSE_TUNE = 0x0001;
|
||||
public const int AL_PITCH_SHIFTER_FINE_TUNE = 0x0002;
|
||||
|
||||
public const int AL_RING_MODULATOR_FREQUENCY = 0x0001;
|
||||
public const int AL_RING_MODULATOR_HIGHPASS_CUTOFF = 0x0002;
|
||||
public const int AL_RING_MODULATOR_WAVEFORM = 0x0003;
|
||||
|
||||
public const int AL_AUTOWAH_ATTACK_TIME = 0x0001;
|
||||
public const int AL_AUTOWAH_RELEASE_TIME = 0x0002;
|
||||
public const int AL_AUTOWAH_RESONANCE = 0x0003;
|
||||
public const int AL_AUTOWAH_PEAK_GAIN = 0x0004;
|
||||
|
||||
public const int AL_COMPRESSOR_ONOFF = 0x0001;
|
||||
|
||||
public const int AL_EQUALIZER_LOW_GAIN = 0x0001;
|
||||
public const int AL_EQUALIZER_LOW_CUTOFF = 0x0002;
|
||||
public const int AL_EQUALIZER_MID1_GAIN = 0x0003;
|
||||
public const int AL_EQUALIZER_MID1_CENTER = 0x0004;
|
||||
public const int AL_EQUALIZER_MID1_WIDTH = 0x0005;
|
||||
public const int AL_EQUALIZER_MID2_GAIN = 0x0006;
|
||||
public const int AL_EQUALIZER_MID2_CENTER = 0x0007;
|
||||
public const int AL_EQUALIZER_MID2_WIDTH = 0x0008;
|
||||
public const int AL_EQUALIZER_HIGH_GAIN = 0x0009;
|
||||
public const int AL_EQUALIZER_HIGH_CUTOFF = 0x000A;
|
||||
|
||||
public const int AL_EFFECT_FIRST_PARAMETER = 0x0000;
|
||||
public const int AL_EFFECT_LAST_PARAMETER = 0x8000;
|
||||
public const int AL_EFFECT_TYPE = 0x8001;
|
||||
|
||||
public const int AL_EFFECT_NULL = 0x0000;
|
||||
public const int AL_EFFECT_REVERB = 0x0001;
|
||||
public const int AL_EFFECT_CHORUS = 0x0002;
|
||||
public const int AL_EFFECT_DISTORTION = 0x0003;
|
||||
public const int AL_EFFECT_ECHO = 0x0004;
|
||||
public const int AL_EFFECT_FLANGER = 0x0005;
|
||||
public const int AL_EFFECT_FREQUENCY_SHIFTER = 0x0006;
|
||||
public const int AL_EFFECT_VOCAL_MORPHER = 0x0007;
|
||||
public const int AL_EFFECT_PITCH_SHIFTER = 0x0008;
|
||||
public const int AL_EFFECT_RING_MODULATOR = 0x0009;
|
||||
public const int AL_EFFECT_AUTOWAH = 0x000A;
|
||||
public const int AL_EFFECT_COMPRESSOR = 0x000B;
|
||||
public const int AL_EFFECT_EQUALIZER = 0x000C;
|
||||
public const int AL_EFFECT_EAXREVERB = 0x8000;
|
||||
|
||||
public const int AL_EFFECTSLOT_EFFECT = 0x0001;
|
||||
public const int AL_EFFECTSLOT_GAIN = 0x0002;
|
||||
public const int AL_EFFECTSLOT_AUXILIARY_SEND_AUTO = 0x0003;
|
||||
|
||||
public const int AL_EFFECTSLOT_NULL = 0x0000;
|
||||
|
||||
public const int AL_LOWPASS_GAIN = 0x0001;
|
||||
public const int AL_LOWPASS_GAINHF = 0x0002;
|
||||
|
||||
public const int AL_HIGHPASS_GAIN = 0x0001;
|
||||
public const int AL_HIGHPASS_GAINLF = 0x0002;
|
||||
|
||||
public const int AL_BANDPASS_GAIN = 0x0001;
|
||||
public const int AL_BANDPASS_GAINLF = 0x0002;
|
||||
public const int AL_BANDPASS_GAINHF = 0x0003;
|
||||
|
||||
public const int AL_FILTER_FIRST_PARAMETER = 0x0000;
|
||||
public const int AL_FILTER_LAST_PARAMETER = 0x8000;
|
||||
public const int AL_FILTER_TYPE = 0x8001;
|
||||
|
||||
public const int AL_FILTER_NULL = 0x0000;
|
||||
public const int AL_FILTER_LOWPASS = 0x0001;
|
||||
public const int AL_FILTER_HIGHPASS = 0x0002;
|
||||
public const int AL_FILTER_BANDPASS = 0x0003;
|
||||
|
||||
/* TODO: EFX Default Value Constants! */
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenEffects(int n, uint[] effects);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenEffects(int n, out uint effects);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteEffects(int n, uint[] effects);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteEffects(int n, ref uint effects);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsEffect(uint effect);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alEffecti(
|
||||
uint effect,
|
||||
int param,
|
||||
int iValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alEffectiv(
|
||||
uint effect,
|
||||
int param,
|
||||
int[] iValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alEffectf(
|
||||
uint effect,
|
||||
int param,
|
||||
float flValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alEffectfv(
|
||||
uint effect,
|
||||
int param,
|
||||
float[] flValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetEffecti(
|
||||
uint effect,
|
||||
int param,
|
||||
out int piValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetEffectiv(
|
||||
uint effect,
|
||||
int param,
|
||||
int[] piValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetEffectf(
|
||||
uint effect,
|
||||
int param,
|
||||
out float pflValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetEffectfv(
|
||||
uint effect,
|
||||
int param,
|
||||
float[] pflValues
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenFilters(int n, uint[] filters);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenFilters(int n, out uint filters);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteFilters(int n, uint[] filters);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteFilters(int n, ref uint filters);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsFilter(uint filter);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alFilteri(
|
||||
uint filter,
|
||||
int param,
|
||||
int iValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alFilteriv(
|
||||
uint filter,
|
||||
int param,
|
||||
int[] iValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alFilterf(
|
||||
uint filter,
|
||||
int param,
|
||||
float flValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alFilterfv(
|
||||
uint filter,
|
||||
int param,
|
||||
float[] flValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetFilteri(
|
||||
uint filter,
|
||||
int param,
|
||||
out int piValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetFilteriv(
|
||||
uint filter,
|
||||
int param,
|
||||
int[] piValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetFilterf(
|
||||
uint filter,
|
||||
int param,
|
||||
out float pflValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetFilterfv(
|
||||
uint filter,
|
||||
int param,
|
||||
float[] pflValues
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenAuxiliaryEffectSlots(
|
||||
int n,
|
||||
uint[] effectslots
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGenAuxiliaryEffectSlots(
|
||||
int n,
|
||||
out uint effectslots
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteAuxiliaryEffectSlots(
|
||||
int n,
|
||||
uint[] effectslots
|
||||
);
|
||||
|
||||
/* n refers to an ALsizei. Overload provided to avoid uint[] alloc. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alDeleteAuxiliaryEffectSlots(
|
||||
int n,
|
||||
ref uint effectslots
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool alIsAuxiliaryEffectSlot(uint effectslot);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alAuxiliaryEffectSloti(
|
||||
uint effectslot,
|
||||
int param,
|
||||
int iValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alAuxiliaryEffectSlotiv(
|
||||
uint effectslot,
|
||||
int param,
|
||||
int[] iValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alAuxiliaryEffectSlotf(
|
||||
uint effectslot,
|
||||
int param,
|
||||
float flValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alAuxiliaryEffectSlotfv(
|
||||
uint effectslot,
|
||||
int param,
|
||||
float[] flValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetAuxiliaryEffectSloti(
|
||||
uint effectslot,
|
||||
int param,
|
||||
out int piValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetAuxiliaryEffectSlotiv(
|
||||
uint effectslot,
|
||||
int param,
|
||||
int[] piValues
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetAuxiliaryEffectSlotf(
|
||||
uint effectslot,
|
||||
int param,
|
||||
out float pflValue
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void alGetAuxiliaryEffectSlotfv(
|
||||
uint effectslot,
|
||||
int param,
|
||||
float[] pflValues
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
bin/
|
||||
obj/
|
||||
*.pidb
|
||||
*.userprefs
|
||||
*.suo
|
|
@ -0,0 +1,25 @@
|
|||
/* SDL2# - C# Wrapper for SDL2
|
||||
*
|
||||
* Copyright (c) 2013-2016 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>
|
||||
*
|
||||
*/
|
|
@ -0,0 +1,32 @@
|
|||
# Makefile for SDL2#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
# Source Lists
|
||||
SRC = \
|
||||
src/SDL2.cs \
|
||||
src/SDL2_image.cs \
|
||||
src/SDL2_mixer.cs \
|
||||
src/SDL2_ttf.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)
|
||||
|
||||
clean-debug:
|
||||
rm -rf bin/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)
|
||||
|
||||
clean-release:
|
||||
rm -rf bin/Release
|
||||
|
||||
clean: clean-debug clean-release
|
||||
rm -rf bin
|
||||
|
||||
all: debug release
|
|
@ -0,0 +1,48 @@
|
|||
This is SDL2#, a C# wrapper for SDL2.
|
||||
|
||||
Project Website: https://github.com/flibitijibibo/SDL2-CS
|
||||
|
||||
License
|
||||
-------
|
||||
SDL2 and SDL2# are released under the zlib license. See LICENSE for details.
|
||||
|
||||
About SDL2
|
||||
----------
|
||||
For more information about SDL2, visit the SDL wiki:
|
||||
|
||||
http://wiki.libsdl.org/moin.fcg/FrontPage
|
||||
|
||||
About the C# Wrapper
|
||||
--------------------
|
||||
The C# wrapper was written to be used for FNA's platform support. However, this
|
||||
is written in a way that can be used for any general C# application.
|
||||
|
||||
The wrapper provides bindings for the following libraries:
|
||||
- SDL2
|
||||
- SDL2_image
|
||||
- SDL2_mixer
|
||||
- SDL2_ttf
|
||||
|
||||
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.
|
||||
|
||||
SDL2# is a pure port of the C headers. The naming schemes for this library will
|
||||
be exactly as they are done in the C library, with little-to-no concern for
|
||||
"appropriate" C# style. The namespace indicates that this is SDL2, the class
|
||||
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.
|
||||
|
||||
About the Visual Studio Debugger
|
||||
--------------------------------
|
||||
When running C# applications under the Visual Studio debugger, native code that
|
||||
names threads with the 0x406D1388 exception will silently exit. To prevent this
|
||||
exception from being thrown by SDL, add this line before your SDL_Init call:
|
||||
|
||||
SDL.SDL_SetHint(SDL.SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1");
|
||||
|
||||
Roadmap
|
||||
-------
|
||||
To see the current roadmap for SDL2#, visit the GitHub issues page:
|
||||
|
||||
https://github.com/flibitijibibo/SDL2-CS/issues
|
|
@ -0,0 +1,24 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableDefaultItems>false</EnableDefaultItems>
|
||||
<AssemblyName>SDL2-CS</AssemblyName>
|
||||
<RootNamespace>SDL2</RootNamespace>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="src\SDL2.cs" />
|
||||
<Compile Include="src\SDL2_image.cs" />
|
||||
<Compile Include="src\SDL2_mixer.cs" />
|
||||
<Compile Include="src\SDL2_ttf.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="SDL2-CS.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{85480198-8711-4355-830E-72FD794AD3F6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>SDL2</RootNamespace>
|
||||
<AssemblyName>SDL2-CS</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="src\SDL2.cs" />
|
||||
<Compile Include="src\SDL2_image.cs" />
|
||||
<Compile Include="src\SDL2_mixer.cs" />
|
||||
<Compile Include="src\SDL2_ttf.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="SDL2-CS.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<dllmap dll="SDL2.dll" os="windows" target="SDL2.dll"/>
|
||||
<dllmap dll="SDL2.dll" os="osx" target="libSDL2-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2.dll" os="linux" target="libSDL2-2.0.so.0"/>
|
||||
|
||||
<dllmap dll="SDL2_image.dll" os="windows" target="SDL2_image.dll"/>
|
||||
<dllmap dll="SDL2_image.dll" os="osx" target="libSDL2_image-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_image.dll" os="linux" target="libSDL2_image-2.0.so.0"/>
|
||||
|
||||
<dllmap dll="SDL2_mixer.dll" os="windows" target="SDL2_mixer.dll"/>
|
||||
<dllmap dll="SDL2_mixer.dll" os="osx" target="libSDL2_mixer-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_mixer.dll" os="linux" target="libSDL2_mixer-2.0.so.0"/>
|
||||
|
||||
<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"/>
|
||||
</configuration>
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL2-CS", "SDL2-CS.csproj", "{85480198-8711-4355-830E-72FD794AD3F6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Debug|x64.Build.0 = Debug|x64
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Debug|x86.Build.0 = Debug|x86
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Release|x64.ActiveCfg = Release|x64
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Release|x64.Build.0 = Release|x64
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Release|x86.ActiveCfg = Release|x86
|
||||
{85480198-8711-4355-830E-72FD794AD3F6}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = SDL2-CS.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,240 @@
|
|||
#region License
|
||||
/* SDL2# - C# Wrapper for SDL2
|
||||
*
|
||||
* Copyright (c) 2013-2016 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace SDL2
|
||||
{
|
||||
public static class SDL_image
|
||||
{
|
||||
#region SDL2# Variables
|
||||
|
||||
/* Used by DllImport to load the native library. */
|
||||
private const string nativeLibName = "SDL2_image.dll";
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDL_image.h
|
||||
|
||||
/* Similar to the headers, this is the version we're expecting to be
|
||||
* running with. You will likely want to check this somewhere in your
|
||||
* program!
|
||||
*/
|
||||
public const int SDL_IMAGE_MAJOR_VERSION = 2;
|
||||
public const int SDL_IMAGE_MINOR_VERSION = 0;
|
||||
public const int SDL_IMAGE_PATCHLEVEL = 2;
|
||||
|
||||
[Flags]
|
||||
public enum IMG_InitFlags
|
||||
{
|
||||
IMG_INIT_JPG = 0x00000001,
|
||||
IMG_INIT_PNG = 0x00000002,
|
||||
IMG_INIT_TIF = 0x00000004,
|
||||
IMG_INIT_WEBP = 0x00000008
|
||||
}
|
||||
|
||||
public static void SDL_IMAGE_VERSION(out SDL.SDL_version X)
|
||||
{
|
||||
X.major = SDL_IMAGE_MAJOR_VERSION;
|
||||
X.minor = SDL_IMAGE_MINOR_VERSION;
|
||||
X.patch = SDL_IMAGE_PATCHLEVEL;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_Linked_Version", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_IMG_Linked_Version();
|
||||
public static SDL.SDL_version IMG_Linked_Version()
|
||||
{
|
||||
SDL.SDL_version result;
|
||||
IntPtr result_ptr = INTERNAL_IMG_Linked_Version();
|
||||
result = (SDL.SDL_version) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
typeof(SDL.SDL_version)
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int IMG_Init(IMG_InitFlags flags);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void IMG_Quit();
|
||||
|
||||
/* IntPtr refers to an SDL_Surface* */
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_Load", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_IMG_Load(
|
||||
byte[] file
|
||||
);
|
||||
public static IntPtr IMG_Load(string file)
|
||||
{
|
||||
return INTERNAL_IMG_Load(SDL.UTF8_ToNative(file));
|
||||
}
|
||||
|
||||
/* src refers to an SDL_RWops*, IntPtr to an SDL_Surface* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr IMG_Load_RW(
|
||||
IntPtr src,
|
||||
int freesrc
|
||||
);
|
||||
|
||||
/* src refers to an SDL_RWops*, IntPtr to an SDL_Surface* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_LoadTyped_RW", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_IMG_LoadTyped_RW(
|
||||
IntPtr src,
|
||||
int freesrc,
|
||||
byte[] type
|
||||
);
|
||||
public static IntPtr IMG_LoadTyped_RW(
|
||||
IntPtr src,
|
||||
int freesrc,
|
||||
string type
|
||||
) {
|
||||
return INTERNAL_IMG_LoadTyped_RW(
|
||||
src,
|
||||
freesrc,
|
||||
SDL.UTF8_ToNative(type)
|
||||
);
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_LoadTexture", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_IMG_LoadTexture(
|
||||
IntPtr renderer,
|
||||
byte[] file
|
||||
);
|
||||
public static IntPtr IMG_LoadTexture(
|
||||
IntPtr renderer,
|
||||
string file
|
||||
) {
|
||||
return INTERNAL_IMG_LoadTexture(
|
||||
renderer,
|
||||
SDL.UTF8_ToNative(file)
|
||||
);
|
||||
}
|
||||
|
||||
/* renderer refers to an SDL_Renderer*.
|
||||
* src refers to an SDL_RWops*.
|
||||
* IntPtr to an SDL_Texture*.
|
||||
*/
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr IMG_LoadTexture_RW(
|
||||
IntPtr renderer,
|
||||
IntPtr src,
|
||||
int freesrc
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*.
|
||||
* src refers to an SDL_RWops*.
|
||||
* IntPtr to an SDL_Texture*.
|
||||
*/
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_LoadTextureTyped_RW", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_IMG_LoadTextureTyped_RW(
|
||||
IntPtr renderer,
|
||||
IntPtr src,
|
||||
int freesrc,
|
||||
byte[] type
|
||||
);
|
||||
public static IntPtr IMG_LoadTextureTyped_RW(
|
||||
IntPtr renderer,
|
||||
IntPtr src,
|
||||
int freesrc,
|
||||
string type
|
||||
) {
|
||||
return INTERNAL_IMG_LoadTextureTyped_RW(
|
||||
renderer,
|
||||
src,
|
||||
freesrc,
|
||||
SDL.UTF8_ToNative(type)
|
||||
);
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Surface* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr IMG_ReadXPMFromArray(
|
||||
[In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)]
|
||||
string[] xpm
|
||||
);
|
||||
|
||||
/* surface refers to an SDL_Surface* */
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_SavePNG", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_IMG_SavePNG(
|
||||
IntPtr surface,
|
||||
byte[] file
|
||||
);
|
||||
public static int IMG_SavePNG(IntPtr surface, string file)
|
||||
{
|
||||
return INTERNAL_IMG_SavePNG(
|
||||
surface,
|
||||
SDL.UTF8_ToNative(file)
|
||||
);
|
||||
}
|
||||
|
||||
/* surface refers to an SDL_Surface*, dst to an SDL_RWops* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int IMG_SavePNG_RW(
|
||||
IntPtr surface,
|
||||
IntPtr dst,
|
||||
int freedst
|
||||
);
|
||||
|
||||
/* surface refers to an SDL_Surface* */
|
||||
[DllImport(nativeLibName, EntryPoint = "IMG_SaveJPG", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_IMG_SaveJPG(
|
||||
IntPtr surface,
|
||||
byte[] file,
|
||||
int quality
|
||||
);
|
||||
public static int IMG_SaveJPG(IntPtr surface, string file, int quality)
|
||||
{
|
||||
return INTERNAL_IMG_SaveJPG(
|
||||
surface,
|
||||
SDL.UTF8_ToNative(file),
|
||||
quality
|
||||
);
|
||||
}
|
||||
|
||||
/* surface refers to an SDL_Surface*, dst to an SDL_RWops* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int IMG_SaveJPG_RW(
|
||||
IntPtr surface,
|
||||
IntPtr dst,
|
||||
int freedst,
|
||||
int quality
|
||||
);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,515 @@
|
|||
#region License
|
||||
/* SDL2# - C# Wrapper for SDL2
|
||||
*
|
||||
* Copyright (c) 2013-2016 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace SDL2
|
||||
{
|
||||
public static class SDL_mixer
|
||||
{
|
||||
#region SDL2# Variables
|
||||
|
||||
/* Used by DllImport to load the native library. */
|
||||
private const string nativeLibName = "SDL2_mixer.dll";
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDL_mixer.h
|
||||
|
||||
/* Similar to the headers, this is the version we're expecting to be
|
||||
* running with. You will likely want to check this somewhere in your
|
||||
* program!
|
||||
*/
|
||||
public const int SDL_MIXER_MAJOR_VERSION = 2;
|
||||
public const int SDL_MIXER_MINOR_VERSION = 0;
|
||||
public const int SDL_MIXER_PATCHLEVEL = 2;
|
||||
|
||||
/* In C, you can redefine this value before including SDL_mixer.h.
|
||||
* We're not going to allow this in SDL2#, since the value of this
|
||||
* variable is persistent and not dependent on preprocessor ordering.
|
||||
*/
|
||||
public const int MIX_CHANNELS = 8;
|
||||
|
||||
public static readonly int MIX_DEFAULT_FREQUENCY = 22050;
|
||||
public static readonly ushort MIX_DEFAULT_FORMAT =
|
||||
BitConverter.IsLittleEndian ? SDL.AUDIO_S16LSB : SDL.AUDIO_S16MSB;
|
||||
public static readonly int MIX_DEFAULT_CHANNELS = 2;
|
||||
public static readonly byte MIX_MAX_VOLUME = 128;
|
||||
|
||||
[Flags]
|
||||
public enum MIX_InitFlags
|
||||
{
|
||||
MIX_INIT_FLAC = 0x00000001,
|
||||
MIX_INIT_MOD = 0x00000002,
|
||||
MIX_INIT_MP3 = 0x00000008,
|
||||
MIX_INIT_OGG = 0x00000010,
|
||||
MIX_INIT_MID = 0x00000020,
|
||||
}
|
||||
|
||||
public enum Mix_Fading
|
||||
{
|
||||
MIX_NO_FADING,
|
||||
MIX_FADING_OUT,
|
||||
MIX_FADING_IN
|
||||
}
|
||||
|
||||
public enum Mix_MusicType
|
||||
{
|
||||
MUS_NONE,
|
||||
MUS_CMD,
|
||||
MUS_WAV,
|
||||
MUS_MOD,
|
||||
MUS_MID,
|
||||
MUS_OGG,
|
||||
MUS_MP3,
|
||||
MUS_MP3_MAD,
|
||||
MUS_FLAC,
|
||||
MUS_MODPLUG
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void MixFuncDelegate(
|
||||
IntPtr udata, // void*
|
||||
IntPtr stream, // Uint8*
|
||||
int len
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void Mix_EffectFunc_t(
|
||||
int chan,
|
||||
IntPtr stream, // void*
|
||||
int len,
|
||||
IntPtr udata // void*
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void Mix_EffectDone_t(
|
||||
int chan,
|
||||
IntPtr udata // void*
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void MusicFinishedDelegate();
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void ChannelFinishedDelegate(int channel);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate int SoundFontDelegate(
|
||||
IntPtr a, // const char*
|
||||
IntPtr b // void*
|
||||
);
|
||||
|
||||
public static void SDL_MIXER_VERSION(out SDL.SDL_version X)
|
||||
{
|
||||
X.major = SDL_MIXER_MAJOR_VERSION;
|
||||
X.minor = SDL_MIXER_MINOR_VERSION;
|
||||
X.patch = SDL_MIXER_PATCHLEVEL;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "MIX_Linked_Version", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_MIX_Linked_Version();
|
||||
public static SDL.SDL_version MIX_Linked_Version()
|
||||
{
|
||||
SDL.SDL_version result;
|
||||
IntPtr result_ptr = INTERNAL_MIX_Linked_Version();
|
||||
result = (SDL.SDL_version) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
typeof(SDL.SDL_version)
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_Init(MIX_InitFlags flags);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_Quit();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_OpenAudio(
|
||||
int frequency,
|
||||
ushort format,
|
||||
int channels,
|
||||
int chunksize
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_AllocateChannels(int numchans);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_QuerySpec(
|
||||
out int frequency,
|
||||
out ushort format,
|
||||
out int channels
|
||||
);
|
||||
|
||||
/* src refers to an SDL_RWops*, IntPtr to a Mix_Chunk* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Mix_LoadWAV_RW(
|
||||
IntPtr src,
|
||||
int freesrc
|
||||
);
|
||||
|
||||
/* IntPtr refers to a Mix_Chunk* */
|
||||
/* This is an RWops macro in the C header. */
|
||||
public static IntPtr Mix_LoadWAV(string file)
|
||||
{
|
||||
IntPtr rwops = SDL.INTERNAL_SDL_RWFromFile(file, "rb");
|
||||
return Mix_LoadWAV_RW(rwops, 1);
|
||||
}
|
||||
|
||||
/* IntPtr refers to a Mix_Music* */
|
||||
[DllImport(nativeLibName, EntryPoint = "Mix_LoadMUS", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_Mix_LoadMUS(
|
||||
byte[] file
|
||||
);
|
||||
public static IntPtr Mix_LoadMUS(string file)
|
||||
{
|
||||
return INTERNAL_Mix_LoadMUS(SDL.UTF8_ToNative(file));
|
||||
}
|
||||
|
||||
/* IntPtr refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Mix_QuickLoad_WAV(
|
||||
[In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1)]
|
||||
byte[] mem
|
||||
);
|
||||
|
||||
/* IntPtr refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Mix_QuickLoad_RAW(
|
||||
[In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
|
||||
byte[] mem,
|
||||
uint len
|
||||
);
|
||||
|
||||
/* chunk refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_FreeChunk(IntPtr chunk);
|
||||
|
||||
/* music refers to a Mix_Music* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_FreeMusic(IntPtr music);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GetNumChunkDecoders();
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "Mix_GetChunkDecoder", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_Mix_GetChunkDecoder(int index);
|
||||
public static string Mix_GetChunkDecoder(int index)
|
||||
{
|
||||
return SDL.UTF8_ToManaged(
|
||||
INTERNAL_Mix_GetChunkDecoder(index)
|
||||
);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GetNumMusicDecoders();
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "Mix_GetMusicDecoder", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_Mix_GetMusicDecoder(int index);
|
||||
public static string Mix_GetMusicDecoder(int index)
|
||||
{
|
||||
return SDL.UTF8_ToManaged(
|
||||
INTERNAL_Mix_GetMusicDecoder(index)
|
||||
);
|
||||
}
|
||||
|
||||
/* music refers to a Mix_Music* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mix_MusicType Mix_GetMusicType(IntPtr music);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_SetPostMix(
|
||||
MixFuncDelegate mix_func,
|
||||
IntPtr arg // void*
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_HookMusic(
|
||||
MixFuncDelegate mix_func,
|
||||
IntPtr arg // void*
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_HookMusicFinished(
|
||||
MusicFinishedDelegate music_finished
|
||||
);
|
||||
|
||||
/* IntPtr refers to a void* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Mix_GetMusicHookData();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_ChannelFinished(
|
||||
ChannelFinishedDelegate channel_finished
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_RegisterEffect(
|
||||
int chan,
|
||||
Mix_EffectFunc_t f,
|
||||
Mix_EffectDone_t d,
|
||||
IntPtr arg // void*
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_UnregisterEffect(
|
||||
int channel,
|
||||
Mix_EffectFunc_t f
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_UnregisterAllEffects(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_SetPanning(
|
||||
int channel,
|
||||
byte left,
|
||||
byte right
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_SetPosition(
|
||||
int channel,
|
||||
short angle,
|
||||
byte distance
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_SetDistance(int channel, byte distance);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_SetReverseStereo(int channel, int flip);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_ReserveChannels(int num);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GroupChannel(int which, int tag);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GroupChannels(int from, int to, int tag);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GroupAvailable(int tag);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GroupCount(int tag);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GroupOldest(int tag);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GroupNewer(int tag);
|
||||
|
||||
/* chunk refers to a Mix_Chunk* */
|
||||
public static int Mix_PlayChannel(
|
||||
int channel,
|
||||
IntPtr chunk,
|
||||
int loops
|
||||
) {
|
||||
return Mix_PlayChannelTimed(channel, chunk, loops, -1);
|
||||
}
|
||||
|
||||
/* chunk refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_PlayChannelTimed(
|
||||
int channel,
|
||||
IntPtr chunk,
|
||||
int loops,
|
||||
int ticks
|
||||
);
|
||||
|
||||
/* music refers to a Mix_Music* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_PlayMusic(IntPtr music, int loops);
|
||||
|
||||
/* music refers to a Mix_Music* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_FadeInMusic(
|
||||
IntPtr music,
|
||||
int loops,
|
||||
int ms
|
||||
);
|
||||
|
||||
/* music refers to a Mix_Music* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_FadeInMusicPos(
|
||||
IntPtr music,
|
||||
int loops,
|
||||
int ms,
|
||||
double position
|
||||
);
|
||||
|
||||
/* chunk refers to a Mix_Chunk* */
|
||||
public static int Mix_FadeInChannel(
|
||||
int channel,
|
||||
IntPtr chunk,
|
||||
int loops,
|
||||
int ms
|
||||
) {
|
||||
return Mix_FadeInChannelTimed(channel, chunk, loops, ms, -1);
|
||||
}
|
||||
|
||||
/* chunk refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_FadeInChannelTimed(
|
||||
int channel,
|
||||
IntPtr chunk,
|
||||
int loops,
|
||||
int ms,
|
||||
int ticks
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_Volume(int channel, int volume);
|
||||
|
||||
/* chunk refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_VolumeChunk(
|
||||
IntPtr chunk,
|
||||
int volume
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_VolumeMusic(int volume);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_HaltChannel(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_HaltGroup(int tag);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_HaltMusic();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_ExpireChannel(int channel, int ticks);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_FadeOutChannel(int which, int ms);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_FadeOutGroup(int tag, int ms);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_FadeOutMusic(int ms);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mix_Fading Mix_FadingMusic();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mix_Fading Mix_FadingChannel(int which);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_Pause(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_Resume(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_Paused(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_PauseMusic();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_ResumeMusic();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_RewindMusic();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_PausedMusic();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_SetMusicPosition(double position);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_Playing(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_PlayingMusic();
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "Mix_SetMusicCMD", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_Mix_SetMusicCMD(
|
||||
byte[] command
|
||||
);
|
||||
public static int Mix_SetMusicCMD(string command)
|
||||
{
|
||||
return INTERNAL_Mix_SetMusicCMD(
|
||||
SDL.UTF8_ToNative(command)
|
||||
);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_SetSynchroValue(int value);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_GetSynchroValue();
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "Mix_SetSoundFonts", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_Mix_SetSoundFonts(
|
||||
byte[] paths
|
||||
);
|
||||
public static int Mix_SetSoundFonts(string paths)
|
||||
{
|
||||
return INTERNAL_Mix_SetSoundFonts(
|
||||
SDL.UTF8_ToNative(paths)
|
||||
);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "Mix_GetSoundFonts", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_Mix_GetSoundFonts();
|
||||
public static string Mix_GetSoundFonts()
|
||||
{
|
||||
return SDL.UTF8_ToManaged(INTERNAL_Mix_GetSoundFonts());
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Mix_EachSoundFont(
|
||||
SoundFontDelegate function,
|
||||
IntPtr data // void*
|
||||
);
|
||||
|
||||
/* IntPtr refers to a Mix_Chunk* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Mix_GetChunk(int channel);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_CloseAudio();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,488 @@
|
|||
#region License
|
||||
/* SDL2# - C# Wrapper for SDL2
|
||||
*
|
||||
* Copyright (c) 2013-2016 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace SDL2
|
||||
{
|
||||
public static class SDL_ttf
|
||||
{
|
||||
#region SDL2# Variables
|
||||
|
||||
/* Used by DllImport to load the native library. */
|
||||
private const string nativeLibName = "SDL2_ttf.dll";
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDL_ttf.h
|
||||
|
||||
/* Similar to the headers, this is the version we're expecting to be
|
||||
* running with. You will likely want to check this somewhere in your
|
||||
* program!
|
||||
*/
|
||||
public const int SDL_TTF_MAJOR_VERSION = 2;
|
||||
public const int SDL_TTF_MINOR_VERSION = 0;
|
||||
public const int SDL_TTF_PATCHLEVEL = 12;
|
||||
|
||||
public const int UNICODE_BOM_NATIVE = 0xFEFF;
|
||||
public const int UNICODE_BOM_SWAPPED = 0xFFFE;
|
||||
|
||||
public const int TTF_STYLE_NORMAL = 0x00;
|
||||
public const int TTF_STYLE_BOLD = 0x01;
|
||||
public const int TTF_STYLE_ITALIC = 0x02;
|
||||
public const int TTF_STYLE_UNDERLINE = 0x04;
|
||||
public const int TTF_STYLE_STRIKETHROUGH = 0x08;
|
||||
|
||||
public const int TTF_HINTING_NORMAL = 0;
|
||||
public const int TTF_HINTING_LIGHT = 1;
|
||||
public const int TTF_HINTING_MONO = 2;
|
||||
public const int TTF_HINTING_NONE = 3;
|
||||
|
||||
public static void SDL_TTF_VERSION(out SDL.SDL_version X)
|
||||
{
|
||||
X.major = SDL_TTF_MAJOR_VERSION;
|
||||
X.minor = SDL_TTF_MINOR_VERSION;
|
||||
X.patch = SDL_TTF_PATCHLEVEL;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_LinkedVersion", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_LinkedVersion();
|
||||
public static SDL.SDL_version TTF_LinkedVersion()
|
||||
{
|
||||
SDL.SDL_version result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_LinkedVersion();
|
||||
result = (SDL.SDL_version) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
typeof(SDL.SDL_version)
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_ByteSwappedUNICODE(int swapped);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_Init();
|
||||
|
||||
/* IntPtr refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_OpenFont", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_OpenFont(
|
||||
byte[] file,
|
||||
int ptsize
|
||||
);
|
||||
public static IntPtr TTF_OpenFont(string file, int ptsize)
|
||||
{
|
||||
return INTERNAL_TTF_OpenFont(
|
||||
SDL.UTF8_ToNative(file),
|
||||
ptsize
|
||||
);
|
||||
}
|
||||
|
||||
/* src refers to an SDL_RWops*, IntPtr to a TTF_Font* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_OpenFontRW(
|
||||
IntPtr src,
|
||||
int freesrc,
|
||||
int ptsize
|
||||
);
|
||||
|
||||
/* IntPtr refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_OpenFontIndex", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_OpenFontIndex(
|
||||
byte[] file,
|
||||
int ptsize,
|
||||
long index
|
||||
);
|
||||
public static IntPtr TTF_OpenFontIndex(
|
||||
string file,
|
||||
int ptsize,
|
||||
long index
|
||||
) {
|
||||
return INTERNAL_TTF_OpenFontIndex(
|
||||
SDL.UTF8_ToNative(file),
|
||||
ptsize,
|
||||
index
|
||||
);
|
||||
}
|
||||
|
||||
/* src refers to an SDL_RWops*, IntPtr to a TTF_Font* */
|
||||
/* THIS IS A PUBLIC RWops FUNCTION! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_OpenFontIndexRW(
|
||||
IntPtr src,
|
||||
int freesrc,
|
||||
int ptsize,
|
||||
long index
|
||||
);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_GetFontStyle(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_SetFontStyle(IntPtr font, int style);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_GetFontOutline(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_SetFontOutline(IntPtr font, int outline);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_GetFontHinting(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_SetFontHinting(IntPtr font, int hinting);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_FontHeight(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_FontAscent(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_FontDescent(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_FontLineSkip(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_GetFontKerning(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_SetFontKerning(IntPtr font, int allowed);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern long TTF_FontFaces(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_FontFaceIsFixedWidth(IntPtr font);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_FontFaceFamilyName", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_FontFaceFamilyName(
|
||||
IntPtr font
|
||||
);
|
||||
public static string TTF_FontFaceFamilyName(IntPtr font)
|
||||
{
|
||||
return SDL.UTF8_ToManaged(
|
||||
INTERNAL_TTF_FontFaceFamilyName(font)
|
||||
);
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_FontFaceStyleName", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_FontFaceStyleName(
|
||||
IntPtr font
|
||||
);
|
||||
public static string TTF_FontFaceStyleName(IntPtr font)
|
||||
{
|
||||
return SDL.UTF8_ToManaged(
|
||||
INTERNAL_TTF_FontFaceStyleName(font)
|
||||
);
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_GlyphIsProvided(IntPtr font, ushort ch);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_GlyphMetrics(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
out int minx,
|
||||
out int maxx,
|
||||
out int miny,
|
||||
out int maxy,
|
||||
out int advance
|
||||
);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_SizeText(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
out int w,
|
||||
out int h
|
||||
);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_SizeUTF8", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int INTERNAL_TTF_SizeUTF8(
|
||||
IntPtr font,
|
||||
byte[] text,
|
||||
out int w,
|
||||
out int h
|
||||
);
|
||||
public static int TTF_SizeUTF8(
|
||||
IntPtr font,
|
||||
string text,
|
||||
out int w,
|
||||
out int h
|
||||
) {
|
||||
return INTERNAL_TTF_SizeUTF8(
|
||||
font,
|
||||
SDL.UTF8_ToNative(text),
|
||||
out w,
|
||||
out h
|
||||
);
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_SizeUNICODE(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPWStr)]
|
||||
string text,
|
||||
out int w,
|
||||
out int h
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderText_Solid(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Solid", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Solid(
|
||||
IntPtr font,
|
||||
byte[] text,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
public static IntPtr TTF_RenderUTF8_Solid(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL.SDL_Color fg
|
||||
) {
|
||||
return INTERNAL_TTF_RenderUTF8_Solid(
|
||||
font,
|
||||
SDL.UTF8_ToNative(text),
|
||||
fg
|
||||
);
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderUNICODE_Solid(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPWStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderGlyph_Solid(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderText_Shaded(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg,
|
||||
SDL.SDL_Color bg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Shaded", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Shaded(
|
||||
IntPtr font,
|
||||
byte[] text,
|
||||
SDL.SDL_Color fg,
|
||||
SDL.SDL_Color bg
|
||||
);
|
||||
public static IntPtr TTF_RenderUTF8_Shaded(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL.SDL_Color fg,
|
||||
SDL.SDL_Color bg
|
||||
) {
|
||||
return INTERNAL_TTF_RenderUTF8_Shaded(
|
||||
font,
|
||||
SDL.UTF8_ToNative(text),
|
||||
fg,
|
||||
bg
|
||||
);
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderUNICODE_Shaded(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPWStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg,
|
||||
SDL.SDL_Color bg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderGlyph_Shaded(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL.SDL_Color fg,
|
||||
SDL.SDL_Color bg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderText_Blended(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Blended", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Blended(
|
||||
IntPtr font,
|
||||
byte[] text,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
public static IntPtr TTF_RenderUTF8_Blended(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL.SDL_Color fg
|
||||
) {
|
||||
return INTERNAL_TTF_RenderUTF8_Blended(
|
||||
font,
|
||||
SDL.UTF8_ToNative(text),
|
||||
fg
|
||||
);
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderUNICODE_Blended(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPWStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderText_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg,
|
||||
uint wrapped
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
byte[] text,
|
||||
SDL.SDL_Color fg,
|
||||
uint wrapped
|
||||
);
|
||||
public static IntPtr TTF_RenderUTF8_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL.SDL_Color fg,
|
||||
uint wrapped
|
||||
) {
|
||||
return INTERNAL_TTF_RenderUTF8_Blended_Wrapped(
|
||||
font,
|
||||
SDL.UTF8_ToNative(text),
|
||||
fg,
|
||||
wrapped
|
||||
);
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderUNICODE_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
[In()] [MarshalAs(UnmanagedType.LPWStr)]
|
||||
string text,
|
||||
SDL.SDL_Color fg,
|
||||
uint wrapped
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TTF_RenderGlyph_Blended(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL.SDL_Color fg
|
||||
);
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_CloseFont(IntPtr font);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TTF_Quit();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TTF_WasInit();
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_GetFontKerningSize(
|
||||
IntPtr font,
|
||||
int prev_index,
|
||||
int index
|
||||
);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/* Theorafile - Ogg Theora Video Decoder Library
|
||||
*
|
||||
* Copyright (c) 2017 Ethan Lee.
|
||||
* Based on TheoraPlay, Copyright (c) 2011-2016 Ryan C. Gordon.
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
*/
|
|
@ -0,0 +1,26 @@
|
|||
# Makefile for Theorafile
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
# System information
|
||||
UNAME = $(shell uname)
|
||||
|
||||
# Compiler
|
||||
ifeq ($(UNAME), Darwin)
|
||||
CC += -arch i386 -arch x86_64 -mmacosx-version-min=10.6
|
||||
TARGET = dylib
|
||||
else
|
||||
TARGET = so
|
||||
endif
|
||||
|
||||
# Dependencies
|
||||
DEPS = -logg -lvorbis -ltheoradec
|
||||
|
||||
# Targets
|
||||
all: clean
|
||||
$(CC) -O2 -fpic -fPIC -shared -o libtheorafile.$(TARGET) theorafile.c $(DEPS) -Wall -pedantic
|
||||
|
||||
clean:
|
||||
rm -f libtheorafile.$(TARGET)
|
||||
|
||||
test:
|
||||
$(CC) -g -o theorafile-test sdl2test/sdl2test.c theorafile.c -I. `sdl2-config --cflags --libs` $(DEPS) -Wall
|
|
@ -0,0 +1,24 @@
|
|||
This is Theorafile, a library for quickly and easily decoding Ogg Theora videos.
|
||||
|
||||
Project Website: https://github.com/FNA-XNA/Theorafile
|
||||
|
||||
License
|
||||
-------
|
||||
Theorafile is released under the zlib license. See LICENSE for details.
|
||||
|
||||
About Theorafile
|
||||
-----------------
|
||||
Theorafile was written to be used for FNA's VideoPlayer. We access this library
|
||||
via Theorafile#, which you can find in the 'csharp/' directory.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
Theorafile depends on libogg, libvorbis, and libtheoradec.
|
||||
|
||||
Theorafile's "sdl2test" test program requires SDL2.
|
||||
|
||||
Building Theorafile
|
||||
-------------------
|
||||
For *nix platforms, just type `make` in the root directory!
|
||||
|
||||
For Windows, see the 'visualc/' directory.
|
|
@ -0,0 +1,25 @@
|
|||
/* Theorafile# - C# Wrapper for Theorafile
|
||||
*
|
||||
* Copyright (c) 2017 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>
|
||||
*
|
||||
*/
|
|
@ -0,0 +1,10 @@
|
|||
# Makefile for Theorafile#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
build: clean
|
||||
mkdir bin
|
||||
cp Theorafile-CS.dll.config bin
|
||||
dmcs /unsafe -debug -out:bin/Theorafile-CS.dll -target:library Theorafile.cs
|
||||
|
||||
clean:
|
||||
rm -rf bin
|
|
@ -0,0 +1,17 @@
|
|||
This is Theorafile#, a C# wrapper for Theorafile, a library for quickly and
|
||||
easily decoding Ogg Theora videos.
|
||||
|
||||
Project Website: https://github.com/FNA-XNA/Theorafile
|
||||
|
||||
License
|
||||
-------
|
||||
Theorafile# is released under the zlib license. See LICENSE for details.
|
||||
|
||||
About Theorafile#
|
||||
-----------------
|
||||
Theorafile# was written to be used for FNA's VideoPlayer. We wrap this around
|
||||
Theorafile compiled as a shared library.
|
||||
|
||||
Building Theorafile#
|
||||
--------------------
|
||||
Just type `make` in the root directory!
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{47CF0C2E-3710-4188-BB11-30D248B2B5FB}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Theorafile</RootNamespace>
|
||||
<AssemblyName>Theorafile-CS</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Theorafile.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Theorafile-CS.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
<configuration>
|
||||
<dllmap os="windows" dll="libtheorafile.dll" target="libtheorafile.dll"/>
|
||||
<dllmap os="osx" dll="libtheorafile.dll" target="libtheorafile.dylib"/>
|
||||
<dllmap os="linux" dll="libtheorafile.dll" target="libtheorafile.so"/>
|
||||
</configuration>
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Theorafile-CS", "Theorafile-CS.csproj", "{47CF0C2E-3710-4188-BB11-30D248B2B5FB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Debug|x86.Build.0 = Debug|x86
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Release|x86.ActiveCfg = Release|x86
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Theorafile-CS.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,238 @@
|
|||
/* Theorafile# - C# Wrapper for Theorafile
|
||||
*
|
||||
* Copyright (c) 2017 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>
|
||||
*
|
||||
*/
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
public static class Theorafile
|
||||
{
|
||||
#region Native Library Name
|
||||
|
||||
const string nativeLibName = "libtheorafile.dll";
|
||||
|
||||
#endregion
|
||||
|
||||
#region UTF8 Marshaling
|
||||
|
||||
private static byte[] UTF8_ToNative(string s)
|
||||
{
|
||||
if (s == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Add a null terminator. That's kind of it... :/
|
||||
return System.Text.Encoding.UTF8.GetBytes(s + '\0');
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region malloc/free Entry Points
|
||||
|
||||
// Yes, we're seriously using these. -flibit
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr malloc(IntPtr size);
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern void free(IntPtr memblock);
|
||||
|
||||
#endregion
|
||||
|
||||
#region C stdio Macros
|
||||
|
||||
// Used by ov_callbacks, seek_func
|
||||
public enum SeekWhence : int
|
||||
{
|
||||
// Add TF_ prefix to prevent C macro conflicts
|
||||
TF_SEEK_SET = 0,
|
||||
TF_SEEK_CUR = 1,
|
||||
TF_SEEK_END = 2
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Theorafile Delegates
|
||||
|
||||
/* IntPtr refers to a size_t */
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate IntPtr read_func(
|
||||
IntPtr ptr, // Refers to a void*
|
||||
IntPtr size, // Refers to a size_t
|
||||
IntPtr nmemb, // Refers to a size_t
|
||||
IntPtr datasource // Refers to a void*
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate int seek_func(
|
||||
IntPtr datasource, // Refers to a void*
|
||||
long offset, // Refers to an ogg_int64_t
|
||||
SeekWhence whence
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate int close_func(
|
||||
IntPtr datasource // Refers to a void*
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Theorafile Structures
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct tf_callbacks
|
||||
{
|
||||
public read_func read_func;
|
||||
public seek_func seek_func;
|
||||
public close_func close_func;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Theorafile Implementation
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "tf_open_callbacks", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_tf_open_callbacks(
|
||||
IntPtr datasource,
|
||||
IntPtr file,
|
||||
tf_callbacks io
|
||||
);
|
||||
public static int tf_open_callbacks(
|
||||
IntPtr datasource,
|
||||
out IntPtr file,
|
||||
tf_callbacks io
|
||||
) {
|
||||
file = AllocTheoraFile();
|
||||
return INTERNAL_tf_open_callbacks(datasource, file, io);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "tf_fopen", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_tf_fopen(
|
||||
byte[] fname,
|
||||
IntPtr file
|
||||
);
|
||||
public static int tf_fopen(string fname, out IntPtr file)
|
||||
{
|
||||
file = AllocTheoraFile();
|
||||
return INTERNAL_tf_fopen(UTF8_ToNative(fname), file);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "tf_close", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_tf_close(IntPtr file);
|
||||
public static int tf_close(ref IntPtr file)
|
||||
{
|
||||
int result = INTERNAL_tf_close(file);
|
||||
free(file);
|
||||
file = IntPtr.Zero;
|
||||
return result;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int tf_hasaudio(IntPtr file);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int tf_hasvideo(IntPtr file);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void tf_videoinfo(
|
||||
IntPtr file,
|
||||
out int width,
|
||||
out int height,
|
||||
out double fps
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void tf_audioinfo(
|
||||
IntPtr file,
|
||||
out int channels,
|
||||
out int samplerate
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int tf_eos(IntPtr file);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void tf_reset(IntPtr file);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int tf_readvideo(IntPtr file, IntPtr buffer, int numframes);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int tf_readaudio(IntPtr file, IntPtr buffer, int length);
|
||||
|
||||
#endregion
|
||||
|
||||
#region OggTheora_File Allocator
|
||||
|
||||
/* Notice that we did not implement an OggTheora_File struct, but are
|
||||
* instead using a pointer natively malloc'd.
|
||||
*
|
||||
* C# Interop for Xiph structs is basically impossible to do, so
|
||||
* we just alloc what _should_ be the full size of the structure for
|
||||
* the OS and architecture, then pass that around as if that's a real
|
||||
* struct. The size is just what you get from sizeof(OggTheora_File).
|
||||
*
|
||||
* Don't get mad at me, get mad at C#.
|
||||
*
|
||||
* -flibit
|
||||
*/
|
||||
|
||||
private static IntPtr AllocTheoraFile()
|
||||
{
|
||||
// Do not attempt to understand these numbers at all costs!
|
||||
const int size32 = 1160;
|
||||
const int size64Unix = 1472;
|
||||
const int size64Windows = 1328;
|
||||
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
if (IntPtr.Size == 4)
|
||||
{
|
||||
/* Technically this could be a little bit smaller, but
|
||||
* some 32-bit architectures may be higher even on Unix
|
||||
* targets (like ARMv7).
|
||||
* -flibit
|
||||
*/
|
||||
return malloc((IntPtr) size32);
|
||||
}
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
if (platform == PlatformID.Unix)
|
||||
{
|
||||
return malloc((IntPtr) size64Unix);
|
||||
}
|
||||
else if (platform == PlatformID.Win32NT)
|
||||
{
|
||||
return malloc((IntPtr) size64Windows);
|
||||
}
|
||||
throw new NotSupportedException("Unhandled platform!");
|
||||
}
|
||||
throw new NotSupportedException("Unhandled architecture!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
GL_PROC(void, glDepthMask, (GLenum a))
|
||||
GL_PROC(void, glDisable, (GLenum a))
|
||||
GL_PROC(void, glPixelStorei, (GLenum a, GLint b))
|
||||
GL_PROC(void, glGenTextures, (GLsizei a, GLuint *b))
|
||||
GL_PROC(void, glActiveTexture, (GLenum a))
|
||||
GL_PROC(void, glBindTexture, (GLenum a, GLuint b))
|
||||
GL_PROC(void, glTexImage2D, (GLenum a, GLint b, GLint c, GLsizei d, GLsizei e, GLint f, GLenum g, GLenum h, const GLvoid *i))
|
||||
GL_PROC(void, glTexSubImage2D, (GLenum a, GLint b, GLint c, GLint d, GLsizei e, GLsizei f, GLenum g, GLenum h, const GLvoid *i))
|
||||
GL_PROC(void, glTexParameteri, (GLenum a, GLenum b, GLint c))
|
||||
GL_PROC(GLuint, glCreateShader, (GLenum a))
|
||||
GL_PROC(void, glShaderSource, (GLuint a, GLsizei b, const GLchar *const*c, const GLint *d))
|
||||
GL_PROC(void, glCompileShader, (GLuint a))
|
||||
GL_PROC(GLuint, glCreateProgram, (void))
|
||||
GL_PROC(void, glAttachShader, (GLuint a, GLuint b))
|
||||
GL_PROC(void, glBindAttribLocation, (GLuint a, GLuint b, const GLchar *c))
|
||||
GL_PROC(void, glLinkProgram, (GLuint a))
|
||||
GL_PROC(void, glDeleteShader, (GLuint a))
|
||||
GL_PROC(void, glUseProgram, (GLuint a))
|
||||
GL_PROC(void, glUniform1i, (GLint a, GLint b))
|
||||
GL_PROC(GLint, glGetUniformLocation, (GLuint a, const GLchar *b))
|
||||
GL_PROC(void, glVertexAttribPointer, (GLuint a, GLint b, GLenum c, GLboolean d, GLsizei e, const void *f))
|
||||
GL_PROC(void, glEnableVertexAttribArray, (GLuint a))
|
||||
GL_PROC(void, glDrawArrays, (GLenum a, GLint b, GLsizei c))
|
||||
GL_PROC(void, glDeleteProgram, (GLuint a))
|
||||
GL_PROC(void, glDeleteTextures, (GLsizei a, const GLuint *b))
|
|
@ -0,0 +1,25 @@
|
|||
#define glDepthMask INTERNAL_glDepthMask
|
||||
#define glDisable INTERNAL_glDisable
|
||||
#define glPixelStorei INTERNAL_glPixelStorei
|
||||
#define glGenTextures INTERNAL_glGenTextures
|
||||
#define glActiveTexture INTERNAL_glActiveTexture
|
||||
#define glBindTexture INTERNAL_glBindTexture
|
||||
#define glTexImage2D INTERNAL_glTexImage2D
|
||||
#define glTexSubImage2D INTERNAL_glTexSubImage2D
|
||||
#define glTexParameteri INTERNAL_glTexParameteri
|
||||
#define glCreateShader INTERNAL_glCreateShader
|
||||
#define glShaderSource INTERNAL_glShaderSource
|
||||
#define glCompileShader INTERNAL_glCompileShader
|
||||
#define glCreateProgram INTERNAL_glCreateProgram
|
||||
#define glAttachShader INTERNAL_glAttachShader
|
||||
#define glBindAttribLocation INTERNAL_glBindAttribLocation
|
||||
#define glLinkProgram INTERNAL_glLinkProgram
|
||||
#define glDeleteShader INTERNAL_glDeleteShader
|
||||
#define glUseProgram INTERNAL_glUseProgram
|
||||
#define glUniform1i INTERNAL_glUniform1i
|
||||
#define glGetUniformLocation INTERNAL_glGetUniformLocation
|
||||
#define glVertexAttribPointer INTERNAL_glVertexAttribPointer
|
||||
#define glEnableVertexAttribArray INTERNAL_glEnableVertexAttribArray
|
||||
#define glDrawArrays INTERNAL_glDrawArrays
|
||||
#define glDeleteProgram INTERNAL_glDeleteProgram
|
||||
#define glDeleteTextures INTERNAL_glDeleteTextures
|
|
@ -0,0 +1,365 @@
|
|||
/* Theorafile - Ogg Theora Video Decoder Library
|
||||
*
|
||||
* Copyright (c) 2017 Ethan Lee.
|
||||
* Based on TheoraPlay, Copyright (c) 2011-2016 Ryan C. Gordon.
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_main.h>
|
||||
#include <SDL_opengl.h>
|
||||
#include "theorafile.h"
|
||||
|
||||
/* GL Function typedefs */
|
||||
#define GL_PROC(ret, func, parms) \
|
||||
typedef ret (GLAPIENTRY *glfntype_##func) parms;
|
||||
#include "glfuncs.h"
|
||||
#undef GL_PROC
|
||||
/* GL Function declarations */
|
||||
#define GL_PROC(ret, func, parms) \
|
||||
glfntype_##func INTERNAL_##func;
|
||||
#include "glfuncs.h"
|
||||
#undef GL_PROC
|
||||
|
||||
static const GLchar *GLVert =
|
||||
"#version 110\n"
|
||||
"attribute vec2 pos;\n"
|
||||
"attribute vec2 tex;\n"
|
||||
"void main() {\n"
|
||||
"gl_Position = vec4(pos.xy, 0.0, 1.0);\n"
|
||||
"gl_TexCoord[0].xy = tex;\n"
|
||||
"}\n";
|
||||
|
||||
/* This shader was originally from SDL 1.3 */
|
||||
static const GLchar *GLFrag =
|
||||
"#version 110\n"
|
||||
"uniform sampler2D samp0;\n"
|
||||
"uniform sampler2D samp1;\n"
|
||||
"uniform sampler2D samp2;\n"
|
||||
"const vec3 offset = vec3(-0.0625, -0.5, -0.5);\n"
|
||||
"const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n"
|
||||
"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n"
|
||||
"const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n"
|
||||
"void main() {\n"
|
||||
" vec2 tcoord;\n"
|
||||
" vec3 yuv, rgb;\n"
|
||||
" tcoord = gl_TexCoord[0].xy;\n"
|
||||
" yuv.x = texture2D(samp0, tcoord).r;\n"
|
||||
" yuv.y = texture2D(samp1, tcoord).r;\n"
|
||||
" yuv.z = texture2D(samp2, tcoord).r;\n"
|
||||
" yuv += offset;\n"
|
||||
" rgb.r = dot(yuv, Rcoeff);\n"
|
||||
" rgb.g = dot(yuv, Gcoeff);\n"
|
||||
" rgb.b = dot(yuv, Bcoeff);\n"
|
||||
" gl_FragColor = vec4(rgb, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
void AudioCallback(void *userdata, Uint8* stream, int len)
|
||||
{
|
||||
const int samples = len / 4;
|
||||
int read = tf_readaudio((OggTheora_File*) userdata, (float*) stream, samples);
|
||||
if (read < samples)
|
||||
{
|
||||
SDL_memset(stream + read * 4, '\0', (samples - read) * 4);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* SDL variables */
|
||||
SDL_Window *window;
|
||||
SDL_GLContext context;
|
||||
SDL_AudioDeviceID audio;
|
||||
SDL_AudioSpec spec;
|
||||
SDL_Event evt;
|
||||
Uint8 run = 1;
|
||||
|
||||
/* Theorafile variables */
|
||||
OggTheora_File fileIn;
|
||||
int width, height, channels, samplerate;
|
||||
double fps;
|
||||
int curframe = 0, thisframe, newframe;
|
||||
char *frame = NULL;
|
||||
|
||||
/* OpenGL variables */
|
||||
GLuint yuvTextures[3];
|
||||
GLuint vertex = 0;
|
||||
GLuint fragment = 0;
|
||||
GLuint program = 0;
|
||||
GLint shaderlen = 0;
|
||||
|
||||
/* Vertex client arrays */
|
||||
static struct { float pos[2]; float tex[2]; } verts[4] = {
|
||||
{ { -1.0f, 1.0f }, { 0.0f, 0.0f } },
|
||||
{ { 1.0f, 1.0f }, { 1.0f, 0.0f } },
|
||||
{ { -1.0f, -1.0f }, { 0.0f, 1.0f } },
|
||||
{ { 1.0f, -1.0f }, { 1.0f, 1.0f } }
|
||||
};
|
||||
|
||||
/* We need a file name! */
|
||||
if (argc < 2 || argc > 2)
|
||||
{
|
||||
SDL_Log("Need a file name!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Open the Theora file */
|
||||
if (tf_fopen(argv[1], &fileIn) < 0)
|
||||
{
|
||||
SDL_Log("Failed to open file.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This is a video test, people! */
|
||||
if (!tf_hasvideo(&fileIn))
|
||||
{
|
||||
SDL_Log("No video!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Get the video metadata, allocate first frame */
|
||||
tf_videoinfo(&fileIn, &width, &height, &fps);
|
||||
frame = (char*) SDL_malloc(width * height * 2);
|
||||
while (!tf_readvideo(&fileIn, frame, 1));
|
||||
|
||||
/* Create window (and audio device, if applicable) */
|
||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||
window = SDL_CreateWindow(
|
||||
"Theorafile Test",
|
||||
SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED,
|
||||
width,
|
||||
height,
|
||||
SDL_WINDOW_OPENGL
|
||||
);
|
||||
context = SDL_GL_CreateContext(window);
|
||||
SDL_GL_SetSwapInterval(1);
|
||||
|
||||
/* GL function loading */
|
||||
#define GL_PROC(ret, func, parms) \
|
||||
INTERNAL_##func = (glfntype_##func) SDL_GL_GetProcAddress(#func);
|
||||
#include "glfuncs.h"
|
||||
#undef GL_PROC
|
||||
|
||||
/* Remap GL function names to internal entry points */
|
||||
#include "glmacros.h"
|
||||
|
||||
if (tf_hasaudio(&fileIn))
|
||||
{
|
||||
/* Get the audio metadata, allocate queue */
|
||||
tf_audioinfo(&fileIn, &channels, &samplerate);
|
||||
SDL_zero(spec);
|
||||
spec.freq = samplerate;
|
||||
spec.format = AUDIO_F32;
|
||||
spec.channels = channels;
|
||||
spec.samples = 4096;
|
||||
spec.callback = AudioCallback;
|
||||
spec.userdata = &fileIn;
|
||||
audio = SDL_OpenAudioDevice(
|
||||
NULL,
|
||||
0,
|
||||
&spec,
|
||||
NULL,
|
||||
0
|
||||
);
|
||||
SDL_PauseAudioDevice(audio, 0);
|
||||
}
|
||||
|
||||
/* Initial GL state */
|
||||
glDepthMask(GL_FALSE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
/* YUV buffers */
|
||||
glGenTextures(3, yuvTextures);
|
||||
#define GEN_TEXTURE(index, w, h, ptr) \
|
||||
glActiveTexture(GL_TEXTURE0 + index); \
|
||||
glBindTexture(GL_TEXTURE_2D, yuvTextures[index]); \
|
||||
glTexImage2D( \
|
||||
GL_TEXTURE_2D, \
|
||||
0, \
|
||||
GL_LUMINANCE8, \
|
||||
w, \
|
||||
h, \
|
||||
0, \
|
||||
GL_LUMINANCE, \
|
||||
GL_UNSIGNED_BYTE, \
|
||||
ptr \
|
||||
); \
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); \
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); \
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); \
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); \
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); \
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
GEN_TEXTURE(
|
||||
0,
|
||||
width,
|
||||
height,
|
||||
frame
|
||||
)
|
||||
GEN_TEXTURE(
|
||||
1,
|
||||
width / 2,
|
||||
height / 2,
|
||||
frame + (width * height)
|
||||
)
|
||||
GEN_TEXTURE(
|
||||
2,
|
||||
width / 2,
|
||||
height / 2,
|
||||
frame + (width * height) + (width / 2 * height / 2)
|
||||
)
|
||||
#undef GEN_TEXTURE
|
||||
|
||||
/* Vertex shader... */
|
||||
shaderlen = (GLint) SDL_strlen(GLVert);
|
||||
vertex = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(vertex, 1, &GLVert, &shaderlen);
|
||||
glCompileShader(vertex);
|
||||
|
||||
/* Fragment shader... */
|
||||
shaderlen = (GLint) SDL_strlen(GLFrag);
|
||||
fragment = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(fragment, 1, &GLFrag, &shaderlen);
|
||||
glCompileShader(fragment);
|
||||
|
||||
/* Program object... */
|
||||
program = glCreateProgram();
|
||||
glAttachShader(program, vertex);
|
||||
glAttachShader(program, fragment);
|
||||
glBindAttribLocation(program, 0, "pos");
|
||||
glBindAttribLocation(program, 1, "tex");
|
||||
glLinkProgram(program);
|
||||
glDeleteShader(vertex);
|
||||
glDeleteShader(fragment);
|
||||
|
||||
/* ... Finally. */
|
||||
glUseProgram(program);
|
||||
glUniform1i(glGetUniformLocation(program, "samp0"), 0);
|
||||
glUniform1i(glGetUniformLocation(program, "samp1"), 1);
|
||||
glUniform1i(glGetUniformLocation(program, "samp2"), 2);
|
||||
|
||||
/* Vertex buffers */
|
||||
glVertexAttribPointer(0, 2, GL_FLOAT, 0, sizeof (verts[0]), &verts[0].pos[0]);
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, 0, sizeof (verts[0]), &verts[0].tex[0]);
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
|
||||
while (run)
|
||||
{
|
||||
while (SDL_PollEvent(&evt))
|
||||
{
|
||||
if (evt.type == SDL_QUIT)
|
||||
{
|
||||
run = 0;
|
||||
}
|
||||
else if (evt.type == SDL_KEYDOWN)
|
||||
{
|
||||
/* Slowdown simulator */
|
||||
SDL_Delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop this video! */
|
||||
SDL_LockAudioDevice(audio);
|
||||
if (tf_eos(&fileIn))
|
||||
{
|
||||
tf_reset(&fileIn);
|
||||
}
|
||||
SDL_UnlockAudioDevice(audio);
|
||||
|
||||
/* Based on when we started, what frame should we be on? */
|
||||
thisframe = (int) (SDL_GetTicks() / (1000.0 / fps));
|
||||
if (thisframe > curframe)
|
||||
{
|
||||
/* Keep reading frames until we're caught up */
|
||||
SDL_LockAudioDevice(audio);
|
||||
newframe = tf_readvideo(&fileIn, frame, thisframe - curframe);
|
||||
SDL_UnlockAudioDevice(audio);
|
||||
curframe = thisframe;
|
||||
|
||||
/* Only update the textures if we need to! */
|
||||
if (newframe)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glTexSubImage2D(
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
width,
|
||||
height,
|
||||
GL_LUMINANCE,
|
||||
GL_UNSIGNED_BYTE,
|
||||
frame
|
||||
);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glTexSubImage2D(
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
width / 2,
|
||||
height / 2,
|
||||
GL_LUMINANCE,
|
||||
GL_UNSIGNED_BYTE,
|
||||
frame + (width * height)
|
||||
);
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glTexSubImage2D(
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
width / 2,
|
||||
height / 2,
|
||||
GL_LUMINANCE,
|
||||
GL_UNSIGNED_BYTE,
|
||||
frame + (width * height) + (width / 2 * height / 2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw! */
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
SDL_GL_SwapWindow(window);
|
||||
}
|
||||
|
||||
/* Clean up. We out. */
|
||||
glDeleteProgram(program);
|
||||
glDeleteTextures(3, yuvTextures);
|
||||
SDL_free(frame);
|
||||
if (tf_hasaudio(&fileIn))
|
||||
{
|
||||
SDL_CloseAudioDevice(audio);
|
||||
}
|
||||
tf_close(&fileIn);
|
||||
SDL_GL_DeleteContext(context);
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
SDL_Log("Test complete.\n");
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,573 @@
|
|||
/* Theorafile - Ogg Theora Video Decoder Library
|
||||
*
|
||||
* Copyright (c) 2017 Ethan Lee.
|
||||
* Based on TheoraPlay, Copyright (c) 2011-2016 Ryan C. Gordon.
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "theorafile.h"
|
||||
|
||||
#include <stdio.h> /* fopen and friends */
|
||||
#include <string.h> /* memcpy, memset */
|
||||
|
||||
#define TF_DEFAULT_BUFFER_SIZE 4096
|
||||
|
||||
#ifdef _WIN32
|
||||
#define inline __inline
|
||||
#endif /* _WIN32 */
|
||||
|
||||
static inline int INTERNAL_readOggData(OggTheora_File *file)
|
||||
{
|
||||
long buflen = TF_DEFAULT_BUFFER_SIZE;
|
||||
char *buffer = ogg_sync_buffer(&file->sync, buflen);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
/* If you made it here, you ran out of RAM (wait, what?) */
|
||||
return -1;
|
||||
}
|
||||
|
||||
buflen = file->io.read_func(buffer, 1, buflen, file->datasource);
|
||||
if (buflen <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (ogg_sync_wrote(&file->sync, buflen) == 0) ? 1 : -1;
|
||||
}
|
||||
|
||||
static inline void INTERNAL_queueOggPage(OggTheora_File *file)
|
||||
{
|
||||
if (file->tpackets)
|
||||
{
|
||||
ogg_stream_pagein(&file->tstream, &file->page);
|
||||
}
|
||||
if (file->vpackets)
|
||||
{
|
||||
ogg_stream_pagein(&file->vstream, &file->page);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int INTERNAL_getNextPacket(
|
||||
OggTheora_File *file,
|
||||
ogg_stream_state *stream,
|
||||
ogg_packet *packet
|
||||
) {
|
||||
while (ogg_stream_packetout(stream, packet) <= 0)
|
||||
{
|
||||
const int rc = INTERNAL_readOggData(file);
|
||||
if (rc == 0)
|
||||
{
|
||||
file->eos = 1;
|
||||
return 0;
|
||||
}
|
||||
else if (rc < 0)
|
||||
{
|
||||
/* If you made it here, something REALLY bad happened.
|
||||
*
|
||||
* Unfortunately, ogg_sync_wrote does not give out any
|
||||
* codes, so I have no idea what that something is.
|
||||
*
|
||||
* Be sure you're not doing something nasty like
|
||||
* accessing one file via multiple threads at one time.
|
||||
* -flibit
|
||||
*/
|
||||
file->eos = 1;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (ogg_sync_pageout(&file->sync, &file->page) > 0)
|
||||
{
|
||||
INTERNAL_queueOggPage(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int tf_open_callbacks(void *datasource, OggTheora_File *file, tf_callbacks io)
|
||||
{
|
||||
ogg_packet packet;
|
||||
ogg_stream_state filler;
|
||||
th_setup_info *tsetup = NULL;
|
||||
int pp_level_max = 0;
|
||||
int errcode = TF_EUNKNOWN;
|
||||
|
||||
if (datasource == NULL)
|
||||
{
|
||||
return TF_ENODATASOURCE;
|
||||
}
|
||||
|
||||
memset(file, '\0', sizeof(OggTheora_File));
|
||||
file->datasource = datasource;
|
||||
file->io = io;
|
||||
|
||||
#define TF_OPEN_ASSERT(cond) \
|
||||
if (cond) goto fail;
|
||||
|
||||
|
||||
ogg_sync_init(&file->sync);
|
||||
vorbis_info_init(&file->vinfo);
|
||||
vorbis_comment_init(&file->vcomment);
|
||||
th_info_init(&file->tinfo);
|
||||
th_comment_init(&file->tcomment);
|
||||
|
||||
/* Is there even data for us to read...? */
|
||||
TF_OPEN_ASSERT(INTERNAL_readOggData(file) <= 0)
|
||||
|
||||
/* Read header */
|
||||
while (ogg_sync_pageout(&file->sync, &file->page) > 0)
|
||||
{
|
||||
if (!ogg_page_bos(&file->page))
|
||||
{
|
||||
/* Not a header! */
|
||||
INTERNAL_queueOggPage(file);
|
||||
break;
|
||||
}
|
||||
|
||||
ogg_stream_init(&filler, ogg_page_serialno(&file->page));
|
||||
ogg_stream_pagein(&filler, &file->page);
|
||||
ogg_stream_packetout(&filler, &packet);
|
||||
|
||||
if (!file->tpackets && (th_decode_headerin(
|
||||
&file->tinfo,
|
||||
&file->tcomment,
|
||||
&tsetup,
|
||||
&packet
|
||||
) >= 0)) {
|
||||
memcpy(&file->tstream, &filler, sizeof(filler));
|
||||
file->tpackets = 1;
|
||||
}
|
||||
else if (!file->vpackets && (vorbis_synthesis_headerin(
|
||||
&file->vinfo,
|
||||
&file->vcomment,
|
||||
&packet
|
||||
) >= 0)) {
|
||||
memcpy(&file->vstream, &filler, sizeof(filler));
|
||||
file->vpackets = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Whatever it is, we don't care about it */
|
||||
ogg_stream_clear(&filler);
|
||||
}
|
||||
}
|
||||
|
||||
/* No audio OR video? */
|
||||
TF_OPEN_ASSERT(!file->tpackets && !file->vpackets)
|
||||
|
||||
/* Apparently there are 2 more theora and 2 more vorbis headers next. */
|
||||
#define TPACKETS (file->tpackets && (file->tpackets < 3))
|
||||
#define VPACKETS (file->vpackets && (file->vpackets < 3))
|
||||
while (TPACKETS || VPACKETS)
|
||||
{
|
||||
while (TPACKETS)
|
||||
{
|
||||
if (ogg_stream_packetout(
|
||||
&file->tstream,
|
||||
&packet
|
||||
) != 1) {
|
||||
/* Get more data? */
|
||||
break;
|
||||
}
|
||||
TF_OPEN_ASSERT(!th_decode_headerin(
|
||||
&file->tinfo,
|
||||
&file->tcomment,
|
||||
&tsetup,
|
||||
&packet
|
||||
))
|
||||
file->tpackets += 1;
|
||||
}
|
||||
|
||||
while (VPACKETS)
|
||||
{
|
||||
if (ogg_stream_packetout(
|
||||
&file->vstream,
|
||||
&packet
|
||||
) != 1) {
|
||||
/* Get more data? */
|
||||
break;
|
||||
}
|
||||
TF_OPEN_ASSERT(vorbis_synthesis_headerin(
|
||||
&file->vinfo,
|
||||
&file->vcomment,
|
||||
&packet
|
||||
))
|
||||
file->vpackets += 1;
|
||||
}
|
||||
|
||||
/* Get another page, try again? */
|
||||
if (ogg_sync_pageout(&file->sync, &file->page) > 0)
|
||||
{
|
||||
INTERNAL_queueOggPage(file);
|
||||
}
|
||||
else
|
||||
{
|
||||
TF_OPEN_ASSERT(INTERNAL_readOggData(file) < 0)
|
||||
}
|
||||
}
|
||||
#undef TPACKETS
|
||||
#undef VPACKETS
|
||||
|
||||
/* Set up Theora stream */
|
||||
if (file->tpackets)
|
||||
{
|
||||
/* th_decode_alloc() docs say to check for
|
||||
* insanely large frames yourself.
|
||||
*/
|
||||
TF_OPEN_ASSERT(
|
||||
(file->tinfo.frame_width > 99999) ||
|
||||
(file->tinfo.frame_height > 99999)
|
||||
)
|
||||
|
||||
/* FIXME: We treat "unspecified" as NTSC :shrug: */
|
||||
if ( (file->tinfo.colorspace != TH_CS_UNSPECIFIED) &&
|
||||
(file->tinfo.colorspace != TH_CS_ITU_REC_470M) &&
|
||||
(file->tinfo.colorspace != TH_CS_ITU_REC_470BG) )
|
||||
{
|
||||
errcode = TF_EUNSUPPORTED;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* FIXME: We only support YUV420 :shrug: */
|
||||
if (file->tinfo.pixel_fmt != TH_PF_420)
|
||||
{
|
||||
errcode = TF_EUNSUPPORTED;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* The decoder, at last! */
|
||||
file->tdec = th_decode_alloc(&file->tinfo, tsetup);
|
||||
TF_OPEN_ASSERT(!file->tdec)
|
||||
|
||||
/* Set decoder to maximum post-processing level.
|
||||
* Theoretically we could try dropping this level if we're
|
||||
* not keeping up.
|
||||
*
|
||||
* FIXME: Maybe an API to set this?
|
||||
* FIXME: Could be TH_DECCTL_GET_PPLEVEL_MAX, for example!
|
||||
*/
|
||||
th_decode_ctl(
|
||||
file->tdec,
|
||||
TH_DECCTL_SET_PPLEVEL,
|
||||
&pp_level_max,
|
||||
sizeof(pp_level_max)
|
||||
);
|
||||
}
|
||||
|
||||
/* Done with this now */
|
||||
if (tsetup != NULL)
|
||||
{
|
||||
th_setup_free(tsetup);
|
||||
tsetup = NULL;
|
||||
}
|
||||
|
||||
/* Set up Vorbis stream */
|
||||
if (file->vpackets)
|
||||
{
|
||||
file->vdsp_init = vorbis_synthesis_init(
|
||||
&file->vdsp,
|
||||
&file->vinfo
|
||||
) == 0;
|
||||
TF_OPEN_ASSERT(!file->vdsp_init)
|
||||
file->vblock_init = vorbis_block_init(
|
||||
&file->vdsp,
|
||||
&file->vblock
|
||||
) == 0;
|
||||
TF_OPEN_ASSERT(!file->vblock_init)
|
||||
}
|
||||
|
||||
#undef TF_OPEN_ASSERT
|
||||
|
||||
/* Finally. */
|
||||
return 0;
|
||||
fail:
|
||||
if (tsetup != NULL)
|
||||
{
|
||||
th_setup_free(tsetup);
|
||||
}
|
||||
tf_close(file);
|
||||
return errcode;
|
||||
}
|
||||
|
||||
int tf_fopen(const char *fname, OggTheora_File *file)
|
||||
{
|
||||
tf_callbacks io =
|
||||
{
|
||||
(size_t (*) (void*, size_t, size_t, void*)) fread,
|
||||
(int (*) (void*, ogg_int64_t, int)) fseek,
|
||||
(int (*) (void*)) fclose,
|
||||
};
|
||||
return tf_open_callbacks(
|
||||
fopen(fname, "rb"),
|
||||
file,
|
||||
io
|
||||
);
|
||||
}
|
||||
|
||||
void tf_close(OggTheora_File *file)
|
||||
{
|
||||
/* Theora Data */
|
||||
if (file->tdec != NULL)
|
||||
{
|
||||
th_decode_free(file->tdec);
|
||||
}
|
||||
|
||||
/* Vorbis Data */
|
||||
if (file->vblock_init)
|
||||
{
|
||||
vorbis_block_clear(&file->vblock);
|
||||
}
|
||||
if (file->vdsp_init)
|
||||
{
|
||||
vorbis_dsp_clear(&file->vdsp);
|
||||
}
|
||||
|
||||
/* Stream Data */
|
||||
if (file->tpackets)
|
||||
{
|
||||
ogg_stream_clear(&file->tstream);
|
||||
}
|
||||
if (file->vpackets)
|
||||
{
|
||||
ogg_stream_clear(&file->vstream);
|
||||
}
|
||||
|
||||
/* Metadata */
|
||||
th_info_clear(&file->tinfo);
|
||||
th_comment_clear(&file->tcomment);
|
||||
vorbis_comment_clear(&file->vcomment);
|
||||
vorbis_info_clear(&file->vinfo);
|
||||
|
||||
/* Current State */
|
||||
ogg_sync_clear(&file->sync);
|
||||
|
||||
/* I/O Data */
|
||||
if (file->io.close_func != NULL)
|
||||
{
|
||||
file->io.close_func(file->datasource);
|
||||
}
|
||||
}
|
||||
|
||||
int tf_hasvideo(OggTheora_File *file)
|
||||
{
|
||||
return file->tpackets != 0;
|
||||
}
|
||||
|
||||
int tf_hasaudio(OggTheora_File *file)
|
||||
{
|
||||
return file->vpackets != 0;
|
||||
}
|
||||
|
||||
void tf_videoinfo(OggTheora_File *file, int *width, int *height, double *fps)
|
||||
{
|
||||
if (width != NULL)
|
||||
{
|
||||
*width = file->tinfo.pic_width;
|
||||
}
|
||||
if (height != NULL)
|
||||
{
|
||||
*height = file->tinfo.pic_height;
|
||||
}
|
||||
if (fps != NULL)
|
||||
{
|
||||
if (file->tinfo.fps_denominator != 0)
|
||||
{
|
||||
*fps = (
|
||||
((double) file->tinfo.fps_numerator) /
|
||||
((double) file->tinfo.fps_denominator)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
*fps = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tf_audioinfo(OggTheora_File *file, int *channels, int *samplerate)
|
||||
{
|
||||
if (channels != NULL)
|
||||
{
|
||||
*channels = file->vinfo.channels;
|
||||
}
|
||||
if (samplerate != NULL)
|
||||
{
|
||||
*samplerate = file->vinfo.rate;
|
||||
}
|
||||
}
|
||||
|
||||
int tf_eos(OggTheora_File *file)
|
||||
{
|
||||
return file->eos;
|
||||
}
|
||||
|
||||
void tf_reset(OggTheora_File *file)
|
||||
{
|
||||
if (file->tpackets)
|
||||
{
|
||||
ogg_stream_reset(&file->tstream);
|
||||
}
|
||||
if (file->vpackets)
|
||||
{
|
||||
ogg_stream_reset(&file->vstream);
|
||||
}
|
||||
ogg_sync_reset(&file->sync);
|
||||
file->io.seek_func(file->datasource, 0, SEEK_SET);
|
||||
file->eos = 0;
|
||||
}
|
||||
|
||||
int tf_readvideo(OggTheora_File *file, char *buffer, int numframes)
|
||||
{
|
||||
int i;
|
||||
char *dst = buffer;
|
||||
ogg_int64_t granulepos = 0;
|
||||
ogg_packet packet;
|
||||
th_ycbcr_buffer ycbcr;
|
||||
int rc;
|
||||
int w, h, off;
|
||||
unsigned char *plane;
|
||||
int stride;
|
||||
int retval = 0;
|
||||
|
||||
for (i = 0; i < numframes; i += 1)
|
||||
{
|
||||
/* Keep trying to get a usable packet */
|
||||
if (!INTERNAL_getNextPacket(file, &file->tstream, &packet))
|
||||
{
|
||||
/* ... unless there's nothing left for us to read. */
|
||||
if (retval)
|
||||
{
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = th_decode_packetin(
|
||||
file->tdec,
|
||||
&packet,
|
||||
&granulepos
|
||||
);
|
||||
|
||||
if (rc == 0) /* New frame! */
|
||||
{
|
||||
retval = 1;
|
||||
}
|
||||
else if (rc != TH_DUPFRAME)
|
||||
{
|
||||
return 0; /* Why did we get here...? */
|
||||
}
|
||||
}
|
||||
|
||||
if (retval) /* New frame! */
|
||||
{
|
||||
if (th_decode_ycbcr_out(file->tdec, ycbcr) != 0)
|
||||
{
|
||||
return 0; /* Uhh?! */
|
||||
}
|
||||
|
||||
#define TF_COPY_CHANNEL(chan) \
|
||||
plane = ycbcr[chan].data + off; \
|
||||
stride = ycbcr[chan].stride; \
|
||||
for (i = 0; i < h; i += 1, dst += w) \
|
||||
{ \
|
||||
memcpy( \
|
||||
dst, \
|
||||
plane + (stride * i), \
|
||||
w \
|
||||
); \
|
||||
}
|
||||
/* Y */
|
||||
w = file->tinfo.pic_width;
|
||||
h = file->tinfo.pic_height;
|
||||
off = (
|
||||
(file->tinfo.pic_x & ~1) +
|
||||
ycbcr[0].stride *
|
||||
(file->tinfo.pic_y & ~1)
|
||||
);
|
||||
TF_COPY_CHANNEL(0)
|
||||
|
||||
/* U/V */
|
||||
w /= 2;
|
||||
h /= 2;
|
||||
off = (
|
||||
(file->tinfo.pic_x / 2) +
|
||||
(ycbcr[1].stride) *
|
||||
(file->tinfo.pic_y / 2)
|
||||
);
|
||||
TF_COPY_CHANNEL(1)
|
||||
TF_COPY_CHANNEL(2)
|
||||
#undef TF_COPY_CHANNEL
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int tf_readaudio(OggTheora_File *file, float *buffer, int length)
|
||||
{
|
||||
int offset = 0;
|
||||
int chan, frame;
|
||||
ogg_packet packet;
|
||||
float **pcm = NULL;
|
||||
|
||||
while (offset < length)
|
||||
{
|
||||
const int frames = vorbis_synthesis_pcmout(&file->vdsp, &pcm);
|
||||
if (frames > 0)
|
||||
{
|
||||
/* I bet this beats the crap out of the CPU cache... */
|
||||
for (frame = 0; frame < frames; frame += 1)
|
||||
for (chan = 0; chan < file->vinfo.channels; chan += 1)
|
||||
{
|
||||
buffer[offset++] = pcm[chan][frame];
|
||||
if (offset >= length)
|
||||
{
|
||||
vorbis_synthesis_read(
|
||||
&file->vdsp,
|
||||
frame
|
||||
);
|
||||
return offset;
|
||||
}
|
||||
}
|
||||
vorbis_synthesis_read(&file->vdsp, frames);
|
||||
}
|
||||
else /* No audio available left in current packet? */
|
||||
{
|
||||
/* Keep trying to get a usable packet */
|
||||
if (!INTERNAL_getNextPacket(file, &file->vstream, &packet))
|
||||
{
|
||||
/* ... unless there's nothing left for us to read. */
|
||||
return offset;
|
||||
}
|
||||
if (vorbis_synthesis(
|
||||
&file->vblock,
|
||||
&packet
|
||||
) == 0) {
|
||||
vorbis_synthesis_blockin(
|
||||
&file->vdsp,
|
||||
&file->vblock
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return offset;
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
/* Theorafile - Ogg Theora Video Decoder Library
|
||||
*
|
||||
* Copyright (c) 2017 Ethan Lee.
|
||||
* Based on TheoraPlay, Copyright (c) 2011-2016 Ryan C. Gordon.
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef THEORAFILE_H
|
||||
#define THEORAFILE_H
|
||||
|
||||
#include <theora/theoradec.h>
|
||||
#include <vorbis/codec.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef DECLSPEC
|
||||
#if defined(_WIN32)
|
||||
#define DECLSPEC __declspec(dllexport)
|
||||
#else
|
||||
#define DECLSPEC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* I/O Handle + Callbacks */
|
||||
typedef struct tf_callbacks
|
||||
{
|
||||
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
|
||||
int (*seek_func) (void *datasource, ogg_int64_t offset, int origin);
|
||||
int (*close_func) (void *datasource);
|
||||
} tf_callbacks;
|
||||
|
||||
/* File Handle */
|
||||
typedef struct OggTheora_File
|
||||
{
|
||||
/* Current State */
|
||||
ogg_sync_state sync;
|
||||
ogg_page page;
|
||||
int eos;
|
||||
|
||||
/* Stream Data */
|
||||
int tpackets;
|
||||
int vpackets;
|
||||
ogg_stream_state tstream;
|
||||
ogg_stream_state vstream;
|
||||
|
||||
/* Metadata */
|
||||
th_info tinfo;
|
||||
vorbis_info vinfo;
|
||||
th_comment tcomment;
|
||||
vorbis_comment vcomment;
|
||||
|
||||
/* Theora Data */
|
||||
th_dec_ctx *tdec;
|
||||
|
||||
/* Vorbis Data */
|
||||
int vdsp_init;
|
||||
vorbis_dsp_state vdsp;
|
||||
int vblock_init;
|
||||
vorbis_block vblock;
|
||||
|
||||
/* I/O Data */
|
||||
tf_callbacks io;
|
||||
void *datasource;
|
||||
} OggTheora_File;
|
||||
|
||||
/* Open/Close */
|
||||
#define TF_EUNKNOWN -1
|
||||
#define TF_EUNSUPPORTED -2
|
||||
#define TF_ENODATASOURCE -3
|
||||
DECLSPEC int tf_open_callbacks(
|
||||
void *datasource,
|
||||
OggTheora_File *file,
|
||||
tf_callbacks io
|
||||
);
|
||||
DECLSPEC int tf_fopen(
|
||||
const char *fname,
|
||||
OggTheora_File *file
|
||||
);
|
||||
DECLSPEC void tf_close(OggTheora_File *file);
|
||||
|
||||
/* File Info */
|
||||
DECLSPEC int tf_hasvideo(OggTheora_File *file);
|
||||
DECLSPEC int tf_hasaudio(OggTheora_File *file);
|
||||
DECLSPEC void tf_videoinfo(
|
||||
OggTheora_File *file,
|
||||
int *width,
|
||||
int *height,
|
||||
double *fps
|
||||
);
|
||||
DECLSPEC void tf_audioinfo(
|
||||
OggTheora_File *file,
|
||||
int *channels,
|
||||
int *samplerate
|
||||
);
|
||||
|
||||
/* Stream State */
|
||||
DECLSPEC int tf_eos(OggTheora_File *file);
|
||||
DECLSPEC void tf_reset(OggTheora_File *file);
|
||||
|
||||
/* Data Reading */
|
||||
DECLSPEC int tf_readvideo(OggTheora_File *file, char *buffer, int numframes);
|
||||
DECLSPEC int tf_readaudio(OggTheora_File *file, float *buffer, int length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* THEORAFILE_H */
|
|
@ -0,0 +1,19 @@
|
|||
Building Theorafile for UWP
|
||||
---------------------------
|
||||
Theorafile uses Visual Studio 2017 to build on Xbox One.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
Before building, download libogg/libvorbis/libtheora from the Xiph website:
|
||||
|
||||
https://xiph.org/downloads/
|
||||
|
||||
After extracting the zip files, be sure to rename the directories to remove the
|
||||
version numbers (for example, 'libogg-1.3.2' should be 'libogg').
|
||||
|
||||
Compiling
|
||||
---------
|
||||
1. Rename libvorbis/lib/info.c to libvorbis/lib/vinfo.c
|
||||
2. Rename libtheora/lib/info.c to libtheora/lib/tinfo.c
|
||||
3. Build Theorafile/visualc-winrt/libtheorafile.sln
|
||||
4. Grab the output DLL, ship it!
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27703.2000
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheorafile", "libtheorafile.vcxproj", "{8F981FCD-813B-44F1-A6A3-9D1C7AA3A8AB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8F981FCD-813B-44F1-A6A3-9D1C7AA3A8AB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8F981FCD-813B-44F1-A6A3-9D1C7AA3A8AB}.Debug|x64.Build.0 = Debug|x64
|
||||
{8F981FCD-813B-44F1-A6A3-9D1C7AA3A8AB}.Release|x64.ActiveCfg = Release|x64
|
||||
{8F981FCD-813B-44F1-A6A3-9D1C7AA3A8AB}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {AFA98898-C297-401A-AA32-D0B17544493C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\libogg\src\bitwise.c" />
|
||||
<ClCompile Include="..\..\libogg\src\framing.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\apiwrapper.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\bitpack.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\decapiwrapper.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\decinfo.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\decode.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\dequant.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\fragment.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\huffdec.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\idct.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\tinfo.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\internal.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\quant.c" />
|
||||
<ClCompile Include="..\..\libtheora\lib\state.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\analysis.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\barkmel.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\bitrate.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\block.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\codebook.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\envelope.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\floor0.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\floor1.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\vinfo.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\lookup.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\lpc.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\lsp.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\mapping0.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\mdct.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\psy.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\registry.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\res0.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\sharedbook.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\smallft.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\synthesis.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\vorbisenc.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\vorbisfile.c" />
|
||||
<ClCompile Include="..\..\libvorbis\lib\window.c" />
|
||||
<ClCompile Include="..\theorafile.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\theorafile.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8f981fcd-813b-44f1-a6a3-9d1c7aa3a8ab}</ProjectGuid>
|
||||
<Keyword>DynamicLibrary</Keyword>
|
||||
<RootNamespace>libtheorafile</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<AdditionalIncludeDirectories>..\..\libogg\include;..\..\libvorbis\include;..\..\libtheora\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<AdditionalIncludeDirectories>..\..\libogg\include;..\..\libvorbis\include;..\..\libtheora\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,34 @@
|
|||
Building Theorafile for Windows
|
||||
-------------------------------
|
||||
Theorafile uses Visual Studio 2010 to build on Windows.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
Before building, download libogg/libvorbis from the Xiph website:
|
||||
|
||||
https://xiph.org/downloads/
|
||||
|
||||
After extracting the zip files, be sure to rename the directories to remove the
|
||||
version numbers (for example, 'libogg-1.3.2' should be 'libogg').
|
||||
|
||||
As of writing, libtheora 1.1.1 does not build with Visual Studio 2010. Instead,
|
||||
download the upstream version via Git:
|
||||
|
||||
git clone git://github.com/xiph/theora.git libtheora
|
||||
|
||||
If building the sdl2test program, download SDL2's Visual Studio libraries:
|
||||
|
||||
http://libsdl.org/download-2.0.php
|
||||
|
||||
After extracting the zip file, be sure to rename the directory to remove the
|
||||
version number (for example, 'SDL2-2.0.5' should be 'SDL2').
|
||||
|
||||
Compiling
|
||||
---------
|
||||
1. Build libogg/win32/VS2010/libogg_dynamic.sln
|
||||
2. Build libvorbis/win32/VS2010/libvorbis_dynamic.sln
|
||||
3. Build libtheora/win32/VS2010/libtheora_dynamic.sln
|
||||
4. Build Theorafile/visualc/libtheorafile.sln
|
||||
5. Grab the output DLL from each project, ship it!
|
||||
|
||||
Be sure your build configurations match for each library!
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheorafile", "libtheorafile\libtheorafile.vcxproj", "{90A103EF-E403-47D4-BBBB-0F206B9FA7F2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdl2test", "sdl2test\sdl2test.vcxproj", "{127F9801-EAA6-468F-9699-3802B39BC714}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{90A103EF-E403-47D4-BBBB-0F206B9FA7F2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{90A103EF-E403-47D4-BBBB-0F206B9FA7F2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{90A103EF-E403-47D4-BBBB-0F206B9FA7F2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{90A103EF-E403-47D4-BBBB-0F206B9FA7F2}.Release|Win32.Build.0 = Release|Win32
|
||||
{127F9801-EAA6-468F-9699-3802B39BC714}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{127F9801-EAA6-468F-9699-3802B39BC714}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{127F9801-EAA6-468F-9699-3802B39BC714}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{127F9801-EAA6-468F-9699-3802B39BC714}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{90A103EF-E403-47D4-BBBB-0F206B9FA7F2}</ProjectGuid>
|
||||
<RootNamespace>libtheorafile</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>..\..\..\libtheora\include;..\..\..\libvorbis\include;..\..\..\libogg\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>..\..\..\libtheora\win32\VS2010\Win32\$(Configuration);..\..\..\libvorbis\win32\VS2010\Win32\$(Configuration);..\..\..\libogg\win32\VS2010\Win32\$(Configuration);$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>..\..\..\libtheora\include;..\..\..\libvorbis\include;..\..\..\libogg\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>..\..\..\libtheora\win32\VS2010\Win32\$(Configuration);..\..\..\libvorbis\win32\VS2010\Win32\$(Configuration);..\..\..\libogg\win32\VS2010\Win32\$(Configuration);$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>libtheora.lib;libvorbis.lib;libogg.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>libtheora.lib;libvorbis.lib;libogg.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\theorafile.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\theorafile.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{127F9801-EAA6-468F-9699-3802B39BC714}</ProjectGuid>
|
||||
<RootNamespace>sdl2test</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>..\..\..\SDL2\include;..\..\..\libtheora\include;..\..\..\libvorbis\include;..\..\..\libogg\include;..\..\;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>..\..\..\SDL2\lib\$(PlatformShortName);..\$(Configuration);$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>..\..\..\SDL2\include;..\..\..\libtheora\include;..\..\..\libvorbis\include;..\..\..\libogg\include;..\..\;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>..\..\..\SDL2\lib\$(PlatformShortName);..\$(Configuration);$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;libtheorafile.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;libtheorafile.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\sdl2test\sdl2test.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\sdl2test\glfuncs.h" />
|
||||
<ClInclude Include="..\..\sdl2test\glmacros.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
bin/
|
||||
obj/
|
||||
*.pidb
|
||||
*.userprefs
|
||||
*.suo
|
|
@ -0,0 +1,10 @@
|
|||
# Makefile for Vorbisfile#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
build: clean
|
||||
mkdir bin
|
||||
cp Vorbisfile-CS.dll.config bin
|
||||
dmcs /unsafe -debug -out:bin/Vorbisfile-CS.dll -target:library Vorbisfile.cs
|
||||
|
||||
clean:
|
||||
rm -rf bin
|
|
@ -0,0 +1,23 @@
|
|||
This is Vorbisfile#, a C# wrapper for Vorbisfile, a library for quickly and
|
||||
easily decoding Ogg Vorbis audio files.
|
||||
|
||||
License
|
||||
-------
|
||||
Vorbisfile is released under a BSD-style license.
|
||||
Vorbisfile# is released under the zlib license.
|
||||
See the licenses/ folder for details.
|
||||
|
||||
About Vorbisfile
|
||||
----------------
|
||||
For more information about Vorbisfile, visit the website:
|
||||
|
||||
http://www.xiph.org/vorbis/doc/vorbisfile/
|
||||
|
||||
About Vorbisfile#
|
||||
-----------------
|
||||
Vorbisfile# was written for FNA's Song support. We stream the Ogg Vorbis data
|
||||
into a DynamicSoundEffectInstance, allowing for portable Vorbis playback.
|
||||
|
||||
Building Vorbisfile#
|
||||
--------------------
|
||||
Just type `make` in the root directory!
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{C976BE87-E250-4120-9826-98B6C2CD7496}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Vorbisfile</RootNamespace>
|
||||
<AssemblyName>Vorbisfile-CS</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Vorbisfile.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Vorbisfile-CS.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
<configuration>
|
||||
<dllmap os="windows" dll="libvorbisfile.dll" target="libvorbisfile.dll"/>
|
||||
<dllmap os="osx" dll="libvorbisfile.dll" target="libvorbisfile.3.dylib"/>
|
||||
<dllmap os="linux" dll="libvorbisfile.dll" target="libvorbisfile.so.3"/>
|
||||
</configuration>
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vorbisfile-CS", "Vorbisfile-CS.csproj", "{47CF0C2E-3710-4188-BB11-30D248B2B5FB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Debug|x86.Build.0 = Debug|x86
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Release|x86.ActiveCfg = Release|x86
|
||||
{47CF0C2E-3710-4188-BB11-30D248B2B5FB}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Vorbisfile-CS.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,295 @@
|
|||
#region License
|
||||
/* Vorbisfile# - C# Wrapper for Vorbisfile
|
||||
*
|
||||
* Copyright (c) 2013-2015 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;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
public static class Vorbisfile
|
||||
{
|
||||
#region Native Library Name
|
||||
|
||||
private const string nativeLibName = "libvorbisfile.dll";
|
||||
|
||||
#endregion
|
||||
|
||||
#region malloc/free Entry Points
|
||||
|
||||
// Yes, we're seriously using these. -flibit
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr malloc(IntPtr size);
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern void free(IntPtr memblock);
|
||||
|
||||
#endregion
|
||||
|
||||
#region C stdio Macros
|
||||
|
||||
// Used by ov_callbacks, seek_func
|
||||
public enum SeekWhence : int
|
||||
{
|
||||
SEEK_SET = 0,
|
||||
SEEK_CUR = 1,
|
||||
SEEK_END = 2
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Vorbis Delegates
|
||||
|
||||
/* IntPtr refers to a size_t */
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate IntPtr read_func(
|
||||
IntPtr ptr, // Refers to a void*
|
||||
IntPtr size, // Refers to a size_t
|
||||
IntPtr nmemb, // Refers to a size_t
|
||||
IntPtr datasource // Refers to a void*
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate int seek_func(
|
||||
IntPtr datasource, // Refers to a void*
|
||||
long offset, // Refers to an ogg_int64_t
|
||||
SeekWhence whence
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate int close_func(
|
||||
IntPtr datasource // Refers to a void*
|
||||
);
|
||||
|
||||
/* IntPtr refers to a long, ignoring Win64! */
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate IntPtr tell_func(
|
||||
IntPtr datasource // Refers to a void*
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Vorbis Structures
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct vorbis_info
|
||||
{
|
||||
public int version;
|
||||
public int channels;
|
||||
public IntPtr rate; // refers to a long, ignoring Win64!
|
||||
public IntPtr bitrate_upper; // refers to a long, ignoring Win64!
|
||||
public IntPtr bitrate_nominal; // refers to a long, ignoring Win64!
|
||||
public IntPtr bitrate_lower; // refers to a long, ignoring Win64!
|
||||
public IntPtr bitrate_window; // refers to a long, ignoring Win64!
|
||||
public IntPtr codec_setup; // Refers to a void*
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct vorbis_comment
|
||||
{
|
||||
public IntPtr user_comments; // Refers to a char**
|
||||
public IntPtr comment_lengths; // Refers to an int*
|
||||
public int comments;
|
||||
public IntPtr vendor; // Refers to a char*
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ov_callbacks
|
||||
{
|
||||
public read_func read_func;
|
||||
public seek_func seek_func;
|
||||
public close_func close_func;
|
||||
public tell_func tell_func;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Vorbisfile Implementation
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "ov_fopen", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_ov_fopen(
|
||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
||||
string path,
|
||||
IntPtr vf
|
||||
);
|
||||
public static int ov_fopen(string path, out IntPtr vf)
|
||||
{
|
||||
vf = AllocVorbisFile();
|
||||
return INTERNAL_ov_fopen(path, vf);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "ov_open_callbacks", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_ov_open_callbacks(
|
||||
IntPtr datasource,
|
||||
IntPtr vf,
|
||||
IntPtr initial,
|
||||
IntPtr ibytes,
|
||||
ov_callbacks callbacks
|
||||
);
|
||||
public static int ov_open_callbacks(
|
||||
IntPtr datasource, // Refers to a void*
|
||||
out IntPtr vf,
|
||||
IntPtr initial, // Refers to a char*
|
||||
IntPtr ibytes, // Refers to a long, ignoring Win64!
|
||||
ov_callbacks callbacks
|
||||
) {
|
||||
vf = AllocVorbisFile();
|
||||
return INTERNAL_ov_open_callbacks(
|
||||
datasource,
|
||||
vf,
|
||||
initial,
|
||||
ibytes,
|
||||
callbacks
|
||||
);
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "ov_info", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_ov_info(
|
||||
IntPtr vf,
|
||||
int link
|
||||
);
|
||||
public static vorbis_info ov_info(
|
||||
IntPtr vf,
|
||||
int link
|
||||
) {
|
||||
IntPtr result = INTERNAL_ov_info(vf, link);
|
||||
vorbis_info info = (vorbis_info) Marshal.PtrToStructure(
|
||||
result,
|
||||
typeof(vorbis_info)
|
||||
);
|
||||
return info;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "ov_comment", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_ov_comment(
|
||||
IntPtr vf,
|
||||
int link
|
||||
);
|
||||
public static vorbis_comment ov_comment(
|
||||
IntPtr vf,
|
||||
int link
|
||||
) {
|
||||
IntPtr result = INTERNAL_ov_comment(vf, link);
|
||||
vorbis_comment comment = (vorbis_comment) Marshal.PtrToStructure(
|
||||
result,
|
||||
typeof(vorbis_comment)
|
||||
);
|
||||
return comment;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern double ov_time_total(IntPtr vf, int i);
|
||||
|
||||
/* IntPtr refers to a long, ignoring Win64! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr ov_read(
|
||||
IntPtr vf,
|
||||
byte[] buffer,
|
||||
int length,
|
||||
int bigendianp,
|
||||
int word,
|
||||
int sgned,
|
||||
out int current_section
|
||||
);
|
||||
|
||||
/* IntPtr refers to a long, ignoring Win64! */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr ov_read(
|
||||
IntPtr vf,
|
||||
IntPtr buffer,
|
||||
int length,
|
||||
int bigendianp,
|
||||
int word,
|
||||
int sgned,
|
||||
out int current_section
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int ov_time_seek(IntPtr vf, double s);
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "ov_clear", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int INTERNAL_ov_clear(IntPtr vf);
|
||||
public static int ov_clear(ref IntPtr vf)
|
||||
{
|
||||
int result = INTERNAL_ov_clear(vf);
|
||||
free(vf);
|
||||
vf = IntPtr.Zero;
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OggVorbis_File Allocator
|
||||
|
||||
/* Notice that we did not implement an OggVorbis_File struct, but are
|
||||
* instead using a pointer natively malloc'd.
|
||||
*
|
||||
* C# Interop for Vorbisfile structs is basically impossible to do, so
|
||||
* we just alloc what _should_ be the full size of the structure for
|
||||
* the OS and architecture, then pass that around as if that's a real
|
||||
* struct. The size is just what you get from sizeof(OggVorbis_File).
|
||||
*
|
||||
* Don't get mad at me, get mad at C#.
|
||||
*
|
||||
* -flibit
|
||||
*/
|
||||
|
||||
private static IntPtr AllocVorbisFile()
|
||||
{
|
||||
// Do not attempt to understand these numbers at all costs!
|
||||
const int size32 = 720;
|
||||
const int size64Unix = 944;
|
||||
const int size64Windows = 840;
|
||||
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
if (IntPtr.Size == 4)
|
||||
{
|
||||
/* Technically this could be as low as 704 bytes, but
|
||||
* some 32-bit architectures may be higher even on Unix
|
||||
* targets (like ARMv7).
|
||||
* -flibit
|
||||
*/
|
||||
return malloc((IntPtr) size32);
|
||||
}
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
if (platform == PlatformID.Unix)
|
||||
{
|
||||
return malloc((IntPtr) size64Unix);
|
||||
}
|
||||
else if (platform == PlatformID.Win32NT)
|
||||
{
|
||||
return malloc((IntPtr) size64Windows);
|
||||
}
|
||||
throw new NotSupportedException("Unhandled platform!");
|
||||
}
|
||||
throw new NotSupportedException("Unhandled architecture!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/* Vorbisfile# - C# Wrapper for Vorbisfile
|
||||
*
|
||||
* Copyright (c) 2013-2015 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>
|
||||
*
|
||||
*/
|
|
@ -0,0 +1,28 @@
|
|||
Copyright (c) 2002-2008 Xiph.org Foundation
|
||||
|
||||
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 the Xiph.org Foundation 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 FOUNDATION
|
||||
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.
|
|
@ -0,0 +1,63 @@
|
|||
Microsoft Public License (Ms-PL)
|
||||
FNA - Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
This license governs use of the accompanying software. If you use the software,
|
||||
you accept this license. If you do not accept the license, do not use the
|
||||
software.
|
||||
|
||||
1. Definitions
|
||||
|
||||
The terms "reproduce," "reproduction," "derivative works," and "distribution"
|
||||
have the same meaning here as under U.S. copyright law.
|
||||
|
||||
A "contribution" is the original software, or any additions or changes to the
|
||||
software.
|
||||
|
||||
A "contributor" is any person that distributes its contribution under this
|
||||
license.
|
||||
|
||||
"Licensed patents" are a contributor's patent claims that read directly on its
|
||||
contribution.
|
||||
|
||||
2. Grant of Rights
|
||||
|
||||
(A) Copyright Grant- Subject to the terms of this license, including the
|
||||
license conditions and limitations in section 3, each contributor grants you a
|
||||
non-exclusive, worldwide, royalty-free copyright license to reproduce its
|
||||
contribution, prepare derivative works of its contribution, and distribute its
|
||||
contribution or any derivative works that you create.
|
||||
|
||||
(B) Patent Grant- Subject to the terms of this license, including the license
|
||||
conditions and limitations in section 3, each contributor grants you a
|
||||
non-exclusive, worldwide, royalty-free license under its licensed patents to
|
||||
make, have made, use, sell, offer for sale, import, and/or otherwise dispose of
|
||||
its contribution in the software or derivative works of the contribution in the
|
||||
software.
|
||||
|
||||
3. Conditions and Limitations
|
||||
|
||||
(A) No Trademark License- This license does not grant you rights to use any
|
||||
contributors' name, logo, or trademarks.
|
||||
|
||||
(B) If you bring a patent claim against any contributor over patents that you
|
||||
claim are infringed by the software, your patent license from such contributor
|
||||
to the software ends automatically.
|
||||
|
||||
(C) If you distribute any portion of the software, you must retain all
|
||||
copyright, patent, trademark, and attribution notices that are present in the
|
||||
software.
|
||||
|
||||
(D) If you distribute any portion of the software in source code form, you may
|
||||
do so only under this license by including a complete copy of this license with
|
||||
your distribution. If you distribute any portion of the software in compiled or
|
||||
object code form, you may only do so under a license that complies with this
|
||||
license.
|
||||
|
||||
(E) The software is licensed "as-is." You bear the risk of using it. The
|
||||
contributors give no express warranties, guarantees or conditions. You may have
|
||||
additional consumer rights under your local laws which this license cannot
|
||||
change. To the extent permitted under your local laws, the contributors exclude
|
||||
the implied warranties of merchantability, fitness for a particular purpose and
|
||||
non-infringement.
|
|
@ -0,0 +1,29 @@
|
|||
LzxDecoder.cs was derived from libmspack
|
||||
Copyright 2003-2004 Stuart Caie
|
||||
Copyright 2011 Ali Scissons
|
||||
|
||||
The LZX method was created by Jonathan Forbes and Tomi Poutanen, adapted
|
||||
by Microsoft Corporation.
|
||||
|
||||
This source file is Dual licensed; meaning the end-user of this source file
|
||||
may redistribute/modify it under the LGPL 2.1 or MS-PL licenses.
|
||||
|
||||
About
|
||||
-----
|
||||
This derived work is recognized by Stuart Caie and is authorized to adapt
|
||||
any changes made to lzxd.c in his libmspack library and will still retain
|
||||
this dual licensing scheme. Big thanks to Stuart Caie!
|
||||
|
||||
This file is a pure C# port of the lzxd.c file from libmspack, with minor
|
||||
changes towards the decompression of XNB files. The original decompression
|
||||
software of LZX encoded data was written by Suart Caie in his
|
||||
libmspack/cabextract projects, which can be located at
|
||||
http://http://www.cabextract.org.uk/
|
||||
|
||||
GNU Lesser General Public License, Version 2.1
|
||||
----------------------------------------------
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
Microsoft Public License
|
||||
------------------------
|
||||
http://www.opensource.org/licenses/ms-pl.html
|
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
Copyright 2006 The Mono.Xna Team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
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,12 @@
|
|||
The unxwb project, written by Luigi Auriemma, was released in 2006 under the
|
||||
GNU General Public License, version 2.0:
|
||||
|
||||
http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
While the unxwb project was released under the GPL, Luigi has given express
|
||||
permission to the MonoGame project to use code from unxwb under the MonoGame
|
||||
project license. See LICENSE for details.
|
||||
|
||||
The unxwb website can be found here:
|
||||
|
||||
http://aluigi.altervista.org/papers.htm#xbox
|
|
@ -0,0 +1,433 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.audiocategory.aspx
|
||||
public struct AudioCategory : IEquatable<AudioCategory>
|
||||
{
|
||||
#region Internal Primitive Type Container Class
|
||||
|
||||
internal class PrimitiveInstance<T>
|
||||
{
|
||||
public T Value;
|
||||
public PrimitiveInstance(T initial)
|
||||
{
|
||||
Value = initial;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
private string INTERNAL_name;
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return INTERNAL_name;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Variables
|
||||
|
||||
// Grumble, struct returns...
|
||||
internal PrimitiveInstance<float> INTERNAL_volume;
|
||||
|
||||
internal CrossfadeType crossfadeType;
|
||||
|
||||
internal List<AudioCategory> subCategories;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Variables
|
||||
|
||||
private readonly List<Cue> activeCues;
|
||||
private readonly List<Cue> dyingCues;
|
||||
|
||||
private readonly Dictionary<string, List<Cue>> cueInstanceCounts;
|
||||
|
||||
private readonly float baseVolume;
|
||||
private readonly byte maxCueInstances;
|
||||
private readonly MaxInstanceBehavior maxCueBehavior;
|
||||
private readonly ushort maxFadeInMS;
|
||||
private readonly ushort maxFadeOutMS;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Constructor
|
||||
|
||||
internal AudioCategory(
|
||||
string name,
|
||||
float volume,
|
||||
byte maxInstances,
|
||||
int maxBehavior,
|
||||
ushort fadeInMS,
|
||||
ushort fadeOutMS,
|
||||
int fadeType
|
||||
) {
|
||||
INTERNAL_name = name;
|
||||
INTERNAL_volume = new PrimitiveInstance<float>(volume);
|
||||
activeCues = new List<Cue>();
|
||||
dyingCues = new List<Cue>();
|
||||
cueInstanceCounts = new Dictionary<string, List<Cue>>();
|
||||
|
||||
baseVolume = volume;
|
||||
maxCueInstances = maxInstances;
|
||||
maxCueBehavior = (MaxInstanceBehavior) maxBehavior;
|
||||
maxFadeInMS = fadeInMS;
|
||||
maxFadeOutMS = fadeOutMS;
|
||||
crossfadeType = (CrossfadeType) fadeType;
|
||||
subCategories = new List<AudioCategory>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
foreach (Cue curCue in activeCues)
|
||||
{
|
||||
curCue.Pause();
|
||||
}
|
||||
foreach (AudioCategory ac in subCategories)
|
||||
{
|
||||
ac.Pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Resume()
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
foreach (Cue curCue in activeCues)
|
||||
{
|
||||
curCue.Resume();
|
||||
}
|
||||
foreach (AudioCategory ac in subCategories)
|
||||
{
|
||||
ac.Resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVolume(float volume)
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
INTERNAL_volume.Value = baseVolume * volume;
|
||||
foreach (AudioCategory ac in subCategories)
|
||||
{
|
||||
ac.SetVolume(INTERNAL_volume.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop(AudioStopOptions options)
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
while (activeCues.Count > 0)
|
||||
{
|
||||
Cue curCue = activeCues[0];
|
||||
curCue.Stop(options);
|
||||
}
|
||||
activeCues.Clear();
|
||||
if (options == AudioStopOptions.Immediate)
|
||||
{
|
||||
lock (dyingCues)
|
||||
{
|
||||
while (dyingCues.Count > 0)
|
||||
{
|
||||
Cue curCue = dyingCues[0];
|
||||
curCue.Stop(AudioStopOptions.Immediate);
|
||||
}
|
||||
dyingCues.Clear();
|
||||
}
|
||||
}
|
||||
foreach (List<Cue> count in cueInstanceCounts.Values)
|
||||
{
|
||||
count.Clear();
|
||||
}
|
||||
foreach (AudioCategory ac in subCategories)
|
||||
{
|
||||
ac.Stop(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Name.GetHashCode();
|
||||
}
|
||||
|
||||
public bool Equals(AudioCategory other)
|
||||
{
|
||||
return (GetHashCode() == other.GetHashCode());
|
||||
}
|
||||
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
if (obj is AudioCategory)
|
||||
{
|
||||
return Equals((AudioCategory) obj);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool operator ==(
|
||||
AudioCategory value1,
|
||||
AudioCategory value2
|
||||
) {
|
||||
return value1.Equals(value2);
|
||||
}
|
||||
|
||||
public static bool operator !=(
|
||||
AudioCategory value1,
|
||||
AudioCategory value2
|
||||
) {
|
||||
return !(value1.Equals(value2));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void INTERNAL_update()
|
||||
{
|
||||
/* Believe it or not, someone might run the update on a thread.
|
||||
* So, we're going to give a lock to this method.
|
||||
* -flibit
|
||||
*/
|
||||
lock (activeCues)
|
||||
{
|
||||
for (int i = 0; i < activeCues.Count; i += 1)
|
||||
{
|
||||
if (!activeCues[i].INTERNAL_update())
|
||||
{
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
lock (dyingCues)
|
||||
{
|
||||
for (int i = 0; i < dyingCues.Count; i += 1)
|
||||
{
|
||||
if (!dyingCues[i].INTERNAL_update())
|
||||
{
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal bool INTERNAL_addCue(Cue newCue)
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
if (activeCues.Count >= maxCueInstances)
|
||||
{
|
||||
if (maxCueBehavior == MaxInstanceBehavior.Fail)
|
||||
{
|
||||
return false; // Just ignore us...
|
||||
}
|
||||
else if (maxCueBehavior == MaxInstanceBehavior.Queue)
|
||||
{
|
||||
if (maxFadeInMS > 0)
|
||||
{
|
||||
newCue.INTERNAL_startFadeIn(maxFadeInMS);
|
||||
}
|
||||
if (maxFadeOutMS > 0)
|
||||
{
|
||||
activeCues[0].INTERNAL_startFadeOut(maxFadeOutMS);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeCues[0].Stop(AudioStopOptions.AsAuthored);
|
||||
}
|
||||
}
|
||||
else if (maxCueBehavior == MaxInstanceBehavior.ReplaceOldest)
|
||||
{
|
||||
if (!INTERNAL_removeOldestCue(activeCues[0].Name))
|
||||
{
|
||||
return false; // Just ignore us...
|
||||
}
|
||||
if (maxFadeInMS > 0)
|
||||
{
|
||||
newCue.INTERNAL_startFadeIn(maxFadeInMS);
|
||||
}
|
||||
}
|
||||
else if (maxCueBehavior == MaxInstanceBehavior.ReplaceQuietest)
|
||||
{
|
||||
float lowestVolume = float.MaxValue;
|
||||
int lowestIndex = -1;
|
||||
for (int i = 0; i < activeCues.Count; i += 1)
|
||||
{
|
||||
if (!activeCues[i].JustStarted)
|
||||
{
|
||||
float vol = activeCues[i].INTERNAL_calculateVolume();
|
||||
if (vol < lowestVolume)
|
||||
{
|
||||
lowestVolume = vol;
|
||||
lowestIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lowestIndex > -1)
|
||||
{
|
||||
activeCues[lowestIndex].Stop(AudioStopOptions.AsAuthored);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false; // Just ignore us...
|
||||
}
|
||||
if (maxFadeInMS > 0)
|
||||
{
|
||||
newCue.INTERNAL_startFadeIn(maxFadeInMS);
|
||||
}
|
||||
}
|
||||
else if (maxCueBehavior == MaxInstanceBehavior.ReplaceLowestPriority)
|
||||
{
|
||||
// FIXME: Priority?
|
||||
if (!INTERNAL_removeOldestCue(activeCues[0].Name))
|
||||
{
|
||||
return false; // Just ignore us...
|
||||
}
|
||||
if (maxFadeInMS > 0)
|
||||
{
|
||||
newCue.INTERNAL_startFadeIn(maxFadeInMS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cueInstanceCounts[newCue.Name].Add(newCue);
|
||||
activeCues.Add(newCue);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
internal bool INTERNAL_removeOldestCue(string name)
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
for (int i = 0; i < activeCues.Count; i += 1)
|
||||
{
|
||||
if (activeCues[i].Name.Equals(name) && !activeCues[i].JustStarted)
|
||||
{
|
||||
if (maxFadeOutMS > 0)
|
||||
{
|
||||
activeCues[i].INTERNAL_startFadeOut(maxFadeOutMS);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeCues[i].Stop(AudioStopOptions.AsAuthored);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool INTERNAL_removeQuietestCue(string name)
|
||||
{
|
||||
float lowestVolume = float.MaxValue;
|
||||
int lowestIndex = -1;
|
||||
|
||||
lock (activeCues)
|
||||
{
|
||||
for (int i = 0; i < activeCues.Count; i += 1)
|
||||
{
|
||||
if (activeCues[i].Name.Equals(name) && !activeCues[i].JustStarted)
|
||||
{
|
||||
float vol = activeCues[i].INTERNAL_calculateVolume();
|
||||
if (vol < lowestVolume)
|
||||
{
|
||||
lowestVolume = vol;
|
||||
lowestIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lowestIndex > -1)
|
||||
{
|
||||
if (maxFadeOutMS > 0)
|
||||
{
|
||||
activeCues[lowestIndex].INTERNAL_startFadeOut(maxFadeOutMS);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeCues[lowestIndex].Stop(AudioStopOptions.AsAuthored);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal void INTERNAL_removeActiveCue(Cue cue)
|
||||
{
|
||||
// FIXME: Avoid calling this when a Cue is GC'd! -flibit
|
||||
if (activeCues != null)
|
||||
{
|
||||
lock (activeCues)
|
||||
{
|
||||
if (activeCues.Contains(cue))
|
||||
{
|
||||
activeCues.Remove(cue);
|
||||
cueInstanceCounts[cue.Name].Remove(cue);
|
||||
}
|
||||
else if (dyingCues != null)
|
||||
{
|
||||
lock (dyingCues)
|
||||
{
|
||||
if (dyingCues.Contains(cue))
|
||||
{
|
||||
dyingCues.Remove(cue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal int INTERNAL_cueInstanceCount(string name)
|
||||
{
|
||||
if (!cueInstanceCounts.ContainsKey(name))
|
||||
{
|
||||
cueInstanceCounts.Add(name, new List<Cue>());
|
||||
}
|
||||
return cueInstanceCounts[name].Count;
|
||||
}
|
||||
|
||||
internal void INTERNAL_moveToDying(Cue cue)
|
||||
{
|
||||
INTERNAL_removeActiveCue(cue);
|
||||
lock (dyingCues)
|
||||
{
|
||||
dyingCues.Add(cue);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.audiochannels.aspx
|
||||
public enum AudioChannels
|
||||
{
|
||||
Mono = 1,
|
||||
Stereo = 2
|
||||
}
|
||||
}
|
|
@ -0,0 +1,260 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
internal static class AudioDevice
|
||||
{
|
||||
#region Public Constants
|
||||
|
||||
// Per XAudio2. Yes, it's seriously this high. -flibit
|
||||
public const float MAX_GAIN_VALUE = 16777216.0f;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoundEffect Master Properties
|
||||
|
||||
private static float INTERNAL_masterVolume = 1.0f;
|
||||
public static float MasterVolume
|
||||
{
|
||||
get
|
||||
{
|
||||
return INTERNAL_masterVolume;
|
||||
}
|
||||
set
|
||||
{
|
||||
INTERNAL_masterVolume = value;
|
||||
if (ALDevice != null)
|
||||
{
|
||||
ALDevice.SetMasterVolume(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static float DistanceScale = 1.0f;
|
||||
|
||||
private static float INTERNAL_dopplerScale = 1.0f;
|
||||
public static float DopplerScale
|
||||
{
|
||||
get
|
||||
{
|
||||
return INTERNAL_dopplerScale;
|
||||
}
|
||||
set
|
||||
{
|
||||
INTERNAL_dopplerScale = value;
|
||||
if (ALDevice != null)
|
||||
{
|
||||
ALDevice.SetDopplerScale(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static float INTERNAL_speedOfSound = 343.5f;
|
||||
public static float SpeedOfSound
|
||||
{
|
||||
get
|
||||
{
|
||||
return INTERNAL_speedOfSound;
|
||||
}
|
||||
set
|
||||
{
|
||||
INTERNAL_speedOfSound = value;
|
||||
if (ALDevice != null)
|
||||
{
|
||||
ALDevice.SetSpeedOfSound(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region RendererDetail List
|
||||
|
||||
public static ReadOnlyCollection<RendererDetail> Renderers;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal AL Device
|
||||
|
||||
// FIXME: readonly? -flibit
|
||||
public static IALDevice ALDevice;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoundEffect Management Variables
|
||||
|
||||
// FIXME: readonly? -flibit
|
||||
|
||||
// Used to store SoundEffectInstances generated internally.
|
||||
public static List<SoundEffectInstance> InstancePool;
|
||||
|
||||
// Used to store all DynamicSoundEffectInstances, to check buffer counts.
|
||||
public static List<DynamicSoundEffectInstance> DynamicInstancePool;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Microphone Management Variables
|
||||
|
||||
// FIXME: readonly? -flibit
|
||||
|
||||
// Used to store Microphones that are currently recording
|
||||
public static List<Microphone> ActiveMics;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Static Initialize Method
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
// We should only have one of these!
|
||||
if (ALDevice != null)
|
||||
{
|
||||
FNALoggerEXT.LogWarn("ALDevice already exists, overwriting!");
|
||||
}
|
||||
|
||||
bool disableSound = Environment.GetEnvironmentVariable(
|
||||
"FNA_AUDIO_DISABLE_SOUND"
|
||||
) == "1";
|
||||
|
||||
if (disableSound)
|
||||
{
|
||||
ALDevice = new NullALDevice();
|
||||
}
|
||||
else
|
||||
{
|
||||
ALDevice = FNAPlatform.CreateALDevice();
|
||||
}
|
||||
|
||||
// Populate device info
|
||||
if (ALDevice != null)
|
||||
{
|
||||
ALDevice.SetMasterVolume(MasterVolume);
|
||||
ALDevice.SetDopplerScale(DopplerScale);
|
||||
ALDevice.SetSpeedOfSound(SpeedOfSound);
|
||||
|
||||
Renderers = ALDevice.GetDevices();
|
||||
Microphone.All = ALDevice.GetCaptureDevices();
|
||||
|
||||
InstancePool = new List<SoundEffectInstance>();
|
||||
DynamicInstancePool = new List<DynamicSoundEffectInstance>();
|
||||
ActiveMics = new List<Microphone>();
|
||||
AppDomain.CurrentDomain.ProcessExit += Dispose;
|
||||
}
|
||||
else
|
||||
{
|
||||
Renderers = new ReadOnlyCollection<RendererDetail>(new List<RendererDetail>());
|
||||
Microphone.All = new ReadOnlyCollection<Microphone>(new List<Microphone>());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Static Dispose Method
|
||||
|
||||
private static void Dispose(object sender, EventArgs e)
|
||||
{
|
||||
InstancePool.Clear();
|
||||
DynamicInstancePool.Clear();
|
||||
ALDevice.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Static Update Methods
|
||||
|
||||
public static void Update()
|
||||
{
|
||||
ALDevice.Update();
|
||||
|
||||
for (int i = 0; i < InstancePool.Count; i += 1)
|
||||
{
|
||||
if (InstancePool[i].State == SoundState.Stopped)
|
||||
{
|
||||
InstancePool[i].Dispose();
|
||||
InstancePool.RemoveAt(i);
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < DynamicInstancePool.Count; i += 1)
|
||||
{
|
||||
DynamicSoundEffectInstance sfi = DynamicInstancePool[i];
|
||||
sfi.Update();
|
||||
if (sfi.State == SoundState.Stopped)
|
||||
{
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Microphone mic in ActiveMics)
|
||||
{
|
||||
mic.CheckBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Static Buffer Methods
|
||||
|
||||
public static IALBuffer GenBuffer(int sampleRate, AudioChannels channels)
|
||||
{
|
||||
if (ALDevice == null)
|
||||
{
|
||||
throw new NoAudioHardwareException();
|
||||
}
|
||||
return ALDevice.GenBuffer(sampleRate, channels);
|
||||
}
|
||||
|
||||
public static IALBuffer GenBuffer(
|
||||
byte[] data,
|
||||
uint sampleRate,
|
||||
uint channels,
|
||||
uint loopStart,
|
||||
uint loopEnd,
|
||||
bool isADPCM,
|
||||
uint formatParameter
|
||||
) {
|
||||
if (ALDevice == null)
|
||||
{
|
||||
throw new NoAudioHardwareException();
|
||||
}
|
||||
return ALDevice.GenBuffer(
|
||||
data,
|
||||
sampleRate,
|
||||
channels,
|
||||
loopStart,
|
||||
loopEnd,
|
||||
isADPCM,
|
||||
formatParameter
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Static Reverb Methods
|
||||
|
||||
public static IALReverb GenReverb(DSPParameter[] parameters)
|
||||
{
|
||||
if (ALDevice == null)
|
||||
{
|
||||
throw new NoAudioHardwareException();
|
||||
}
|
||||
return ALDevice.GenReverb(parameters);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.audioemitter.aspx
|
||||
public class AudioEmitter
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
private float INTERNAL_dopplerScale;
|
||||
public float DopplerScale
|
||||
{
|
||||
get
|
||||
{
|
||||
return INTERNAL_dopplerScale;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 0.0f)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("AudioEmitter.DopplerScale must be greater than or equal to 0.0f");
|
||||
}
|
||||
INTERNAL_dopplerScale = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 Forward
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Vector3 Position
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
|
||||
public Vector3 Up
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Vector3 Velocity
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructor
|
||||
|
||||
public AudioEmitter()
|
||||
{
|
||||
DopplerScale = 1.0f;
|
||||
Forward = Vector3.Forward;
|
||||
Position = Vector3.Zero;
|
||||
Up = Vector3.Up;
|
||||
Velocity = Vector3.Zero;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,635 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/dd940262.aspx
|
||||
public class AudioEngine : IDisposable
|
||||
{
|
||||
#region Public Constants
|
||||
|
||||
public const int ContentVersion = 46;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public ReadOnlyCollection<RendererDetail> RendererDetails
|
||||
{
|
||||
get
|
||||
{
|
||||
return AudioDevice.Renderers;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDisposed
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Variables
|
||||
|
||||
private Dictionary<string, WaveBank> INTERNAL_waveBanks;
|
||||
|
||||
private List<AudioCategory> INTERNAL_categories;
|
||||
private List<Variable> INTERNAL_variables;
|
||||
private Dictionary<long, RPC> INTERNAL_RPCs;
|
||||
private List<DSPParameter> INTERNAL_dspParameters;
|
||||
private Dictionary<long, DSPPreset> INTERNAL_dspPresets;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Disposing Event
|
||||
|
||||
public event EventHandler<EventArgs> Disposing;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public AudioEngine(string settingsFile)
|
||||
{
|
||||
if (String.IsNullOrEmpty(settingsFile))
|
||||
{
|
||||
throw new ArgumentNullException("settingsFile");
|
||||
}
|
||||
|
||||
using (Stream stream = TitleContainer.OpenStream(settingsFile))
|
||||
using (BinaryReader reader = new BinaryReader(stream))
|
||||
{
|
||||
// Check the file header. Should be 'XGSF'
|
||||
if (reader.ReadUInt32() != 0x46534758)
|
||||
{
|
||||
throw new ArgumentException("XGSF format not recognized!");
|
||||
}
|
||||
|
||||
// Check the Content and Tool versions
|
||||
if (reader.ReadUInt16() != ContentVersion)
|
||||
{
|
||||
throw new ArgumentException("XGSF Content version!");
|
||||
}
|
||||
if (reader.ReadUInt16() != 42)
|
||||
{
|
||||
throw new ArgumentException("XGSF Tool version!");
|
||||
}
|
||||
|
||||
// Unknown value
|
||||
reader.ReadUInt16();
|
||||
|
||||
// Last Modified, Unused
|
||||
reader.ReadUInt64();
|
||||
|
||||
// XACT Version, Unused
|
||||
reader.ReadByte();
|
||||
|
||||
// Number of AudioCategories
|
||||
ushort numCategories = reader.ReadUInt16();
|
||||
|
||||
// Number of XACT Variables
|
||||
ushort numVariables = reader.ReadUInt16();
|
||||
|
||||
// KEY#1 Length
|
||||
/*ushort numKeyOne =*/ reader.ReadUInt16();
|
||||
|
||||
// KEY#2 Length
|
||||
/*ushort numKeyTwo =*/ reader.ReadUInt16();
|
||||
|
||||
// Number of RPC Variables
|
||||
ushort numRPCs = reader.ReadUInt16();
|
||||
|
||||
// Number of DSP Presets/Parameters
|
||||
ushort numDSPPresets = reader.ReadUInt16();
|
||||
ushort numDSPParameters = reader.ReadUInt16();
|
||||
|
||||
// Category Offset in XGS File
|
||||
uint categoryOffset = reader.ReadUInt32();
|
||||
|
||||
// Variable Offset in XGS File
|
||||
uint variableOffset = reader.ReadUInt32();
|
||||
|
||||
// KEY#1 Offset
|
||||
/*uint keyOneOffset =*/ reader.ReadUInt32();
|
||||
|
||||
// Category Name Index Offset, unused
|
||||
reader.ReadUInt32();
|
||||
|
||||
// KEY#2 Offset
|
||||
/*uint keyTwoOffset =*/ reader.ReadUInt32();
|
||||
|
||||
// Variable Name Index Offset, unused
|
||||
reader.ReadUInt32();
|
||||
|
||||
// Category Name Offset in XGS File
|
||||
uint categoryNameOffset = reader.ReadUInt32();
|
||||
|
||||
// Variable Name Offset in XGS File
|
||||
uint variableNameOffset = reader.ReadUInt32();
|
||||
|
||||
// RPC Variable Offset in XGS File
|
||||
uint rpcOffset = reader.ReadUInt32();
|
||||
|
||||
// DSP Preset/Parameter Offsets in XGS File
|
||||
uint dspPresetOffset = reader.ReadUInt32();
|
||||
uint dspParameterOffset = reader.ReadUInt32();
|
||||
|
||||
/* Unknown table #1
|
||||
reader.BaseStream.Seek(keyOneOffset, SeekOrigin.Begin);
|
||||
for (int i = 0; i < numKeyOne; i += 1)
|
||||
{
|
||||
// Appears to consistently be 16 shorts?
|
||||
System.Console.WriteLine(reader.ReadInt16());
|
||||
}
|
||||
/* OhGodNo
|
||||
* 1, -1, 4, -1,
|
||||
* 3, -1, -1, 7,
|
||||
* -1, 2, 5, -1,
|
||||
* 6, 0, -1, -1
|
||||
*
|
||||
* Naddachance
|
||||
* 1, -1, 4, -1,
|
||||
* 5, -1, -1, -1,
|
||||
* -1, 2, -1, -1,
|
||||
* 3, 0, -1, -1
|
||||
*
|
||||
* TFA
|
||||
* 1, -1, -1, -1,
|
||||
* -1, -1, -1, -1,
|
||||
* -1, 2, -1, -1,
|
||||
* -1, -0, -1, -1
|
||||
*/
|
||||
|
||||
/* Unknown table #2
|
||||
reader.BaseStream.Seek(keyTwoOffset, SeekOrigin.Begin);
|
||||
for (int i = 0; i < numKeyTwo; i += 1)
|
||||
{
|
||||
// Appears to be between 16-20 shorts?
|
||||
System.Console.WriteLine(reader.ReadInt16());
|
||||
}
|
||||
/* OhGodNo
|
||||
* 2, 7, 1, -1,
|
||||
* -1, 10, 19, -1,
|
||||
* 11, 3, -1, -1,
|
||||
* 8, -1, 14, 5,
|
||||
* 12, 0, 4, 6
|
||||
*
|
||||
* Naddachance
|
||||
* 2, 3, -1, -1,
|
||||
* 9, -1, 7, -1,
|
||||
* 10, 0, 1, 5,
|
||||
* -1, -1, -1, -1
|
||||
*
|
||||
* TFA
|
||||
* 2, 3, -1, -1,
|
||||
* -1, -1, -1, -1,
|
||||
* -1, 0, 1, 5,
|
||||
* -1, -1, -1, -1
|
||||
*/
|
||||
|
||||
// Obtain the Audio Category Names
|
||||
reader.BaseStream.Seek(categoryNameOffset, SeekOrigin.Begin);
|
||||
string[] categoryNames = new string[numCategories];
|
||||
for (int i = 0; i < numCategories; i += 1)
|
||||
{
|
||||
List<char> builtString = new List<char>();
|
||||
while (reader.PeekChar() != 0)
|
||||
{
|
||||
builtString.Add(reader.ReadChar());
|
||||
}
|
||||
reader.ReadChar(); // Null terminator
|
||||
categoryNames[i] = new string(builtString.ToArray());
|
||||
}
|
||||
|
||||
// Obtain the Audio Categories
|
||||
reader.BaseStream.Seek(categoryOffset, SeekOrigin.Begin);
|
||||
INTERNAL_categories = new List<AudioCategory>();
|
||||
for (int i = 0; i < numCategories; i += 1)
|
||||
{
|
||||
// Maximum instances
|
||||
byte maxInstances = reader.ReadByte();
|
||||
|
||||
// Fade In/Out
|
||||
ushort fadeInMS = reader.ReadUInt16();
|
||||
ushort fadeOutMS = reader.ReadUInt16();
|
||||
|
||||
// Instance Behavior Flags
|
||||
byte instanceFlags = reader.ReadByte();
|
||||
int fadeType = instanceFlags & 0x07;
|
||||
int maxBehavior = instanceFlags >> 3;
|
||||
|
||||
// Parent Category
|
||||
short parent = reader.ReadInt16();
|
||||
|
||||
// Volume
|
||||
float volume = XACTCalculator.CalculateAmplitudeRatio(
|
||||
XACTCalculator.ParseDecibel(
|
||||
reader.ReadByte()
|
||||
)
|
||||
);
|
||||
|
||||
// Visibility Flags, unused
|
||||
reader.ReadByte();
|
||||
|
||||
// Add to the engine list and the parent category
|
||||
INTERNAL_categories.Add(
|
||||
new AudioCategory(
|
||||
categoryNames[i],
|
||||
volume,
|
||||
maxInstances,
|
||||
maxBehavior,
|
||||
fadeInMS,
|
||||
fadeOutMS,
|
||||
fadeType
|
||||
)
|
||||
);
|
||||
if (parent != -1)
|
||||
{
|
||||
INTERNAL_categories[parent].subCategories.Add(
|
||||
INTERNAL_categories[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Obtain the Variable Names
|
||||
reader.BaseStream.Seek(variableNameOffset, SeekOrigin.Begin);
|
||||
string[] variableNames = new string[numVariables];
|
||||
for (int i = 0; i < numVariables; i += 1)
|
||||
{
|
||||
List<char> builtString = new List<char>();
|
||||
while (reader.PeekChar() != 0)
|
||||
{
|
||||
builtString.Add(reader.ReadChar());
|
||||
}
|
||||
reader.ReadChar(); // Null terminator
|
||||
variableNames[i] = new string(builtString.ToArray());
|
||||
}
|
||||
|
||||
// Obtain the Variables
|
||||
reader.BaseStream.Seek(variableOffset, SeekOrigin.Begin);
|
||||
INTERNAL_variables = new List<Variable>();
|
||||
for (int i = 0; i < numVariables; i += 1)
|
||||
{
|
||||
// Variable Accessibility (See Variable constructor)
|
||||
byte varFlags = reader.ReadByte();
|
||||
|
||||
// Variable Value, Boundaries
|
||||
float initialValue = reader.ReadSingle();
|
||||
float minValue = reader.ReadSingle();
|
||||
float maxValue = reader.ReadSingle();
|
||||
|
||||
// Add to the engine list
|
||||
INTERNAL_variables.Add(
|
||||
new Variable(
|
||||
variableNames[i],
|
||||
(varFlags & 0x01) != 0,
|
||||
(varFlags & 0x02) != 0,
|
||||
(varFlags & 0x04) == 0,
|
||||
(varFlags & 0x08) != 0,
|
||||
initialValue,
|
||||
minValue,
|
||||
maxValue
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Obtain the RPC Curves
|
||||
reader.BaseStream.Seek(rpcOffset, SeekOrigin.Begin);
|
||||
INTERNAL_RPCs = new Dictionary<long, RPC>();
|
||||
for (int i = 0; i < numRPCs; i += 1)
|
||||
{
|
||||
// RPC "Code", used by the SoundBanks
|
||||
long rpcCode = reader.BaseStream.Position;
|
||||
|
||||
// RPC Variable
|
||||
ushort rpcVariable = reader.ReadUInt16();
|
||||
|
||||
// Number of RPC Curve Points
|
||||
byte numPoints = reader.ReadByte();
|
||||
|
||||
// RPC Parameter
|
||||
ushort rpcParameter = reader.ReadUInt16();
|
||||
|
||||
// RPC Curve Points
|
||||
RPCPoint[] rpcPoints = new RPCPoint[numPoints];
|
||||
for (byte j = 0; j < numPoints; j += 1)
|
||||
{
|
||||
float x = reader.ReadSingle();
|
||||
float y = reader.ReadSingle();
|
||||
byte type = reader.ReadByte();
|
||||
rpcPoints[j] = new RPCPoint(
|
||||
x, y,
|
||||
(RPCPointType) type
|
||||
);
|
||||
}
|
||||
|
||||
// Add to the engine list
|
||||
INTERNAL_RPCs.Add(
|
||||
rpcCode,
|
||||
new RPC(
|
||||
INTERNAL_variables[rpcVariable].Name,
|
||||
rpcParameter,
|
||||
rpcPoints
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Obtain the DSP Parameters
|
||||
reader.BaseStream.Seek(dspParameterOffset, SeekOrigin.Begin);
|
||||
INTERNAL_dspParameters = new List<DSPParameter>();
|
||||
for (int i = 0; i < numDSPParameters; i += 1)
|
||||
{
|
||||
// Effect Parameter Type
|
||||
byte type = reader.ReadByte();
|
||||
|
||||
// Effect value, boundaries
|
||||
float value = reader.ReadSingle();
|
||||
float minVal = reader.ReadSingle();
|
||||
float maxVal = reader.ReadSingle();
|
||||
|
||||
// Unknown value
|
||||
reader.ReadUInt16();
|
||||
|
||||
// Add to Parameter list
|
||||
INTERNAL_dspParameters.Add(
|
||||
new DSPParameter(
|
||||
type,
|
||||
value,
|
||||
minVal,
|
||||
maxVal
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Obtain the DSP Presets
|
||||
reader.BaseStream.Seek(dspPresetOffset, SeekOrigin.Begin);
|
||||
INTERNAL_dspPresets = new Dictionary<long, DSPPreset>();
|
||||
int total = 0;
|
||||
for (int i = 0; i < numDSPPresets; i += 1)
|
||||
{
|
||||
// DSP "Code", used by the SoundBanks
|
||||
long dspCode = reader.BaseStream.Position;
|
||||
|
||||
// Preset Accessibility
|
||||
bool global = (reader.ReadByte() == 1);
|
||||
|
||||
// Number of preset parameters
|
||||
uint numParams = reader.ReadUInt32();
|
||||
|
||||
// Obtain DSP Parameters
|
||||
DSPParameter[] parameters = new DSPParameter[numParams];
|
||||
for (uint j = 0; j < numParams; j += 1)
|
||||
{
|
||||
parameters[j] = INTERNAL_dspParameters[total];
|
||||
total += 1;
|
||||
}
|
||||
|
||||
// Add to DSP Preset list
|
||||
INTERNAL_dspPresets.Add(
|
||||
dspCode,
|
||||
new DSPPreset(
|
||||
global,
|
||||
parameters
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Create the WaveBank Dictionary
|
||||
INTERNAL_waveBanks = new Dictionary<string, WaveBank>();
|
||||
|
||||
// Finally.
|
||||
IsDisposed = false;
|
||||
}
|
||||
|
||||
public AudioEngine(
|
||||
string settingsFile,
|
||||
TimeSpan lookAheadTime,
|
||||
string rendererId
|
||||
) {
|
||||
/* TODO: May require either resetting the ALDevice,
|
||||
* or adding a second AL device/context for this engine.
|
||||
* -flibit
|
||||
*/
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Destructor
|
||||
|
||||
~AudioEngine()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Dispose Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
if (Disposing != null)
|
||||
{
|
||||
Disposing.Invoke(this, null);
|
||||
}
|
||||
foreach (AudioCategory curCategory in INTERNAL_categories)
|
||||
{
|
||||
curCategory.Stop(AudioStopOptions.Immediate);
|
||||
}
|
||||
INTERNAL_categories.Clear();
|
||||
foreach (KeyValuePair<long, DSPPreset> curDSP in INTERNAL_dspPresets)
|
||||
{
|
||||
curDSP.Value.Dispose();
|
||||
}
|
||||
INTERNAL_dspPresets.Clear();
|
||||
INTERNAL_dspParameters.Clear();
|
||||
INTERNAL_variables.Clear();
|
||||
INTERNAL_RPCs.Clear();
|
||||
IsDisposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public AudioCategory GetCategory(string name)
|
||||
{
|
||||
if (String.IsNullOrEmpty(name))
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
for (int i = 0; i < INTERNAL_categories.Count; i += 1)
|
||||
{
|
||||
if (INTERNAL_categories[i].Name.Equals(name))
|
||||
{
|
||||
return INTERNAL_categories[i];
|
||||
}
|
||||
}
|
||||
throw new InvalidOperationException("Category not found!");
|
||||
}
|
||||
|
||||
public float GetGlobalVariable(string name)
|
||||
{
|
||||
if (String.IsNullOrEmpty(name))
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
for (int i = 0; i < INTERNAL_variables.Count; i += 1)
|
||||
{
|
||||
if (name.Equals(INTERNAL_variables[i].Name))
|
||||
{
|
||||
if (!INTERNAL_variables[i].IsGlobal)
|
||||
{
|
||||
throw new InvalidOperationException("Variable not global!");
|
||||
}
|
||||
return INTERNAL_variables[i].GetValue();
|
||||
}
|
||||
}
|
||||
throw new InvalidOperationException("Variable not found!");
|
||||
}
|
||||
|
||||
public void SetGlobalVariable(string name, float value)
|
||||
{
|
||||
if (String.IsNullOrEmpty(name))
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
for (int i = 0; i < INTERNAL_variables.Count; i += 1)
|
||||
{
|
||||
if (name.Equals(INTERNAL_variables[i].Name))
|
||||
{
|
||||
if (!INTERNAL_variables[i].IsGlobal)
|
||||
{
|
||||
throw new InvalidOperationException("Variable not global!");
|
||||
}
|
||||
INTERNAL_variables[i].SetValue(value);
|
||||
return; // We made it!
|
||||
}
|
||||
}
|
||||
throw new InvalidOperationException("Variable not found!");
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
// Update Global RPCs
|
||||
foreach (RPC curRPC in INTERNAL_RPCs.Values)
|
||||
if (curRPC.Parameter >= RPCParameter.NUM_PARAMETERS)
|
||||
foreach (Variable curVar in INTERNAL_variables)
|
||||
if (curVar.Name.Equals(curRPC.Variable) && curVar.IsGlobal)
|
||||
foreach (DSPPreset curDSP in INTERNAL_dspPresets.Values)
|
||||
{
|
||||
/* FIXME: This affects all DSP presets!
|
||||
* What if there's more than one?
|
||||
* -flibit
|
||||
*/
|
||||
curDSP.SetParameter(
|
||||
(int) curRPC.Parameter - (int) RPCParameter.NUM_PARAMETERS,
|
||||
curRPC.CalculateRPC(GetGlobalVariable(curVar.Name))
|
||||
);
|
||||
}
|
||||
|
||||
// Apply all DSP changes once they have been made
|
||||
foreach (DSPPreset curDSP in INTERNAL_dspPresets.Values)
|
||||
{
|
||||
AudioDevice.ALDevice.CommitReverbChanges(curDSP.Effect);
|
||||
}
|
||||
|
||||
// Update Cues
|
||||
foreach (AudioCategory curCategory in INTERNAL_categories)
|
||||
{
|
||||
curCategory.INTERNAL_update();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void INTERNAL_addWaveBank(string name, WaveBank waveBank)
|
||||
{
|
||||
INTERNAL_waveBanks.Add(name, waveBank);
|
||||
}
|
||||
|
||||
internal void INTERNAL_removeWaveBank(string name)
|
||||
{
|
||||
INTERNAL_waveBanks.Remove(name);
|
||||
}
|
||||
|
||||
internal SoundEffect INTERNAL_getWaveBankTrack(string name, ushort track)
|
||||
{
|
||||
return INTERNAL_waveBanks[name].INTERNAL_getTrack(track);
|
||||
}
|
||||
|
||||
internal void INTERNAL_dropWaveBankTrack(string name, ushort track)
|
||||
{
|
||||
if (INTERNAL_waveBanks.ContainsKey(name)) // AKA !WaveBank.IsDisposed
|
||||
{
|
||||
INTERNAL_waveBanks[name].INTERNAL_dropTrack(track);
|
||||
}
|
||||
}
|
||||
|
||||
internal string INTERNAL_getVariableName(ushort index)
|
||||
{
|
||||
return INTERNAL_variables[index].Name;
|
||||
}
|
||||
|
||||
internal RPC INTERNAL_getRPC(uint code)
|
||||
{
|
||||
return INTERNAL_RPCs[code];
|
||||
}
|
||||
|
||||
internal IALReverb INTERNAL_getDSP(uint code)
|
||||
{
|
||||
return INTERNAL_dspPresets[code].Effect;
|
||||
}
|
||||
|
||||
internal AudioCategory INTERNAL_initCue(Cue newCue, ushort category)
|
||||
{
|
||||
List<Variable> cueVariables = new List<Variable>();
|
||||
foreach (Variable curVar in INTERNAL_variables)
|
||||
{
|
||||
if (!curVar.IsGlobal)
|
||||
{
|
||||
cueVariables.Add(curVar.Clone());
|
||||
}
|
||||
}
|
||||
newCue.INTERNAL_genVariables(cueVariables);
|
||||
return INTERNAL_categories[category];
|
||||
}
|
||||
|
||||
internal bool INTERNAL_isGlobalVariable(string name)
|
||||
{
|
||||
// FIXME: Any way to speed this up? -flibit
|
||||
foreach (Variable curVar in INTERNAL_variables)
|
||||
{
|
||||
if (name.Equals(curVar.Name))
|
||||
{
|
||||
return curVar.IsGlobal;
|
||||
}
|
||||
}
|
||||
|
||||
// Variable doesn't even exist here...!
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.audiolistener.aspx
|
||||
public class AudioListener
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public Vector3 Forward
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Vector3 Position
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
|
||||
public Vector3 Up
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Vector3 Velocity
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructor
|
||||
|
||||
public AudioListener()
|
||||
{
|
||||
Forward = Vector3.Forward;
|
||||
Position = Vector3.Zero;
|
||||
Up = Vector3.Up;
|
||||
Velocity = Vector3.Zero;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.audiostopoptions.aspx
|
||||
public enum AudioStopOptions
|
||||
{
|
||||
AsAuthored,
|
||||
Immediate
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,417 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.dynamicsoundeffectinstance.aspx
|
||||
public sealed class DynamicSoundEffectInstance : SoundEffectInstance
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public int PendingBufferCount
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsLooped
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
// No-op, DynamicSoundEffectInstance cannot be looped!
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private XNA Variables
|
||||
|
||||
private int sampleRate;
|
||||
private AudioChannels channels;
|
||||
|
||||
private const int MINIMUM_BUFFER_CHECK = 3;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private AL Variables
|
||||
|
||||
private Queue<IALBuffer> queuedBuffers;
|
||||
private Queue<IALBuffer> buffersToQueue;
|
||||
private Queue<IALBuffer> availableBuffers;
|
||||
|
||||
#endregion
|
||||
|
||||
#region BufferNeeded Event
|
||||
|
||||
public event EventHandler<EventArgs> BufferNeeded;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructor
|
||||
|
||||
public DynamicSoundEffectInstance(int sampleRate, AudioChannels channels) : base(null)
|
||||
{
|
||||
this.sampleRate = sampleRate;
|
||||
this.channels = channels;
|
||||
|
||||
PendingBufferCount = 0;
|
||||
|
||||
isDynamic = true;
|
||||
queuedBuffers = new Queue<IALBuffer>();
|
||||
buffersToQueue = new Queue<IALBuffer>();
|
||||
availableBuffers = new Queue<IALBuffer>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Destructor
|
||||
|
||||
~DynamicSoundEffectInstance()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Dispose Method
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
base.Dispose(); // Will call Stop(true);
|
||||
|
||||
// Delete all known buffer objects
|
||||
while (queuedBuffers.Count > 0)
|
||||
{
|
||||
AudioDevice.ALDevice.DeleteBuffer(queuedBuffers.Dequeue());
|
||||
}
|
||||
queuedBuffers = null;
|
||||
while (availableBuffers.Count > 0)
|
||||
{
|
||||
AudioDevice.ALDevice.DeleteBuffer(availableBuffers.Dequeue());
|
||||
}
|
||||
availableBuffers = null;
|
||||
while (buffersToQueue.Count > 0)
|
||||
{
|
||||
AudioDevice.ALDevice.DeleteBuffer(buffersToQueue.Dequeue());
|
||||
}
|
||||
buffersToQueue = null;
|
||||
|
||||
IsDisposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Time/Sample Information Methods
|
||||
|
||||
public TimeSpan GetSampleDuration(int sizeInBytes)
|
||||
{
|
||||
return SoundEffect.GetSampleDuration(
|
||||
sizeInBytes,
|
||||
sampleRate,
|
||||
channels
|
||||
);
|
||||
}
|
||||
|
||||
public int GetSampleSizeInBytes(TimeSpan duration)
|
||||
{
|
||||
return SoundEffect.GetSampleSizeInBytes(
|
||||
duration,
|
||||
sampleRate,
|
||||
channels
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public SubmitBuffer Methods
|
||||
|
||||
public void SubmitBuffer(byte[] buffer)
|
||||
{
|
||||
this.SubmitBuffer(buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public void SubmitBuffer(byte[] buffer, int offset, int count)
|
||||
{
|
||||
// Generate a buffer if we don't have any to use.
|
||||
if (availableBuffers.Count == 0)
|
||||
{
|
||||
availableBuffers.Enqueue(
|
||||
AudioDevice.ALDevice.GenBuffer(sampleRate, channels)
|
||||
);
|
||||
}
|
||||
|
||||
// Push buffer to the AL.
|
||||
IALBuffer newBuf = availableBuffers.Dequeue();
|
||||
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
|
||||
AudioDevice.ALDevice.SetBufferData(
|
||||
newBuf,
|
||||
handle.AddrOfPinnedObject(),
|
||||
offset,
|
||||
count
|
||||
);
|
||||
handle.Free();
|
||||
|
||||
// If we're already playing, queue immediately.
|
||||
if (INTERNAL_alSource != null)
|
||||
{
|
||||
AudioDevice.ALDevice.QueueSourceBuffer(
|
||||
INTERNAL_alSource,
|
||||
newBuf
|
||||
);
|
||||
queuedBuffers.Enqueue(newBuf);
|
||||
|
||||
// If the source stopped, reboot it now.
|
||||
if (AudioDevice.ALDevice.GetSourceState(INTERNAL_alSource) == SoundState.Stopped)
|
||||
{
|
||||
AudioDevice.ALDevice.PlaySource(INTERNAL_alSource);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffersToQueue.Enqueue(newBuf);
|
||||
}
|
||||
|
||||
PendingBufferCount += 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Play Method
|
||||
|
||||
public override void Play()
|
||||
{
|
||||
Play(true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Play Method
|
||||
|
||||
internal void Play(bool isManaged)
|
||||
{
|
||||
// No-op if we're already playing.
|
||||
if (State != SoundState.Stopped)
|
||||
{
|
||||
if (State == SoundState.Paused)
|
||||
{
|
||||
// ... but be sure pause/resume still works
|
||||
Resume();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (INTERNAL_alSource != null)
|
||||
{
|
||||
// The sound has stopped, but hasn't cleaned up yet...
|
||||
AudioDevice.ALDevice.StopAndDisposeSource(INTERNAL_alSource);
|
||||
INTERNAL_alSource = null;
|
||||
}
|
||||
while (queuedBuffers.Count > 0)
|
||||
{
|
||||
availableBuffers.Enqueue(queuedBuffers.Dequeue());
|
||||
PendingBufferCount -= 1;
|
||||
}
|
||||
|
||||
if (AudioDevice.ALDevice == null)
|
||||
{
|
||||
throw new NoAudioHardwareException();
|
||||
}
|
||||
|
||||
INTERNAL_alSource = AudioDevice.ALDevice.GenSource();
|
||||
if (INTERNAL_alSource == null)
|
||||
{
|
||||
FNALoggerEXT.LogWarn("AL SOURCE WAS NOT AVAILABLE, SKIPPING.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Queue the buffers to this source
|
||||
while (buffersToQueue.Count > 0)
|
||||
{
|
||||
IALBuffer nextBuf = buffersToQueue.Dequeue();
|
||||
queuedBuffers.Enqueue(nextBuf);
|
||||
AudioDevice.ALDevice.QueueSourceBuffer(INTERNAL_alSource, nextBuf);
|
||||
}
|
||||
|
||||
// Apply Pan/Position
|
||||
if (INTERNAL_positionalAudio)
|
||||
{
|
||||
INTERNAL_positionalAudio = false;
|
||||
AudioDevice.ALDevice.SetSourcePosition(
|
||||
INTERNAL_alSource,
|
||||
position
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Pan = Pan;
|
||||
}
|
||||
|
||||
// Reassign Properties, in case the AL properties need to be applied.
|
||||
Volume = Volume;
|
||||
Pitch = Pitch;
|
||||
|
||||
// ... but wait! What if we need moar buffers?
|
||||
for (
|
||||
int i = MINIMUM_BUFFER_CHECK - PendingBufferCount;
|
||||
(i > 0) && BufferNeeded != null;
|
||||
i -= 1
|
||||
) {
|
||||
BufferNeeded(this, null);
|
||||
}
|
||||
|
||||
// Finally.
|
||||
AudioDevice.ALDevice.PlaySource(INTERNAL_alSource);
|
||||
if (isManaged)
|
||||
{
|
||||
AudioDevice.DynamicInstancePool.Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Update Method
|
||||
|
||||
internal void Update()
|
||||
{
|
||||
// Get the number of processed buffers.
|
||||
int finishedBuffers = AudioDevice.ALDevice.CheckProcessedBuffers(
|
||||
INTERNAL_alSource
|
||||
);
|
||||
if (finishedBuffers == 0)
|
||||
{
|
||||
// Nothing to do... yet.
|
||||
return;
|
||||
}
|
||||
|
||||
// Dequeue the processed buffers, error checking as needed.
|
||||
AudioDevice.ALDevice.DequeueSourceBuffers(
|
||||
INTERNAL_alSource,
|
||||
finishedBuffers,
|
||||
queuedBuffers
|
||||
);
|
||||
|
||||
// The processed buffers are now available.
|
||||
for (int i = 0; i < finishedBuffers; i += 1)
|
||||
{
|
||||
availableBuffers.Enqueue(queuedBuffers.Dequeue());
|
||||
}
|
||||
|
||||
// PendingBufferCount changed during playback, trigger now!
|
||||
PendingBufferCount -= finishedBuffers;
|
||||
if (BufferNeeded != null)
|
||||
{
|
||||
BufferNeeded(this, null);
|
||||
}
|
||||
|
||||
// Do we need even moar buffers?
|
||||
for (
|
||||
int i = MINIMUM_BUFFER_CHECK - PendingBufferCount;
|
||||
(i > 0) && BufferNeeded != null;
|
||||
i -= 1
|
||||
) {
|
||||
BufferNeeded(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Sample Data Retrieval Method
|
||||
|
||||
internal void GetSamples(float[] samples)
|
||||
{
|
||||
if (INTERNAL_alSource != null && queuedBuffers.Count > 0)
|
||||
{
|
||||
GCHandle handle = GCHandle.Alloc(samples, GCHandleType.Pinned);
|
||||
AudioDevice.ALDevice.GetBufferData(
|
||||
INTERNAL_alSource,
|
||||
queuedBuffers.ToArray(), // FIXME: Blech -flibit
|
||||
handle.AddrOfPinnedObject(),
|
||||
samples.Length,
|
||||
channels
|
||||
);
|
||||
handle.Free();
|
||||
}
|
||||
else
|
||||
{
|
||||
Array.Clear(samples, 0, samples.Length);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public FNA Extension Methods
|
||||
|
||||
public void SubmitFloatBufferEXT(float[] buffer)
|
||||
{
|
||||
SubmitFloatBufferEXT(buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public void SubmitFloatBufferEXT(float[] buffer, int offset, int count)
|
||||
{
|
||||
/* Float samples are the typical format received from decoders.
|
||||
* We currently use this for the VideoPlayer.
|
||||
* -flibit
|
||||
*/
|
||||
|
||||
// Generate a buffer if we don't have any to use.
|
||||
if (availableBuffers.Count == 0)
|
||||
{
|
||||
availableBuffers.Enqueue(AudioDevice.ALDevice.GenBuffer(sampleRate, channels));
|
||||
}
|
||||
|
||||
// Push buffer to the AL.
|
||||
IALBuffer newBuf = availableBuffers.Dequeue();
|
||||
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
|
||||
AudioDevice.ALDevice.SetBufferFloatData(
|
||||
newBuf,
|
||||
handle.AddrOfPinnedObject(),
|
||||
offset,
|
||||
count
|
||||
);
|
||||
handle.Free();
|
||||
|
||||
// If we're already playing, queue immediately.
|
||||
if (INTERNAL_alSource != null)
|
||||
{
|
||||
AudioDevice.ALDevice.QueueSourceBuffer(
|
||||
INTERNAL_alSource,
|
||||
newBuf
|
||||
);
|
||||
queuedBuffers.Enqueue(newBuf);
|
||||
|
||||
// If the source stopped, reboot it now.
|
||||
if (AudioDevice.ALDevice.GetSourceState(INTERNAL_alSource) == SoundState.Stopped)
|
||||
{
|
||||
AudioDevice.ALDevice.PlaySource(INTERNAL_alSource);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffersToQueue.Enqueue(newBuf);
|
||||
}
|
||||
|
||||
PendingBufferCount += 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.instanceplaylimitexception.aspx
|
||||
[Serializable]
|
||||
public sealed class InstancePlayLimitException : ExternalException
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,221 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
public class Microphone
|
||||
{
|
||||
#region Public Static Properties
|
||||
|
||||
public static ReadOnlyCollection<Microphone> All
|
||||
{
|
||||
get;
|
||||
internal set;
|
||||
}
|
||||
|
||||
public static Microphone Default
|
||||
{
|
||||
get
|
||||
{
|
||||
if (All.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return All[0];
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public TimeSpan BufferDuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return bufferDuration;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( value.Milliseconds < 100 ||
|
||||
value.Milliseconds > 1000 ||
|
||||
value.Milliseconds % 10 != 0 )
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
bufferDuration = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHeadset
|
||||
{
|
||||
get
|
||||
{
|
||||
// FIXME: I think this is just for Windows Phone? -flibit
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int SampleRate
|
||||
{
|
||||
get
|
||||
{
|
||||
return SAMPLERATE;
|
||||
}
|
||||
}
|
||||
|
||||
public MicrophoneState State
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Variables
|
||||
|
||||
public readonly string Name;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Variables
|
||||
|
||||
private TimeSpan bufferDuration;
|
||||
private IntPtr nativeMic;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler<EventArgs> BufferReady;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Constants
|
||||
|
||||
/* FIXME: This is what XNA4 aims for, but it _could_ be lower.
|
||||
* Something work looking at is falling back to lower sample rates in
|
||||
* powers of two, i.e. 44100, 22050, 11025, etc.
|
||||
* -flibit
|
||||
*/
|
||||
private const int SAMPLERATE = 44100;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Constructor
|
||||
|
||||
internal Microphone(string name)
|
||||
{
|
||||
Name = name;
|
||||
bufferDuration = TimeSpan.FromSeconds(1.0);
|
||||
State = MicrophoneState.Stopped;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public int GetData(byte[] buffer)
|
||||
{
|
||||
return GetData(buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public int GetData(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentException("buffer is null!");
|
||||
}
|
||||
if (offset < 0 || offset > buffer.Length)
|
||||
{
|
||||
throw new ArgumentException("offset");
|
||||
}
|
||||
if (count <= 0 || (offset + count) > buffer.Length)
|
||||
{
|
||||
throw new ArgumentException("count");
|
||||
}
|
||||
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
|
||||
int read = AudioDevice.ALDevice.CaptureSamples(
|
||||
nativeMic,
|
||||
handle.AddrOfPinnedObject() + offset,
|
||||
count
|
||||
);
|
||||
handle.Free();
|
||||
return read;
|
||||
}
|
||||
|
||||
public TimeSpan GetSampleDuration(int sizeInBytes)
|
||||
{
|
||||
return SoundEffect.GetSampleDuration(
|
||||
sizeInBytes,
|
||||
SampleRate,
|
||||
AudioChannels.Mono
|
||||
);
|
||||
}
|
||||
|
||||
public int GetSampleSizeInBytes(TimeSpan duration)
|
||||
{
|
||||
return SoundEffect.GetSampleSizeInBytes(
|
||||
duration,
|
||||
SampleRate,
|
||||
AudioChannels.Mono
|
||||
);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (State == MicrophoneState.Stopped)
|
||||
{
|
||||
nativeMic = AudioDevice.ALDevice.StartDeviceCapture(
|
||||
Name,
|
||||
SampleRate,
|
||||
GetSampleSizeInBytes(bufferDuration)
|
||||
);
|
||||
if (nativeMic == IntPtr.Zero)
|
||||
{
|
||||
throw new NoMicrophoneConnectedException(Name);
|
||||
}
|
||||
AudioDevice.ActiveMics.Add(this);
|
||||
State = MicrophoneState.Started;
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (State == MicrophoneState.Started)
|
||||
{
|
||||
AudioDevice.ActiveMics.Remove(this);
|
||||
AudioDevice.ALDevice.StopDeviceCapture(nativeMic);
|
||||
nativeMic = IntPtr.Zero;
|
||||
State = MicrophoneState.Stopped;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void CheckBuffer()
|
||||
{
|
||||
if ( BufferReady != null &&
|
||||
AudioDevice.ALDevice.CaptureHasSamples(nativeMic) )
|
||||
{
|
||||
BufferReady(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
public enum MicrophoneState
|
||||
{
|
||||
Started,
|
||||
Stopped
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.noaudiohardwareexception.aspx
|
||||
[Serializable]
|
||||
public sealed class NoAudioHardwareException : ExternalException
|
||||
{
|
||||
public NoAudioHardwareException()
|
||||
{
|
||||
}
|
||||
|
||||
public NoAudioHardwareException(String message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public NoAudioHardwareException(String message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
// http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.nomicrophoneconnectedexception.aspx
|
||||
[Serializable]
|
||||
public sealed class NoMicrophoneConnectedException : Exception
|
||||
{
|
||||
public NoMicrophoneConnectedException()
|
||||
{
|
||||
}
|
||||
|
||||
public NoMicrophoneConnectedException(String message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public NoMicrophoneConnectedException(String message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
#region License
|
||||
/* FNA - XNA4 Reimplementation for Desktop Platforms
|
||||
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
|
||||
*
|
||||
* Released under the Microsoft Public License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.Xna.Framework.Audio
|
||||
{
|
||||
[Serializable]
|
||||
public struct RendererDetail
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string FriendlyName
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string RendererId
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Constructor
|
||||
|
||||
internal RendererDetail(string name, string id) : this()
|
||||
{
|
||||
FriendlyName = name;
|
||||
RendererId = id;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return ( (obj is RendererDetail) &&
|
||||
RendererId.Equals(((RendererDetail) obj).RendererId) );
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return RendererId.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return FriendlyName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Static Operator Overloads
|
||||
|
||||
public static bool operator==(RendererDetail left, RendererDetail right)
|
||||
{
|
||||
return left.RendererId.Equals(right.RendererId);
|
||||
}
|
||||
|
||||
public static bool operator!=(RendererDetail left, RendererDetail right)
|
||||
{
|
||||
return !left.RendererId.Equals(right.RendererId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue