Release Notes (2012-09-28)

General Information

  • New release of SharpDX 2.3.0.
  • This version is compatible with Windows 8 RTM and Visual Studio 2012 RTM.
  • New target assemblies released : Signed-net40, Signed-winrt. Nuget packages are now providing signed assemblies.
  • *Lots* of small enhancements, changes, bug fixes. See complete listing below.
  • SharpDX.Toolkit, a high level XNA like API for Direct3D11 is under heavy development. The toolkit is not yet part of the distribution but a Beta version should be released by the end of October. Currently implemented:
    • Friendly constructors for all resources (states, textures, rendertargets, buffers).
    • Image and Texture loading & saving for various formats (DDS, JPG, PNG, BMP, TIFF, GIF).
    • A full HLSL Effect / FX system, very similar to legacy FX system, using efficiently Direct3D11, compatible with Windows Desktop and Windows 8 Modern, with a custom compilers. All XNA stock effects (BasicEffect, DualTextureEffect...etc.) were successfully ported to it. The toolkit is coming with its own effect compiler (tkfxc) similar to standard fxc.exe.
  • Concerning support for Windows Phone 8 (WP8) nothing to announce yet until the official release of the WP8 SDK.

Changes and Fixes

The following listing is automatically generated from commit logs.

ALL

  • API Breaking changes: Old Color struct was BGRA (1st byte Blue, 2nd byte Green...etc.). It is now RGBA (for consistency with Color3/4). There is a new ColorBGRA struct (used mainly by Direct3D9). Move stock Colors to Color struct. Change mapping D3DCOLOR to SharpDX.ColorBGRA. (changes)
  • Remove return SharpDX.Result for all methods that are already checking the result. (changes)

Build

  • Add new configuration for net40. Update all csproj (except Samples/*.csproj). Update build to support new binaries (Standard-net40, Signed-net40), update nuget specs with n40 target. Change all public key for signed assemblies, as the private key was lost. (changes)
  • Fix app manifest/certificates for Win8 and build (changes)
  • Fix build for Win8 with latest changes in handling SharpDX.Result (changes)
  • Fix compilation errors (changes)
  • Fix compilation under Win8 (changes)
  • Fix invalid references in SharpDX.sln (changes)
  • Fix issue with SharpDoc file copy (changes)
  • Fix nuget and documentation build steps (changes)
  • Fix nuget package to use only signed assemblies (changes)
  • Regenerate public keys as I lost the original private key for signed assemblies (idiot) (changes)

Build/Win8

  • Add all samples to the solution. It is no longer possible to compile Win8Metro targets under VS2011, unless you remove all Win8 samples. (changes)

D3D10/D3D11

  • Fix issue while marshaling Message in InfoQueue.GetMessage() method (changes)

D3DCompiler

  • Add sourceFileName to ShaderBytecode.Preprocess methods (changes)

Direct2D1

  • Add ImageEncoder constructor, remove previous ImagingFactor2.CreateImageEncoder method. Tranform WriteFrame methods using value-type for ImageParameters. (changes)
  • Fix issue #218. Flags is setup on all enums D2D1_.*_OPTIONS1? (changes)
  • Fix issue #247 (TableTransfer.Red/Green/Blue/Alpha Table) and issue #248 (Morphology Width, Height) (changes)
  • Fix issue #250. ResourceTexture constructor is now filling correctly native struct. (changes)

Direct2D1/WIC

  • Fix issue #224. Add Stream to all WIC Encoders. Add Bitmap.New constructors from generics. Fix disposable objects in samples SurfaceImageSourceTarget. (changes)

Direct3D10

  • Fix issue on ID3DX10Mesh Intersect.* methods that were not marked as PURE in original header file. (changes)

Direct3D11

  • Add ClearUnorderedAccessView method to accept uint value (changes)
  • Add comment for ResourceRegion (changes)
  • Add Default() method to SamplerStateDescription. Fix documentation in SamplerState constructors (changes)
  • Add Device.CheckFeatureXXX specialized methods for new D3D11.1 features (changes)
  • Add fast internal methods and make CommonShaderStage consistent between all stages. (changes)
  • Add SetUnorderedAccessViews simplified method for OutputMergerStage (changes)
  • All Texture constructors now accept DataBox as native methods. (changes)
  • DeviceContext.UpdateSubresource accept region with typed data (changes)
  • Fix DeviceContext documentation (changes)
  • Fix issue #257 ClearUnorderedAccessView values are Vector4 or Int4 (and not int or float!!!) (changes)
  • Fix issue with ID3D11Debug constructor. Rename Debug to DeviceDebug. (changes)
  • GetCreationFlags should return DeviceCreationFlags (changes)
  • Remove dependencies to D3DCompiler and Effects framework. A new assembly Direct3D11.Effects is created. (changes)
  • Remove usage of generics for Resource.ToFile (changes)

Direct3D11.Effects

  • Fix isue #240. Add EffectGroup.Description property. (changes)

Direct3D9

  • Add constructor for RenderToSurface (changes)
  • Fix Device.SetTransform method to accept Matrix passing by value. (changes)
  • Fix issue #220. Add nullable parameters for Sprite.Draw method (changes)
  • Fix issue #221. Add MeasureText method with rectangle parameter (changes)
  • Fix issue #252. Direct3D.CheckDeviceType return test should be == 0 (changes)
  • Fix issue #253, check for other return values in Query.GetData and throw error if different than Ok/False (changes)
  • Fix issue from forum http://sharpdx.org/forum/4-general/390-d3dfvf-texcoordsizen Add VertexFormatHelper.TexCoordSize() function. (changes)
  • Fix issue with GetFrontBufferData (changes)
  • Fix issue with Query.GetData to return result of operation (changes)
  • Fix switch/case problem in VertexFormatHelper (changes)

DirectWrite

  • Fix bug in FontFile.ReferenceKey property (changes)
  • Fix issue #227. Add TextFormat.SetTrimming method. (changes)
  • Fix issue #241. Remove throwing exceptions and try/catch from TextLayout methods. (changes)

Documentation

  • Add NamespaceDoc for SharpDX.Serialization and SharpDX.Text (changes)

DXGI

  • Add ToString method for SampleDescription (changes)
  • Better "performance" for FormatHelper.SizeOfInBits method. Fix size for all BC.* formats. (changes)
  • Improve FormatHelper "performance". (changes)

MediaFoundation

  • Add MediaEngine support. MediaPlayer still need some refactoring (changes)
  • Add MiniCubeVideoTexture sample for Windows 8 Metro (changes)
  • Work on MediaEngine, MediaPlayer is almost done (changes)

Samples

  • CommonDX.SurfaceImageSourceTarget, Add ToDispose (changes)
  • Fix compilation errors (changes)
  • Fix issue #235. Release Backbuffer before resize. (changes)
  • Fix issue #237. Add opacity flag to CommonDX.SurfaceImageSourceTarget (changes)
  • Fix MediaPlayer to be compatible with DeviceManager init process (changes)
  • Fix uv mapping for CubeTexture samples (changes)
  • Remove invalid assembly references (changes)

Samples.Win8

  • Fix issue #219. Add "" around path for fxc build event in order to support spaces in directory (changes)
  • Force all Win8 Modern samples to run under Direct3D11 feature level 9.1 (changes)

SharpCli

  • Fix inlined IL code replacement using the generic parameter from the current operand. (changes)
  • Remove hardcoded "C:\Program Files(x86)....etc." and replace it by using Environement (changes)
  • Use NET 4.0 client profile in order to run it fine on Windows 8 without 3.5 installed (changes)

SharpCLI

  • Fix bug when running from a subdirectory (changes)

SharpDoc

  • Fix ArgumentNullException when passing assemblies directly on the command line. (changes)

SharpDX

  • Add builtin support for IDataSerializable for all SharpDX types. (changes)
  • Add cast operator between SharpDX.Rectangle(F) and SharpDX.DrawingRectangle(F) (changes)
  • Add DisposableCollection and ComponentBase. (changes)
  • Add DynamicSerializerAttribute to basic types. (changes)
  • Add float constructors to Half vectors and implicit/explicit convertors with VectorX (changes)
  • Add implicit conversion for DrawingPointF <-> Vector2 (changes)
  • Add SharpDX.Bool for windows BOOL type (using 4 bytes) - instead of performing in-place conversion with bool (changes)
  • Add SharpDX.Color 32-bit structure. (changes)
  • Add support for Enum serialization in SharpDX.Serialization (changes)
  • Add support for NativeFileStream.Flush (changes)
  • Add support for serializing identity objects to SharpDX.Serialization (optional). Add tests for dynamics and identity. (changes)
  • Add Utilities.AllocateMemory supporting 16 byte aligned (changes)
  • Add Utilities.CompareMemory method (changes)
  • Add Utility.Compare methods (changes)
  • Add void* constructor to DataPointer (changes)
  • ComStreamProxy return 0 from read when delegate stream is returning zero, in order to avoid infinite loop (changes)
  • Finalize SharpDX.Serialization, add unit tests. (changes)
  • Fix bug in DataStream/DataBuffer.Create<T> and add support for pin/unpin + index offset. (changes)
  • Fix bug in method Utilities.CompareMemory (changes)
  • Fix bug in NativeFile.FlushFileBuffers (changes)
  • Fix bug in Utilities.AllocateMemory (changes)
  • Fix compilation error on Win8 (changes)
  • Fix compilation error with Rectangle bouuu (changes)
  • Fix compilation on Win8 for Serialization (changes)
  • Fix compiling issue on Win8 with Serialization. (changes)
  • Fix issue #222. Add ToString methods to Drawing.* structures (changes)
  • Fix issue #239. Replace checked by unchecked keyword. (changes)
  • Fix issue #243. Rename ShaderResourceViewDimension.TextureCubeArray (changes)
  • Fix issue #244. Breaking change for SharpDX.Color. Create SharpDX.ColorBGRA. Update SharpGen mapping to D3DCOLOR to ColorBGRA. Update Color and ColorBGRA for consistency. Remove implicit convertor from Color4 to Color. (changes)
  • Fix issue #254. Add * multiply opreator for Vector2/3/4. (changes)
  • Fix issue #255 & 237. Add Matrix3x2 operators, scaling, rotation...etc. (changes)
  • Fix memory alloc bug in ComArray (changes)
  • Improve performance Interop.SizeOf/Read/Write for a single T struct value. This may not be compatible with current version of Mono (changes)
  • Make DataBuffer inherit from Component (changes)
  • Remove Vector4 unused code (changes)
  • Start to add Serialization framework (changes)
  • Use aligned memory for ComArray (changes)

SharpDX.Serialization

  • Add support for packed int (used for count). Delayed Reader/Writer initialization based on Mode. Add object[], List<object> serializers. Switchback to AllowNull, AllowIdentity properties instead of methods. Update Tests. (changes)

SharpDX.Tests

  • Fix TestResultDescriptor (changes)

SharpGen

  • Add support to change the return type of a method (changes)
  • Add support to force by-value for pointers to value-type parameters with sizeof > 16 bytes. (changes)
  • Fix issue #211. X3DAudio is using cdecl instead of stdcall. Add support for cdecl in SharpGen. (changes)
  • Fix issue #246. Test for optional parameter before MarshalFree (changes)
  • Fix problem with partially Windows SDK installed by checking the existence of the include directory. (changes)
  • Update MSDN doc from VS2010 RTM (changes)

tkfxc

  • Remove unused files from project (changes)
  • Simplify using ConsoleProgram (changes)

Toolkit

  • New project SharpDX.Toolkit to store common classes shared by all SharpDX.Toolkit.* assemblies. (changes)

Toolkit.Compiler

  • Add support for identifier with namespace (Toolkit::VS for example) in fx file. (changes)

Toolkit.Graphics

  • 1st version of Effect framework. (changes)
  • Add a first sample MiniTri using Toolkit.Graphics. (changes)
  • Add all XNA stock effects (AlphaTestEffect, BasicEffect, DualTextureEffect, EnvironmentMapEffect, SkinnedEffect, SpriteEffect). (changes)
  • Add BlendState (changes)
  • Add BlendState, DepthStencilState, RasterizerState. (changes)
  • Add Buffer.Typed constructors. (changes)
  • Add Buffer<T> type. Rename VertexBufferLayout into VertexInputLayout and VertexBufferSlot into VertexBufferLayout (changes)
  • Add coments for Buffer.Raw/Structured (changes)
  • Add comments, refactor removing generic in inheritance (changes)
  • Add default effect group to GraphicsDevice. Add simplified constructors for all Stock Effects to use the default effect group. (changes)
  • Add DepthStencilBuffer (changes)
  • Add direct access to FeaturesPerFormat using an indexer on the GraphicsDeviceFeatures structure. (changes)
  • Add EffectParameter.GetValue and GetResource methods. (changes)
  • Add GraphicsAdapter class. (changes)
  • Add GraphicsDevice to all constructors. (changes)
  • Add GraphicsDevice.Viewport and GetViewport(index) method. (changes)
  • Add GraphicsDeviceFeatures to GraphicsDevice. (changes)
  • Add GraphicsInterval to GraphicsPresenter. Add Present method to both GraphicsPresenter and GraphicsDevice. (changes)
  • Add GraphicsPresenter frontend to DXGI.SwapChain (changes)
  • Add load DDS method (changes)
  • Add pluggable Image Load/Save through register method (changes)
  • Add PrimitiveType to all Draw methods. Add SetIndexBuffer / SetVertexBuffers methods. (changes)
  • Add RenderTarget, ShaderResource and UnorderedAccess view selectors on Texture. Fix GraphicsDevice.SetContent for textures. Change name in GraphicsDeviceFeatures (changes)
  • Add RenderTarget3D. Add support for correct initial textures for all versions Texture1D,2D,3D (changes)
  • Add SamplerState object with default states. (changes)
  • Add several methods from DeviceContext (ClearState, Flush, Draw, Dispatch... etc.) (changes)
  • Add some comments (changes)
  • Add support for additional bindings in Buffer.Raw constructors (changes)
  • Add support for all Buffers (Constant, Index, Vertex, Structured, StructuredAppend, StructuredCounter, Raw, RenderTarget) (changes)
  • Add support for Buffer.GetData/SetData with offsetInBytes handling (changes)
  • Add support for case insensitive semantic declaration. (changes)
  • Add support for dynamic attributes Vector2/3/4 to EffectBytecode (changes)
  • Add support for sub-pass in at runtime (in order to fully support BasicEffect) (changes)
  • Add support TextureCube, RenderTargetCube. Refactor Texture1/2/3D and RenderTarget1/2/3D. Improves GraphicsDevice.GetData/SetData for textures. (changes)
  • Add support to save DDS image. Tests completed for DDS. (changes)
  • Add tests for DDS loading. (changes)
  • Add Texture.New(Image) and Texture.Load/Save. Saving is not yet working for compressed BC formats. (changes)
  • Add TextureDimension to TextureDescription. (changes)
  • Add TGAHelper, not fully ported. (changes)
  • Add Toolkit Effect compiler and command line compiler (tkfxc) (changes)
  • Add XNA like VertexPosition.* predefined structures (changes)
  • By default, constant buffers are shared within an Effect. (changes)
  • Chance tests for DepthStencilBuffer feature level (changes)
  • Change GetData/SetData to GetContent/SetContent (changes)
  • Change TextureDescription to use PixelFormat (changes)
  • DDS Texture loading working. Tests are still incomplete. (changes)
  • Finalize PixelBuffer methods and usage from Image. Add Image.ToDataBox method. Fix memory leak for WIC images. Fix performance for DDS. Add TKTX proprietary file format. Add unit tests. (changes)
  • First fully working version with MiniTri using BasicEffect! \o/ (changes)
  • Fix bug in DDS. Add WIC Load and Save. (changes)
  • Fix bug in GraphicsDevice.GetContent for buffers (changes)
  • Fix comment on BlendState class (changes)
  • Fix comments and add sealed to various Effect classes. (changes)
  • Fix compilation under Win8 (changes)
  • Fix compilation under Win8 Metro (changes)
  • Fix constructors for all RenderTarget1D 2D and 3D (changes)
  • Fix constructors using generics for all Texture. Fix slice selector. Add tests for Texture1D. Fix all resources to use MainDevice instead of current device. (changes)
  • Fix databox checking for all textures (changes)
  • Fix doc (changes)
  • Fix documentation for BlendState, DepthStencilState, RasterizerState (changes)
  • Fix GraphicsDevice.GetContent and SetContent. Add MipMapDescription class. Fix Texture.Load and Texture.Save, now fully working and pass tests. \o/ (changes)
  • Fix handling of Blend/DepthStencil/Rasterizer states at the effect level. Rename GraphicsDevice.Get/SetContent to GetData/SetData and move them to Buffer/Texture. (changes)
  • Fix image.Dispose for DDS loading (changes)
  • Fix issue in EffectPass when comparing parameters. Fix compiler issue with 9.1/9.2/9.3 profile (changes)
  • Fix memory leak in Texture.Load and Save. Improves tests for texture loading/saving, check memory and GC. (changes)
  • Fix memory leak in WIC. Fix handling of compressed BC textures (changes)
  • Fix project configuration (changes)
  • Fix Texture1DBase.InitializeViews. Add implicit cast to DXGI.Surface for Texture1D and Texture2D (changes)
  • Fix Texture2D GetData/SetData for arbitrary struct (changes)
  • Fix type in Buffer.Constant (changes)
  • GraphicsDevice add check method to retrieve maxium MSAA count (changes)
  • Improve Constant buffer handling in Effect. (changes)
  • Improves methods coherence between Texture1D/2D and RenderTarget1D/2D (changes)
  • Make all effect constant buffers not shared by default (in order to keep compatibility with XNA effects). (changes)
  • Make constant buffers not shareable by default. Include generated bytecode for StockEffects into the project. Update tkfxc to support generating C# code with embedded effect bytecode. (changes)
  • Move all DeviceContext dependent operations (Copy/GetData/SetData) to GraphicsDevice (changes)
  • Moves ToStaging in TextureDescription (changes)
  • Provide GetData/SetData method with DataPointer parameter (changes)
  • Remove Effect from group when it is disposed. (changes)
  • Remove GraphicsDeviceContext to keep GraphicsDevice simple (changes)
  • Remove GraphicsState and use GraphicsResource for all resources. Update class diagram (changes)
  • Remove IVertexType. Add VertexLayout, VertexDeclaration, VertexElement and attributes. (changes)
  • Rename EffectBytecode to EffectData for future consitency with ModelData. (changes)
  • Rename SelectView to ViewType (changes)
  • Rename ShaderType to EffectShaderType (changes)
  • Rename ViewSlice to SelectView (changes)
  • RenderTarget2D update (changes)
  • Simplify Buffer/Texture GetData/SetData without explicity using a GraphicsDevice instance. (changes)
  • Start to add support for DDS texture loading/saving (changes)
  • Start to port WIC texture loading from DirectXTex (changes)
  • Update class diagram (changes)
  • Update class diagram (changes)
  • UpdateSubresource only valid for ResourceUsage.Default and not immutable (changes)
  • Use count instead of size for Structured and Typed buffers (changes)
  • Use DDSFlags.None instead of ForceDX10Ext (changes)
  • Use of Graphics.CurrentSafe for internal usage for all resource creations. (changes)
  • Work on Texture2D/RenderTarget2D to support Texture arrays, mip levels and multi-samples. (changes)
  • Work on VertexBuffer/VertexBufferLayout declarations, unfinished. (changes)

Toolkit.Graphics.Compiler

  • Add support for legacy D3D9 compile expression (VertexShader = compile vs_2_0 VS();). Get translated to vs/ps_4_0_level_9_1 (for 2_0) or level_9_3 (for 3_0) (changes)

Toolkit.tkfxc

  • Add better printer of subpasses. (changes)
  • Improves output listing of tkfxc.exe Effect Compiler, now very similar to legacy fxc.exe (changes)

Tools

  • Add SharpGitLog small tools to help building release notes for SharpDX (changes)

WIC

  • Add BitmapFrameEncode.WritePixels method to take an array of T[] (changes)
  • Add BitmapSource.CopyPixels method with direct pointer/size (changes)
  • Add missing [Flags] attributes to some enumerations (changes)
  • Add stride to Bitmap.New method (changes)

Download SharpDX

Stable version 2.4.2

Download Binaries PackageBinaries Package 2.4.2

Download Full PackageFull Package 2.4.2

Download Full PackageNuget Packages

Latest Dev PackageLatest Dev Package (2.5.0)

(Last Changes: May 22 2013 18:29:19)

Note: if you are using the Toolkit, use latest dev Package

Who is Online?

  • Fadi
  • Sentenryu
  • ROMAN5

Forum Latest

emzic's Avatar
By- emzic
Today 08:31
[Toolkit] Loading fx files thanks! it's true there is no vertexshader. i thought that spriteeffect is taking care of the vertex part like it did in xna.
Grobi's Avatar
By- Grobi
Yesterday 16:28
toolkit skybox Hi, i would like to know what would be the best way to implement a skybox with the toolkit 2.5 dev rel? Are there any tutorials or examples for that? I'd like to implement a starmap like skybox in a kind of space game which i built on top of the toolkit...
ChaosCom's Avatar
By- ChaosCom
Yesterday 13:24
Compiling SharpDX, SharpDXSamples, and SharpDXToolkitSamples from Github Compiling SharpDX, SharpDXSamples, and SharpDXToolkitSamples from the Github Sources Hi everyone, I thought I'd share some of my experiences and workarounds for some of the problems I encountered when trying to compile SharpDX and some of the samples from...
amaranth's Avatar
By- amaranth
Yesterday 06:32
SharpDX VideoPlayer In my WinForms .NET 4.0 application I want to play video with sound on panel. Anyone can give a simple example to do this? Or at least classes names in al arge set of classes. Thank you!
Doris's Avatar
By- Doris
Yesterday 06:31
Can't drawbitmap when use WicRenderTarget I am doing an application on Windows Store Apps, and want to draw some bitmaps and save to a png file. Code Removed and I got the error message: An unhandled exception of type 'System.AccessViolationException' occurred in...
phether's Avatar
By- phether
Yesterday 22:23
64-bit Great! thanks for both your replies! now to only find time to start prototyping... :) cheers p
_dave_'s Avatar
By- _dave_
22 May 2013 19:01
Simple (very simple) example of using SharpDX and D3DImage Hi. I'm looking for an simple (very simple) example of using SharpDX and D3DImage. Any suggestions?
Powered By nZambi!