Jump to content

  • Log In with Google      Sign In   
  • Create Account


Drawing A Rectangle In SlimDX


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 CoOlDud3   Members   -  Reputation: 151

Like
0Likes
Like

Posted 04 May 2013 - 09:54 AM

Hi, After tutorial 3 of SlimDX main website I am confused on index buffers. Can anyone write me some c#/Slimdx code on how to draw a rectangle using vertex and index buffers in slimdx so that I could practice on it further more. I'd be greatful for your kind help

 

Regards,

Rayyan Tahir



Sponsor:

#2 unbird   Crossbones+   -  Reputation: 4969

Like
1Likes
Like

Posted 04 May 2013 - 10:28 AM

Not many samples for SlimDX in particular but for the similar SharpDX 'PavelB' took the time to transliterate the RasterTek Tutorial from C++ (which in turn is quite nice). Recently someone provided additional code samples here (don't let the Italian website scare you off).
 
Also, SharpDX comes with Toolkit,  XNA like framework, and - since you asked earlier - is currently integrating the Assimp library, too.
 
Now, since you haven't mentioned which API you're using, the above is all for D3D11. For D3D9 samples you will have to resort reading and converting C++.

#3 CoOlDud3   Members   -  Reputation: 151

Like
0Likes
Like

Posted 04 May 2013 - 10:41 AM

Which of the two (SlimDX, SharpDX) is the best option for now? Because I think I'm stuck due to lack of tutorials on SlimDX.



#4 unbird   Crossbones+   -  Reputation: 4969

Like
1Likes
Like

Posted 04 May 2013 - 10:50 AM

That's a question of personal preference. But if you're just starting out, go with SharpDX: The development is ongoing, it has lot's of useful stuff beyond DX, there's a dedicated forum, and I for one like it that it's (more or less) C# source, not C++.



#5 CoOlDud3   Members   -  Reputation: 151

Like
0Likes
Like

Posted 04 May 2013 - 10:56 AM

Thank you I'll look into it :)



#6 Dan Mayor   Crossbones+   -  Reputation: 1712

Like
0Likes
Like

Posted 04 May 2013 - 11:53 AM

I have to agree that SharpDX is the better choice.  Namely because SlimDX is a C# wrapper library that links to the C++ built DirectX libraries and SharpDX is actually a rebuild of the DirectX libraries in Managed C# code (See the SharpDX website for better explanation).  Both the SlimDX and SharpDX projects are lead by the same developer, and as such SharpDX gets all of the attention now while SlimDX I believe has been all but completely abandoned.  Also from my understanding SlimDX is for Direct X 9 or 10 only and does not support Direct X 11 (I could be wrong on that one).  AFAIK Tutorials for both are still lacking and or non existent, however they should be growing in popularity and hopefully we should be seeing better resources coming along soon enough.  The good part of SharpDX is that is done come with quite a range of demo apps and source code that you can reverse engineer.  Taking what they show you and cross referencing against Direct X C++ information can get you to the answers you are looking for in most cases.  If you take this approach do be sure that you have a firm grasp on programming basics, theory and the core differences between C++ and C#.


Digivance Game Studios Founder:

Dan Mayor - Dan@Digivance.com
 www.Digivance.com


#7 unbird   Crossbones+   -  Reputation: 4969

Like
0Likes
Like

Posted 04 May 2013 - 12:08 PM

PS: As for your particular problem: Working from the triangle sample, I'd consider this an exercise wink.png. A (filled) rectangle is just two triangles. A rectangle outline could be achieved with triangles, too, but also look into the PrimitiveTopology.LineList or LineStrip. Just play around with the stuff.



#8 Starnick   Members   -  Reputation: 1166

Like
0Likes
Like

Posted 04 May 2013 - 04:10 PM

I have to agree that SharpDX is the better choice.  Namely because SlimDX is a C# wrapper library that links to the C++ built DirectX libraries and SharpDX is actually a rebuild of the DirectX libraries in Managed C# code (See the SharpDX website for better explanation).  Both the SlimDX and SharpDX projects are lead by the same developer, and as such SharpDX gets all of the attention now while SlimDX I believe has been all but completely abandoned.  Also from my understanding SlimDX is for Direct X 9 or 10 only and does not support Direct X 11 (I could be wrong on that one).  AFAIK Tutorials for both are still lacking and or non existent, however they should be growing in popularity and hopefully we should be seeing better resources coming along soon enough.  The good part of SharpDX is that is done come with quite a range of demo apps and source code that you can reverse engineer.  Taking what they show you and cross referencing against Direct X C++ information can get you to the answers you are looking for in most cases.  If you take this approach do be sure that you have a firm grasp on programming basics, theory and the core differences between C++ and C#.

 

Hmm, no different guys, although the SharpDX guy did pitch some of the ideas behind SharpDX to the SlimDX devs. Also, SlimDX supported D3D11 fully, It's the "Windows Store"/Win8 (and D3D 11.1) they didn't have any interest in supporting.

 

To the OP, like Dan said, the D3D API exposed in SharpDX is practically 1 to 1, so if you haven't MSDN is usually a good go-by for Direct3D documentation and programming references :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS