DirectX programming on Windows, what is the preferred way? - silverlight

I need to develop a part of a business application in a flashy eye candy way. Therefore wanted to see if I can use DirectX. Here's what I got.
First I read how using C/C++ is like shooting yourself on the foot and I should use DirectX.NET instead. I couldn't disagree. It's the 21st century.
Downloaded DirectX SDK but couldn't find the .NET assemblies in there. Searching the net now revealed that DirectX .NET (called MDX) is now obsolete (released in 2006). And that I should use XNA instead which was mainly developed for XBOX.
Downloaded XNA. But it won’t install because I don't have C#.NET Express 2005 SP1. Installed SP1 on my VS Pro 2005. But it won’t install still. It needs Express 2005 and exactly that single one version, not Pro, clearly not 2008.
Frustrated tried to download C#.NET Express which is free. But the link from MS which says C#.2005 actually downloads C#.2008, because C#.2005 is now obsolete.
And now I read that MS is now putting it's force behind WPF/silverlight. And XNA doesn't support DX10 and Vista doesn't come with DX9.
Now I have two choices:
Go 15 years back and code in plain old C/C++. At least C has proven itself to be timeless.
Try silverlight.
What would be your advice? Or am I missing something?
Udpate: Would like to add that DX10 is not backward compatible with any other DX version. SlimeDX looks really promissing. But as a very new package, I am not sure how much helpful the documentation and tutorials will be.
Udpate 2: It seems that the first download link that google brings up when searching for XNA download, which I used, is not the latest one. Thanks DouglasH for providing the link to v.3. Downloaing it. Probably it will work.
But then agian. Should I switch to WPF/Silverlight? Or go with XNA? Which one is better documented and future-profe?
More update: Vista realy doesn't come with DirectX 9 preinstalled [check by googling]. At least it didn't on my machine bnough last year. Googling for it revealed that I have to manually install DirectX 9 on Vista after downloading it from MS. But my attemet failed beucase hardware drivers for DX9/vista were missing or didn't work. I got the idea that it's not supported that well.

MS has stopped supporting the .net DirectX libraries. There is an open source alternative called SlimDX, and it works well. The documentation leaves some to be desired, but it can be puzzled together by using the DirectX C++ documentation and some common sense.

WPF does pretty good 3D stuff, and there are lot of fish eye panels and source code available for WPF, yes since MS has gone ways from their technology, in today's terms, we can not focus on only one technology by MS to make entire one business application.
Sure we are also tired of using multiple different versions of technologies even to do smallest parts, but I believe they are doing great job by serving billion machines, it sure isnt easy but WPF and .NET seem to be most stable technologies by microsoft and also they are spending good money on making completely managed operating system as well.

If you ever go back to C or C++, you might want to check out Simple DirectMedia Layer (SDL).
IMHO, it is much easier than DirectX.
URL: http://www.libsdl.org/

DirectX is fully backwards-compatible. Any DX9 application will run on Vista and DX10. As for XNA and VS2005 - that's a bit weird. That would make XNA effectively useless. Check if you haven't missed something.

