[SlimDX] Having a lot of trouble getting started with SlimDX
I've gone through the example projects, but they're all tied to the SampleFramework. Is there a way to just start with a single project that isn't tied to anything but the SlimDX reference?
Basically, I just want to draw a sprite on the screen. But I'm having a tough time finding any semblance of a SlimDX tutorial on how to do so. :-( Am I just not looking in the right places?
Any help would really be appreciated. I've done a lot of development in the past, but not with DirectX.
EDIT: I'm using Visual Studio 2008 and while I'd ideally like to do this in VB, C is an option too.
The MiniTri sample represents the absolute slashed back minimum. The tricky bit with VB is they give you a Form right from the beginning and have you start writing in Form_Load rather than the main function. Still, you can run basically the same code in Form_Load and it shouldn't make a difference at all. The Application_Idle event represents the actual render function; instead of rendering a single triangle you can set up a Sprite object instead.
Remember also that you can go off Managed DirectX tutorials and convert them to SlimDX with relatively minimal changes. Unfortunately SlimDX is not very well set up for beginners right now. (We're working on that, but limited resources and all.) Managed DirectX tutorials can get you off the ground, with regards to how to get basic application setup working. After that it's fairly straightforward to port either MDX or native C++ code to SlimDX, after you get a feel for how the basic structure of SlimDX is designed.
Remember also that you can go off Managed DirectX tutorials and convert them to SlimDX with relatively minimal changes. Unfortunately SlimDX is not very well set up for beginners right now. (We're working on that, but limited resources and all.) Managed DirectX tutorials can get you off the ground, with regards to how to get basic application setup working. After that it's fairly straightforward to port either MDX or native C++ code to SlimDX, after you get a feel for how the basic structure of SlimDX is designed.
Thanks. Yes, I have looked at the "MiniTri" example. But it appears tied to and requires something called "SampleFramework". From what it looks like, all samples are tied to this. Is the SampleFramework really needed?
MiniTri, at least for D3D 9, doesn't use the sample framework. If there's a reference to it that's a mistake and it can be removed.
There are two reasons why we have a sample framework. The first is to give an example of how a framework might be written, one that includes window management, device set up and tear down, and properly timing an update loop. Therefore, the samples using the sample framework show it in action.
The second reason is because we were getting complaints about our samples not running on all computers, since we were just hard-coding a set of device parameters instead of checking for ones that are valid. The only two options here were to duplicate a large amount of set up code for each sample that would make each more complex and difficult to follow, or extract that common code out and make it into a framework used by all.
The second reason is because we were getting complaints about our samples not running on all computers, since we were just hard-coding a set of device parameters instead of checking for ones that are valid. The only two options here were to duplicate a large amount of set up code for each sample that would make each more complex and difficult to follow, or extract that common code out and make it into a framework used by all.
Also the SlimDX architecture is basically the same as the C++ interface. Thus alot of the C++ tutorials on how to do things can be easily translated to slimDX.
Thanks guys. I made the MiniTri example its own project and am trying to work off that. How do I create a single sprite, or better yet, a batch of sprites on the screen?
I discovered this:
http://ilovevb.net/Web/blogs/nimble2d/archive/2008/02/12/doing-2d-in-slimdx.aspx
The "Sprite(Device)" constructor is in the official reference, but doesn't appear to work in the MiniTri example using the following line of code:
varSB = new Sprite(Device);
Am I doing something wrong? :-(
I discovered this:
http://ilovevb.net/Web/blogs/nimble2d/archive/2008/02/12/doing-2d-in-slimdx.aspx
The "Sprite(Device)" constructor is in the official reference, but doesn't appear to work in the MiniTri example using the following line of code:
varSB = new Sprite(Device);
Am I doing something wrong? :-(
Quote:Original post by Promit
Define "doesn't appear to work".
"The name 'varSB' does not exist in the current context"
Sorry. Really appreciate the help.
Sprite varSB = new Sprite(Device);
And I strongly, strongly suggest you work on getting programming basics down before tackling graphics.
And I strongly, strongly suggest you work on getting programming basics down before tackling graphics.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement