I've just rebuilt my old DirectDraw based game and I'm very happy with the results!
It was one of my first C++ programs in a diectx world.
But I was disappointed to discover that DirectDraw is deprecated.
After installing DirectX SDK July 2010 there is no ddraw.h and ddraw.lib.
My question:
how to port my DirectDraw based 2D game to the recent DircetX SDK?
Is there any DirectDraw replacement?
What about OpenGL?
Any idea would be appreciated!
Take a look at Direct2D. A tutorial can be found here, for instance.
Related
If I want to do scaling and compositing of 2D anti-aliased vector and bitmap images in real-time on Windows XP and later versions of Windows, making the best use of hardware acceleration available, should I be using GDI+ or DirectX 9.0c? (Actually, Windows XP and Windows 7 are important but we're not concerned about performance on Vista.)
Is there any merit in using SDL, given that the application is not cross-platform (and never will be)? I wonder if SDL might make it easier to switch to whichever underlying drawing API gives better performance…
Where can I find the documentation for doing scaling and compositing of 2D images in DirectX 9.0c? (I found the documentation for DirectDraw but read that it is deprecated after DirectX 7. But Direct2D is not available until DirectX 10.)
Can I reasonably expect scaling and compositing to be hardware accelerated on Windows XP on a mid- to low-spec PC (i.e. integrated graphics)? If not then does it even matter whether I use GDI+ or DirectX 9.0c?
Do not use GDI+. It does everything in software, and it has a rendering model that is not good for performance in software. You'd be better off with just about anything else.
Direct3D or OpenGL (which you can access via SDL if you want a more complete API that is cross-platform) will give you the best performance on hardware that supports it. Direct2D is in the same boat but is not available on Windows XP. My understanding is that, at least in the case of Intel's integrated GPU's, the hardware is able to do simple operations like transforming and composing, and that most of the problems with these GPU's are with games that have high demands for features and performance, and are optimized for ATI/Nvidia cards. If you somehow find a machine where Direct3D is not supported by the video card and is falling back to software, then you might have a problem.
I believe SDL uses DirectDraw on Windows for its non-OpenGL drawing. Somehow I got the impression that DirectDraw does all its operations in software in modern releases of Windows (and given what DirectDraw is used for it never really mattered since the win9x era), but I'm not able to verify that.
The ideal would be a cross-platform vector graphics library that can make use of Direct3D or OpenGL for rendering, but AFAICT no such thing is available. The Cairo graphics library lacks acceleration on Windows, and Mozilla has started a project called Azure that apparently has that but doesn't appear to be designed for use outside of their projects.
I just found this: 2D Rendering in DirectX 8.
It appears that since Microsoft removed DirectDraw after DirectX 7 they expected all 2D drawing to be done using the 3D API. This would explain why I totally failed to find the documentation I was looking for.
The article looks promising so far.
Here's another: 2D Programming in a 3D World
I want to know if we can develop C#, WPF application using DirectX 11. I have an application (medium size) which is written using DirectX. We need to use features from Directx 11 like parallel rendering. Is it possible to develop applications using DirectX 11? If yes can anyone provide me some sample application for that? We can't go for other options like SlimDX as we can't afford to rewrite whole code.
Please suggest what is the best option for me?
I haven't tried using C# with DirectX myself, but from what I've read, your main options for DirectX and C# are either SlimDX (which you count out) or XNA, which many users seem to find lacking in features, especially from the newer versions of DirectX.
So I am planning to start learning DirectX by grabbing Frank Luna's book "Introduction to 3D Game Programming with DirectX 10". But since I have a GeForce Go 7 graphics card, I am wondering will I be able to at least test the code from the book? Or should I take his older book about DirectX 9, which my GPU supports? But speaking about that, it would be a little pity to learn outdated stuff since I read that DX10 has introduced quite a lot of new concept, so I am totally confused at the moment.
On the other hand, perhaps with the hardware I have I would be more happier learning older version of OpenGL?
If you don't have the money to get updated hardware, get the book to match the hardware you have.
Most of what you will need to learn transfers from one to version to the other - if you get proficient with one version, you can move to another and keep most of your knowledge - because most of what you need for graphics programming isn't the API.
You just need to get started and get some code running as quick as possible!
If you have Windows 7 you could use WARP until you can get a hold of better hardware, but it will be much slower than using an actual DirectX 10 graphics card.
GPGPU is the principle of using the parallel processors on video cards for massive increases in performance.
Does anyone have any ideas about using GPGPU in Delphi, using either OpenCL or CUDA? CUDA was/is NVidia only, but they have also adopted the OpenCL "standard".
I found a few Delphi samples from Google searches but they either crash or don't compile/run.
The ultimate instruction sample would be:
Download and install the OpenCL DLLs from here.
Download the OpenCL SDK from from here.
Download this sample Delphi project from here.
Open and compile the Delphi project. If all goes to plan it will do "whatever it is supposed to do"
At that stage I can then start researching the OpenCL SDK and writing/compiling DLLs to call from any Delphi app.
This sort of stuff is really starting to take off. Embarcadero do not have to do anything themselves at this stage (unless they want to), but if there were a tutorial and samples for Delphi available it would be great. Many samples are available for other languages, but we do also need a good and simple Delphi example to show how easy it is to use Delphi for GPGPU apps.
CUDA is still nVidia only, and that won't change. OpenCL is a true standard in this case, not only limited to GPGPU.
As for using it in Delphi, all I know of is how to use it in Free Pascal. However, there's quite some chance that the code will be portable, here's a link to updated headers:
FreePascal Mantis RFE OpenCL
As for DLL's, if you use nVidia, they can be found here.
Here however we have a sample project in Delphi.
You could be interested in GPGPUonDelphi2007.
GPGPU example plus needed OpenGL and CG libraries for Delphi 2007 now available!
I created the necessary OpenGL and CG (delphi) packages yesterday and finished converting/translating/porting a C GPGPU OpenGL/CG example to Delphi today, and I would like to share it with you so that maybe some more (Delphi) people will look into GPGPU programming, especially with OpenGL 3.0 for (older) DX9 graphics cards.
You should use CUDA DELPHI
In native pascal code you can run CUDA kernels
I made a floating point test, using OpenCL and Delphi, some time ago:
https://plus.google.com/110131086673878874356/posts/eWcipK16MV7
(contains link to demo and sources)
My zune just updated to 3.0 (didn't even realize they were releasing something new!) and the update came with two games, but the Zune marketplace does not have games.
Where do I go to get started, and what are the capabilities of the Zune in terms of games/apps?
Well, first, you must download the Microsoft XNA 3.0 CTP. Read the documentation, which will explain the capabilities. But, from memory:
No hardware accelerated 3d (obviously, you can create a software 3d engine and then render the result to a 2d sprite, but... Don't expect much in terms of performance ;))
No XACT, you must use a new sound API
Just an update but note that XNA 3.0 has been released. It requires some flavor of Visual Studio 2008.
I downloaded it and coded & deployed "hello world" to my Zune in no time at all. Very easy.
You should check out the blog of Rob Miles. He has a few chapters of his book on his site. Great place to start.
I was hoping someone here would have better resources, but as this seems to be a new area of development, here's one resource that appears to give all the steps for a newbie to get started (too many assume you already have Visual studio, etc).
I'm really interested in a better in-depth overview of the capabilities as well, though.
-Adam