Hi All,

Good news for SharpDX users that were asking for nightly-builds.... because they are here! (Check Latest Dev Package (xxx version) link)

In the past, SharpDX builds were not automated on each commits (though the build for official release was automated) and most of the developments for next version were done directly on 'master' branch (unless the development of a particular feature was enough large to have a dedicated branch). The results is that sometimes, some compilations for some platforms were not always tested (as It was laborious to check all platforms), leading to some unstable build on latest git. Also lots of users were asking for latest builds (because of the difficulty to meet all build requirements - VS 2012 Pro, Win SDK 7.1, DirectX June SDK 2010, Windows Phone 8 SDK...etc).

So in order to imrprove the situation, the build process has been streamlined:
  • A new 'master_integration' branch along the previous 'master' is used as a the main development branch where all commits are pushed (including merge from user commits)
  • All development on 'master_integration' are automatically pushed to 'master' when all projects are compiling fine for all targets (Net20, Net40, DirectX11.1, WinRT, WP8-x86/ARM * signed versions), including samples. Ideally this should also include unit tests, but they are not yet included.
  • There is now a TeamCity build server responsible for building 'master_integration' to 'master' (this process is running on my own PC). TeamCity is also checking commits on master_integration and should build everything automatically
  • It means that code on 'master' should be the latest 'stable' development version.
  • The new build system is also packaging a zip file containing latest binaries and samples (but not documentation). This binary package can be downloaded from the front page of this website.

There are still some minor bugs in the build system (TeamCity has some problems to run automatically the build when pending changes are detected) but It should improve in the coming weeks. This should also help to smoothly prepare the next release 2.5 of SharpDX.

Cheers,
xoofx
Hi All,

II gave a talk yesterday at the Tokyo Demo Fest 2013 about "Programming demos with C# and Direct3D11".

This is mostly an introduction to C# and Direct3D11, using SharpDX, with some tips about performance and advanced interop tricks.

Slides are available here.

Greetings,
xoofx
Hi!

This is a post to explain the plans for the next version, and as the Toolkit/Forum...etc. is causing me lots of overcharge on my sparetime work, I would like to take the time to clarify some details in this post.

Off-topic
I'm quite busy this week as I will give a talk about "Programming demos with C# and Direct3D11" at the Tokyo Demo Fest 2013. Live video streaming and slides should be available, so check it out. This will not be an advanced course, but more an introduction (most of demosceners are usually using C/ASM), but you could find some interesting infos and tips.

About the Toolkit
The Toolkit available in the last version of SharpDX - 2.4.2 - released 21 Dec 2012, has some major bugs that have been fixed since (along lots of others improvements/bugfixes for some other APIs). Thus in order to use it, you need to compile it yourself from the git repository. It requires a bit of install, setup and understand how the build is working to get it (and depending if you need to compile a WP8 version as well, It is not straightfoward), but this is the only way to have a somewhat stable version. If you are looking to use the toolkit and can't wait for the next official version, you will have to go this route.

About the next version 2.5
Next week, the work on releasing the new 2.5 version will begin. There are lots of things that will be introduced in this release: a proper installer, project templates and easy build for the toolkit, integrate compilation of FX files and Font files in projects...etc. + lots of cool things and bugfixes that have been developed since last version (like the great Toolkit.Input by artiom!). It will take around 2 to 3 weeks to finish the devs, package things...etc. This release should hopfully improve the developer experience when using the toolkit.

Community initiative
About a recent community initiative around building some Tutorials-Samples for the Toolkit, some users using the Toolkit got frustated about the lack of Direct3D11 samples using it (you can follow the whole discussion here). So starting with the release of 2.5 version, the community will try to bring some simple Direct3D11 tutorial/samples using the Toolkit. You can start to discuss about it in this thread.

About WP8 DllImport and Portable Class Library
First of all, thanks for the great support so far with more than 400 votes for the DllImport issue on WP8! (and special thanks to MonoGame Team!). Please continue to talk about this around you, as these votes will help a lot the CLR team to prioritize things for next release.

Also, as I have been harassed on Twitter about the lack of support of Portable Class Library aka PCL in SharpDX, so for once, I would like to clarify this here:

Until September 2011, SharpDX was only usable on Windows Desktop platform, so the need for some PCL was absolutely not evaluated. When WinRT was released, SharpDX went through lots of laborious refactoring to support Windows Desktop and Windows RT (which caused lots of annoying refactoring - no more File IO - while the native is always accessible, Reflection API completely broken...etc.), and the hardwork to move to this platforms (port of lots of samples, handle the new platform..etc.) didn't left any more time to think about PCL. Also PCL was *not* available for Windows 8 Developer release, and as far as I remmember, It was only available for the Windows 8 RC, around June 2012. At this time, SharpDX was absolutely not looking at PCL but was starting the development of the Toolkit. After last summer, I got an access to the WP8 SDK before its official release and made it possible for SharpDX to release on Day J a new version of SharpDX supporting WP8. This was probably the only large Open Source Project - and also against commercial projects - that were able to bring support for WP8 on day J. Lots of hard work... and absolutely no time to have a look at PCL, as I was also extremely busy to bring the Toolkit to life for the end of the year.

Now, that things are a little bit more settled (we have the 3 platforms almost on par, Windows Desktop, Windows RT and Windows Phone 8 ), the need for some PCL in SharpDX is getting critical, as we need a way to compile most of our projects without having to multiply compilation by the number of platforms. Unfortunately, due to the WP8 DllImport restriction, the full PCL for all platforms is not possible. At least, we can have PCL for .NET 4.0/4.5 Desktop and 4.5Core for WinRT, so this work could probably start slowly after 2.5, but the changes are quite laborious to handle (breaking changes on distribution, assembly splitting... etc.), and I can't guarantee that It will happen this year. Also, as we are developing at my work Paradox, a C# Game Engine, that is using SharpDX for all Windows Platforms, we are also directly concerned by this issue. But I would really prefer to work on porting SharpDX to PCL with full support for all platforms, instead of still having the pain to maintain the WP8 build that will polute all other builds/projects anyway (the Toolkit, MonoGame...etc.)

So please, be indulgent with your request for PCL support (or whatever request/bugfix). I have been working several thousands of hours on SharpDX so far, sometimes on lots of stuff I absolutely don't care, so seeing some users complaining strongly and naively about the lack of PCL SharpDX is particulary unfair and irritating. Too much unnecessary pressure on SharpDX, with somekind of overcharge/burnout rythm on myself, would give me enough reason to shutdown and close the project and just keep it private for some personnal usage and my work, so... beware.

I appreciate the support from the community, and that It is growing slowly but surely, with some nice feedback from users successfully using SharpDX for their projects. To paraphrase Mono with their C# slogan, We love more DirectX for .NET than Microsoft has ever been able to do!

Greetings!
xoofx

[Article on the Forum for comments]

Release Notes (2012-12-21)

General Information

A new version 2.4.2 of SharpDX is available today for download.

This version is a maintenance version, mainly fixing several issues and improving the SharpDX Toolkit.

This release is also introducing some breaking changes, so this is actually not what could be called a 'minor' release:

  • Replace all Viewport with a new global SharpDX.Viewport. The SharpDX.Direct3D11.Viewport with SharpDX.ViewportF.
  • Some enumerations names/class names has been renamed with more accurate CamelCase convention (In MediaFoundation, SharpDX.Direct2D1.RoundedRect renamed to RoundedRectangle, lots of D3D10/D3D11 MessageId enums now correctly named with camel case...etc.)

This release is integrating several patches made by the community on github. Thanks to all of them!

Changes and bugfixes

Please find below an auto-generated list of all changes and fixes from previous 2.4.1 version.

Build

  • Add Net35Plus defines to build project to allow usage of 3.5+ language features (extension methods...etc.) (changes)
  • Fix compilation error for DIRECTX11_1 target on desktop (changes)
  • Fix compilation error in sample (changes)
  • Fix compilation errors for Win8 platforms with latest DirectWrite update (changes)
  • Fix SharpDXWP8.sln (changes)
  • Update SharpDXWP8.sln to fix compilation errors (changes)

Direct3D

  • Replace all Viewport with new global SharpDX.Viewport. SharpDX.Direct3D11.Viewport with SharpDX.ViewportF. Add cast method from SharpDX.Viewport to ViewportF (changes)

Direct3D11

  • Fix issue #336. Remove some BlendState, DepthStencilState, RasterizerState constructors to avoid redundancy and conflicts in VB6 (changes)

Direct3D9

DirectWrite

DXGI

  • Add Output1.GetDisplayModeList1 method (changes)
  • Fix compilation error for DirectX11.0 (changes)

Samples

  • Fix issue #342. WP8 MiniCube SharpDXBase should use new SharpDX.ViewportF (changes)
  • Fix Win8 samples using new SharpDX.ViewportF (changes)

SharpDX

  • Add Color3.Black and Color3.White (changes)
  • Add Color4.Black and Color4.White (changes)
  • Add SharpDX.Win32.MessageFilterHook that provides IMessageFilter hook for a particular window HWND handle (changes)
  • Added missing commentary to Bool4. (changes)
  • Added new methods for random to MathUtil. (changes)
  • Change GetRandomXXX to NextXXX to match Random class naming. (changes)
  • Deactivate code Ray.GetPickRay as it is using a non accessible struct (changes)
  • Enclose MathUtil extension methods by #if NET35Plus (changes)
  • Fix issue #325. Explicit convert operator to Color3 was invalid (changes)
  • Utilities.LoadLibrary is now throwing DllNotFoundException if a native dll was not found from the path (changes)
  • Add clamp method for integers. (changes)
  • Add constructors for Color4 - fix issue 328 (changes)
  • Add Contains methods to DrawingRectangle. (changes)
  • Add Contains methods to DrawingRectangleF. (changes)
  • Add Contains methods to Rectangle. (changes)
  • Add Contains methods to RectangleF. (changes)
  • Add Matrix vectors. (changes)
  • Added GetPickRay method. (changes)
  • Fix bug inside Wrap - change to overload. (changes)
  • fix Issue 328 - Color3 ToString method bug fixed (changes)
  • fixes (changes)
  • fixing few grammatic errors (changes)
  • fixing few grammatic errors (changes)
  • fixing few grammatic errors (changes)
  • fixing some grammatic errors (changes)
  • fixing some grammatic errors (changes)
  • fixing some grammatic errors (changes)
  • Fixing some grammatic errors. (changes)
  • Make MathUtil static - add random extensions. (changes)
  • Merge branch 'pr/n15_Shqrdx' (changes)
  • Merge commit '889f0c926b9ae10ae378d65e1de800a76faef0c1' into newBranch3 (changes)
  • Merge pull request #12 from Shqrdx/patch-1 (changes)
  • Merge pull request #14 from Shqrdx/newBranch3 (changes)
  • Update Source/SharpDX/DrawingRectangleF.cs (changes)
  • Two simple gauss methods. (changes)

SharpGen

  • Change NamingRulesManager behavior for abbreviation. Breaking changes for somes enums/struct/class names that were previously not correctly CamelCase (changes)

Toolkit.Compiler

  • Add CompileOnlyIfNewer option to tkfxc command line. Make default to always compile. (changes)

Toolkit.Game

  • Added few comments to GameWindow (changes)
  • Fix issue #314. Add support for Window.ClientSizeChanged. Resize also the GraphicsPresenter swapchain, currently only supported under desktop (changes)
  • Fix issue #315. In window mode, mouse visible state is now only working on MouseEnter/MouseMove in the client area and not on the border/title bar. (changes)
  • Fix issue #320. Game.IsActive property is now set correctly according to Activated/Deactivated events. (changes)
  • Fix issue on Game.Run under WP8 that was setup as blocking instead of non blocking (changes)

Toolkit.Graphics

  • Add EffectConstantBuffer.Update method (changes)
  • Add RenderTarget2D.CreateDescription (changes)
  • Fix issue #317. Non 4x4 matrix were not uploaded correctly to constant buffers. (changes)
  • Fix issue #318. Add BasicEffect.Sampler property to allow changing the default sampler of a BasicEffect. (changes)
  • Fix issue #319. Plug all cleanup/Dispose methods for Toolkit Graphics and Game. (changes)
  • Fix issue #321. VertexInputLayout caching system was invalid, causing the same input layout used by different vertex shaders to failed. (changes)
  • Fix issue #327. Rename method to Texture.GetDataAsImage and add method Texture.SetData(Image) (changes)
  • Fix issue #330. A SpriteBatch.Draw method was not taking rotation into account (changes)
  • Fix issue #335. Using StructLayout.Explicit with fixed size and field offset was generating a wrong code (seems a bug in JIT), leading to a crash in EffectPass.Apply(). Change Explicit layout to sequential and remove field offset fixed this. (changes)
  • Fix issue with indexable resource array when compiling with SM5.0. Fix Effect bug for indexable variable bound to multiple slots. (changes)
  • Make GraphicsAdapter working even if we cannot retrieve the output display modes. (changes)
  • Optimize resource slot bindings by compacting consecutive slots in Effect/EffectPass. (changes)
  • Start to add ModelData. (changes)

WIC

  • Add SharpDX.WIC.ResultCode from WINCODEC_ERR_.* macros (changes)

XAudio2

XInput

  • Add new Controller.GetState method to perform GetState and IsConnected in a same call. Add Controller.UserIndex value (changes)

Release Notes (2012-11-20)

General Information

A new version 2.4.1 of SharpDX is available today for download.

This version is a maintenance version, mainly fixing several issues and improving the SharpDX Toolkit.

PrimitiveBatch from DirectXTk has been ported to the Toolkit. Also, there is a new convenient method to draw a full screen quad using GraphicsDevice.DrawQuad. See details about changes in the Toolkit below.

Note about using the Toolkit effect compiler (tkfxc.exe): You can use either the version from:

  • The directory Bin\Net40Release if you have DirectX End-User Runtime June 2010 installed.
  • Or you can use directly Bin\Win8Desktop-net40 which is shipped with D3DCompiler_46.dll
  • Both versions can compiled shaders for all Windows (from Desktop, Windows RT and Windows Phone 8, except if you are using latest D3D11.1 features which are only available using d3dcompiler_46.dll)

As It was explained in a previous post, SharpDX is now accepting code contribution from the community. This release is integrating contributions from early contributors to SharpDX on github!

Concerning the support, I'm focusing my primary support for the core functions of the following API:

  • Direct3D11 (not Effect11 framework), DXGI, D3DCompiler, XAudio2 and Audio part of MediaFoundation.
  • The toolkit, the Toolkit.Graphics and compiler. The Toolkit.Game assembly has a lower priority (for non desktop platforms).

For other API, I strongly encourage the community to participate to fix bugs and/or add improvements, as they have a lower priority support now in SharpDX.

Concerning the forum, my personnal investement to respond to API usage has now a much lower priority, as explained in the "Changes in Support and Community" post.

Also, as indicated on the contact form, I will not respond to any private inquiry about SharpDX bug notice or API usage. Thank you for your understanding.

Changes and bugfixes

Please find below an auto-generated list of all changes and fixes from previous 2.4 version.

Code contributed by SharpDX Community

  • Added missing XAudio interop methods for WP8. (changes, changes)
  • Fix for Incorrect SetPixel and SetVertexShaderConstant (F and I arrays) where count were incorrectly *4 (changes)
  • Fix issue #305.[DX11] Missing functions in Direct3D11.EffectPass (changes, changes)
  • Fixed IDrawingSurfaceBackgroundContentProviderNative.PrepareResources to properly support desiredRenderTargetSize as an in/out var. (changes)
  • Merge branch 'master' into wp8 (changes)
  • Merge pull request #1 from jbriguet/master (changes)
  • Merge remote-tracking branch 'origin/master' (changes)
  • Updated fix for SetVertexShaderConstant (changes)
  • Added ColorConverter & Color4Converter (changes)
  • Added SourceType VideoCaptureGuid and AudioCaptureGuid in SharpDX.MediaFoundation.CaptureDeviceAttributeKeys (changes)
  • Fix mapping in MediaFoundation for various functions by using mf.dll (changes)

Build

  • Remove ProjectTypeGuids on SharpDX project, as it is conflicting when WP8 SDK is not installed. (changes)
  • Update README.markdown for github (changes)

SharpDoc

  • Remove assembly documentation in order to support same namespace declared in different assemblies. Now, namespaces are the top level topic item in the class library reference. (changes)

SharpDX

  • Fix issue #282. Matrix3x2.TransformationPoint was not valid. (changes)
  • Fix issue #283. Add new wrap methods to MathUtil (changes)
  • Fix issue #292. A regression bug was introduced in RenderForm that was preventing anykind of interaction with it. This patch fix a code that went to git by mistake. (changes)

SharpGitLog

Toolkit

  • Add an exception to ContentManager.Load when there is no registered resolvers (changes)

Toolkit.Compiler

  • Add a check when missing a parenthesis, bracket, curly brace in FX file and generate a parsing error. (changes)

Toolkit.Game

  • Add better support for PreferredGraphicsProfile in GraphicsDeviceManager (changes)
  • Add IContentable to allow a GameSystem to Load and Unload content as in the game class. Add Content and GraphicsDevice property directly to accessible to a GameSystem. (changes)
  • Add support Activated, Deactivated and Exiting events for Desktop platform (they are not yet implemented for Windows RT and WP8) (changes)
  • Fix issue #281. Game.IsMouseVisible is now working on Desktop (bis) (changes)
  • Fix issue #281. Game.IsMouseVisible is now working on Desktop. (changes)
  • Fix issue #291. Allows PreferredBackBufferWidth / PreferredBackBufferHeight to be effectively used in non-fullscreen scenario. (changes)
  • Fix issue #309 crash on phone HW devices where the adapter is null because the attached adapter to the device is invalid (changes)
  • Fix issue #309. Allow null value for GraphicsDeviceInformation.Adapter. (changes)
  • Fix issue #310. Private variable in game was not initialized. (changes)

Toolkit.Graphics

  • Add BasicEffect.TextureView to allow ShaderResourceView instead of texture2D. Change BasicEffect.Texture to accept Texture2DBase (changes)
  • Add comments to PrimitiveBatch. Add automatic VertexInputLayout for vertices with known VertexElements. (changes)
  • Add comments to PrimitiveQuad / GraphicsDevice.DrawQuad (changes)
  • Add generic Texture.New method. Add equals/hashcode to TextureDescription (changes)
  • Add GraphicsDevice.Clear method similar to XNA (changes)
  • Add PrimitiveQuad and GraphicsDevice.DrawQuad for fullscreen quad primitive. Modify CustomEFfectContent sample to use the new DrawQuad method. (changes)
  • Add test and TextureInfo comment to SpriteBatch. (changes)
  • Fix access to unordered access view on texture. (changes)
  • Fix bug in GraphicsDevice.SetVertexBuffers. Test that PrimitiveBatch is running fine. (changes)
  • Fix compiling error typo in SpriteBatch (changes)
  • Fix GameWindow.AllowUserResizing (changes)
  • Fix issue #284. Sorting mode was not working on a particular SpriteBatch.Draw method. (changes)
  • Fix issue #286. SpriteBatch was not working with multiple instance. (changes)
  • Fix issue #289. Allows a pass to set a shader stage to null (changes)
  • Fix issue #296. Severe bug in effect that was preventing Effect to work properly with resource to bind. (changes)
  • Fix issue #301. SpriteEffects.FlipXXX modes are now working correctly (changes)
  • Fix issue #304. Add virtual to GameSystem.Initialize and fire events methods (changes)
  • Fix ordering of static/readonly members in SpriteBatch. Remove unused members. (changes)
  • Fix performance weird issue under x64 for SpriteBatch. Should now be on par with x86 (changes)
  • Initialzie the TextureSampler to use the default SamplerSate in BasicEffect in order to avoid invalid error messages when debugging the device (changes)
  • Modify SpriteBatch to allow ShaderResourceView instead of Texture2D, as it is much more versatile. (changes)
  • Move test for CustomEffect.CurrentTechnique to a upper level in SpriteBatch (changes)
  • Port PrimitiveBatch from DirectXTk. Not yet tested. (changes)
  • Remove DeviceCreationFlags.Debug from CustomEffectGame sample (changes)
  • Simplifies SpriteBatch immediate mode using same behavior as in DirectXTk (changes)
  • Update GraphicsDevice.GetOrCreateSharedData<T> to accept "object key" instead of "string key". (changes)