couple of points, which version of XNA did you download. Here is the link for XNA Studio 3.0 which will run on Visual Studio 2008. http://www.microsoft.com/downloads/details.aspx?FamilyId=7D70D6ED-1EDD-4852-9883-9A33C0AD8FEE&displaylang=en
2nd, I sure hope that Vista has Direct X 9, since that is the version of direct X that the DWM runs on in Vista. I think you will find the DLLs for Direct X 9 and before and the DLL,s for DirectX 10 loaded in Vista. Or for that Matter Windows 7 which will also have directX 11 (edit 2 note that the DWM is built on DirectX10, with a software emulator for systems that don't have 3d video hardware, a dx10ondx9 drivers for those with directx 9 cards and of course full support for directx 10 cards).
edit,
Additionally if you downloaded the March directx sdk, you download, directx 9.0c, directx 10, 10.1 and the beta of directX 11. and I would have to check if DirectX 8.x is still included or not although DirectX 9 is backwards compatible with most of that platform.

Though I never worked directly with DirectX (little bit with OpenGL) - I would take WPF. The least-painful to implement (transparency, gradients, brushes, animations, etc.) and it provides solid-performance from what I have seen and experienced myself.
But yes, it's not platform-independent.

Related

silverlight for wince6.0

hello
i want to build silverlight application for wince6.0. im not getting whether we have to use vs2008 r expression blend can you tel me which one is suitable to build for wince6.0
Silverlight "sort of" exists for Windows CE (see here: http://msdn.microsoft.com/en-us/library/ee502198.aspx ) but it's a version programmed via C++ that is, in many substantial ways, different from the Silverlight on a desktop PC, Mac, or Windows Phone 7.
I do not believe there is Blend support for this version of Silverlight, and the Visual Studio support is pretty limited. In fact, the whole framework is rather limited, as it's based on Silverlight 2, which is starting to feel pretty old at this point.
That said, hopefully the above link helps point you to samples and other documentation that can help.
Sorry, Silverlight doesn't support Windows CE 6.0. You can use the .NET Compact Framework instead, but it doesn't get you XAML or the other cool things that you might have been hoping for from Silverlight.

Real Silverlight Support on Windows Embedded Compact 7?

So Windows Embedded Compact 7 (another classic from the naming department) supports Silverlight for Windows Embedded.
http://www.microsoft.com/windowsembedded/en-us/products/windowsce/compact7.mspx
But this is a C++ only stripped down version of Silverlight 2 XAML.
Does anybody know if Windows Embedded Compact 7 will support real Silverlight? This seems to be out of step with Windows Phone (which I think is based on Windows CE 6) and the fact that Windows Embedded Compact 7 supports Flash 10.1.
Not in the first release, no, it will not support managed Silverlight (or, IMO, what the entire world considers to be "Silverlight").
They may, at some point, move the work done by the Phone team to create a managed SL implementation, but they've made no announcements as to if or when that might ever occur.
You'll see "Developers,Developers" Balmer come out later like he has done before and admit they made a mistake with this. Its the developers that produce the apps and if you make all the microsoft technologies linq, wpf, ria and patterns such as MVVM unuasable developers won't trust you and move to another platform. They dropped the ball on the Phone OS by not having a great consumer oriented phone. Now they will focus on consumers stick it to the business developers that they had built up on Windows Mobile. They did a great job with the silverlight 4 so I don't understand how they can drop the ball this badly on Compact 7.
I agree about the non-uniform development environment, but you should also consider that the processor that are currently powering WP7 devices are not still available on the general embedded market where 1GHz processors are a small minority and 5-600MHz processors are used only for hi-end devices.
Trying to run both the XAML and the .NET runtime could lead to weak performances and disappointing results.
If you need RAD, use the Compact Framework.
If you need cool UI, use Silverlight for Windows Embedded.
You can't have both right now, as you can on the phone...

Switching to WPF. Is it time?

I'm considering switching from MFC to WPF.
My first concern is that there are too many users who don't have .NET with WPF installed yet. Can anybody point to a source containing the WPF penetration numbers?
My second concern is speed.
Any other considerations?
I've been banging away at WPF for a while now. It is brilliant, but it still has (occasional) holes you've to plug yourself. However all indications are .NET 4.0 will be a significant step forward.
I would say start now. The WPF learning curve is REALLY steep, and it'll be a while before you'll be releasing software to users, believe me. Also do yourself a favour and get the WPF Unleashed book. It's superior.
Speed isn't a consideration. The power WPF gives is well worth any drawbacks with speed, which - coming from Windows Forms - I haven't noticed to be honest.
What kind of application are you developing? If it's a wide-distribution desktop app that you want your grandmother to install, your concern about .NET 3.0/3.5 adoption is valid. So far from what I've seen, performance is less of a concern.
WPF penetration
First of all, Windows Vista and Windows 7 both have WPF preinstalled, which accounts for 35% of the market automatically. Windows XP has had it as it had .NET Framework 3.0 as an option in Windows Update for over three years, and many applications ship with it, so it is likely to also be installed on a high percentage of Windows XP machines. StatOwl indicates that about 80% of NET Framework installations are version 3 or above.
If you're shipping on CD it is no big deal to include the latest .NET Framework on the CD and have it install automatically. If users are downloading your application, it can contact Microsoft's web server to download and install the latest .NET Framework. Online ClickOnce deployment also has this capability if you want people to be able to start their application directly from the web browser without installing it.
So the bottom line is, you probably don't need to worry about whether people will have WPF installed on their machines or not unless your target market consists primarily of dial up customers on Windows XP who don't run much third-party software (i.e., they just run Windows and your application).
Speed
Not an issue. I have a 200 MHz Pentium Pro with 384 MB RAM from 1998 that I test my software on, and my WPF applications have comparable performance with equivalent MFC applications. If your WPF application uses lots of fancy graphics and animation it will run slowly on ancient CPUs and graphics cards, but so would an ordinary MFC application with the same features.
Don't even bother trying to use WPF if you are sticking with Visual Studio 2008 for the next year or two. The experience will be way too painful. I'm talking about "my IDE crashed again" type of pain.
If you are going to use VS 2010 in the near future, then WPF is a blast. Download the beta, a couple of themes off CodePlex, are start playing. Once you get past the (freaking huge) learning curve I think you will find it to be quite enjoyable.
IMHO, you should wait for Visual Studio 2010 and WPF 4.0 to make the actual migration. They will close some very annoying gaps in the product.
Meanwhile, you can try it out. In terms of coding/readability -- it's going to be WAAAY better than with MFC =)
As for the performance and platform -- it shouldn't be a problem unless you have any very special circumstances (like if you can't require users to install .NET).
Also see this related question on switching to WPF from Windows Forms.
If you are thinking about a larger, modular, appliation I recommend checking out Prism. It's a bit of a beast itself, but you should be able to tackle it after coming to grips with C#, Dependency Properties and XAML. Plus, learning Prism gave me a much better understanding of WPF/Silverlight, at least from the development/binding side.
Mike Taulty posted an excellent 10 part video series on Prism. It's a great way to get your head around the platform.
I'd also recommend the pages linked to from the Getting Started page on codeplex. After all that, you're probably ready to tackle the Reference Implementation which comes with the download.
A previous answer of mine might also help clear up any remaining confusion around Controllers/Presenters in the framework that you might have (I did).

Why the lack of innovation and Silverlight on Windows CE?

A manager asked me to do some quick research on the possibility of doing Silverlight development on Windows CE devices.
After 15 minutes I was surprised that:
Silverlight for Windows CE seems to be nowhere in sight, with some sites wanting to report it so bad they they are quoting twitter tweets as their source of news, the word "mobile" is even missing on Silverlight 3 Feature Lists but you find it in the comments with people saying things like I was hoping to hear an update on getting Silverlight onto Windows Mobile and Nokia devices.
Windows CE 6.5, which is not even out yet, is getting scathing reviews such as this article which basically says: nothing new, interface improvements behind the curve, UI tweaks (honeycomb) skin deep, no capacitive touch screens, not due till Q4 2009, not backwards compatible, no zune, no new windows media player, no decent screen keyboard, browser pales against competition and, number 10: by showing little innovation on their latest mobile OS, Microsoft is showing zero leadership in the mobile space. It seems that Microsoft is weakly limping along in the shadow of the iPhone. The apparent lack of Silverlight on Windows CE 6.5 didn't even make the list of woes.
I thought things were different. So I sadly have to report that Silverlight on mobile devices may have to wait a year or more.
Does anyone have any more positive, substantial news that I can report about Silverlight on mobile devices?
Update by YMS (not the original OP):
This question is somehow deprecated now that Windows Compact 7 has been released with (some kind of) Silverlight support.
I also very recently researched the use of Silverlight on Windows CE. The result is that while it seems to be almost there, with videos showcasing it from MIX08, it may be released some time this year, but likely not in the first half. They said "some time 2009", and for some months now, it was in "private testing".
Because of that, while I'd love to use Silverlight, I decided to go with OpenGL ES 2.0 and OpenVG, which is fully hardware-accelerated on our current target device. Plenty of power and not that hard to use, even from .NET Compact Framework.
Oh, and the iPhone is all that cool for a phone (or a music player), but Windows CE is available for many more devices, including non-personal-gadget / non-mobile products. That's an area where Apple does not shine because they don't license their platform.
I've heard rumors that the UI for WindowsMobile 7.0 will be Silverlight/WPF based. It doesn't sound like Microsoft is putting any effort into any version before that, because as soon as WM7 is out, they'll want to kill anything off that came before.

Silverlight - where do you start (for free)?

First I've read loads of posts and sites that recommend going to http://silverlight.net/GetStarted/ to get started but I do not have visual studio and I'm not going to purchase it just to 'maybe' learn some silverlight that I'm not going to be able to use for a little while.
The reason being that I've already installed visual studio and all the other things required during a quiet period of work, then another project came up and by the time I got back to thinking about silverlight the trial period has finished.
I have not done C# or XAML (mainly Java, AS3 & MXML, hence the lack of MS tools) but I'd like to look into silverlight when I'm quiet to create some test projects and to determine where I can use it if anywhere. Is there a toolset that will let me learn and use all that is required without purchasing the software (perhaps it would have a watermark like the flex datacharts used to have, unless you purchased them, maybe an eclipse plugin - although I imagine I'm being a bit optimistic here).
If there isn't such a thing then perhaps MS should look into this, Adobe recently let anyone unemployed/students etc to get flexbuilder for free to increase its uptake. That would be great is MS did something similar.
If you are a student, you can get professional Microsoft tools for free through the Dreamspark program. http://www.dreamspark.com
You can download Blend preview 3 and visual studio 2010 for free and use it. You have the tools and knowledge now ;-)
Check out Bizspark too.
Allegedly, you can now use one of Microsoft's free "Express" development systems to develop Silverlight apps.
http://www.bluerosegames.com/SilverlightBrassTacks/post/You-can-now-write-Silverlight-apps-in-Visual-Web-Developer-Express.aspx
In addition to the free-as-in-free-beer options from MS that other answers mention: if you only want to play around with Silverlight for now, consider trying Moonlight -- it may not yet be ready for production work, but nevertheless usable for learning purposes.
One place you can go is to the express web site on Microsoft.com. You can get free, albeit trimmed back, versions of the current release of Visual Studio and SQL Server there.
You can also get a trial version of Expression Blend 2. Blend is a design oriented tool for creating Silverlight applications.
You can also usually find betas of upcoming releases without much trouble.
Silverlight + Eclipse:
http://www.eclipse4sl.org/download/
And how to workaround Express for SL
http://www.informikon.com/blog/howto-silverlight-and-visual-studio-express.html
Good luck
Braulio

Resources