Toolkit.tkfxc

  • Fix issue #287. Add Redist D3DCompiler_46.dll to the build. Update tkfxc to use a dynamic path to load d3dcompiler dll for Win8Desktop-net40 version. (changes)
  • The command line compiler is now not compiling/writing the output if the input is not more recent (changes)

XAudio2

  • Fix issue #299. Add XAudio2 FX Reverb and VolumeMeter that were missing under DirectX11.1 (changes)

Page 1 of 3

RSS Feeds

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 15 2013 00:23:25)

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

Who is Online?

  • Wilhelm
  • Lain
  • t21i5i7o9

Forum Latest

Lain's Avatar
By- Lain
Today 13:45
Implement Filtered Shader Stages in Toolkit? I'm wondering if implementing some sort of more 'clever' type of Shader Stages would be a nice addition to Toolkit. The idea is simple - beside current shader stages like 'PixelShaderStage' implement 'FilteredPixelShaderStage', that would store references...
Wilhelm's Avatar
By- Wilhelm
Today 10:57
[D3D11] EffectDescription missing TechniqueCount (always zero) That fixed it! Thanks for the quick response! Dx11 beginner mistake ;)
dfkeenan's Avatar
By- dfkeenan
Today 02:00
New GeometricPrimitive in the Toolkit Hmmmm, true. Probably worth making the cone separate. I did have code to cater for zero radius so it does not generate end caps. But I didn't really cater for it correctly on the sides. I will have another look at it.
Lain's Avatar
By- Lain
Today 00:53
[Toolkit][DX11] Using materials and effects I started to write some sort of material/effect system for my game, then realized that Toolkit provides some sort of Effect/material framework with properties. So I'm wondering how i could use that. What im trying to do is creating a system, where i can...
xoofx's Avatar
By- xoofx
Yesterday 12:02
[XFile] Load mesh from X file Please prefix your topic with the general API - Direct3D9 and not a sub-part of it. XFile is generated automatically in Direct3D9 but is not supported.
xoofx's Avatar
By- xoofx
Yesterday 23:38
Direct 2D 1.1 Books and Resources? Unfortunately, there is no serious book about Direct2D. Probably the best place to start is from MSDN. There are also lots of samples in Windows 7 SDK and Windows 8 SDK. There is a Pluralsight course on "Direct2D Fundamentals", but don't know much...
xoofx's Avatar
By- xoofx
Yesterday 23:26
SharpDX in Javascript project under WinRT and WindowsPhone 8 You can't expose directly SharpDX classes to WinRT. Only WinRT components are accessible from Javascript, so you need to develop a WinRT component that will encapsulate SharpDX. WinRT components are mainly intended for coarse grained level API unlike...
xoofx's Avatar
By- xoofx
Yesterday 23:22
can't enable debugging Specifically for HLSL, no, but you can get some info from D3DBook (Or the book "Introduction to 3D Game Programming in DirectX11"). There are a couple of differences between ShaderModel 3.0 and 4.0: Understand constant buffers SamplerState and...
Powered By nZambi!