Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Choice for sprite rendering in DirectX 11 using 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
4 replies to this topic

#1 CdrTomalak   Members   -  Reputation: 272

Like
0Likes
Like

Posted 13 August 2012 - 09:38 AM

I'm at a key choice point in my basic game framework program in C# using SlimDX and DirectX11.

Having learnt how to create basic geometry, render this to screen and apply textures, I'm now seeking to move on to sprites.

Basically I want to create a simple 2D game. I have a number of ways to go though.

1. I presume that I absolutely must create sprite objects to make a game right? At the moment I can render simple geometry and apply textures, which appear as sprites on the screen, but of course they are not.

2. I've read that support for sprites in DX11 is poor, mainly from this guy: http://nicoschertler.wordpress.com/ . Has anyone used this? Would this be a good bet to start with?

3. I have considered porting C++ code from http://www.amazon.co.uk/gp/product/1435458958/ref=s9_simh_gw_p14_d0_i3?pf_rd_m=A3P5ROKL5A1OLE&pf_rd_s=center-2&pf_rd_r=02NETAR9NS8Q6E1V2PBA&pf_rd_t=101&pf_rd_p=317828027&pf_rd_i=468294 . However, I'm not sure how efficient this would be since I'm already using Slim DX.

4. I have considered coding sprites from scratch using SlimDX and just having a go. But if someone has already written something to help (see 2), should I use this instead? I am looking to learn as well as actually produce results. I'm probably about 75% learning oriented.

Any choice I make needs to be considered carefully, so I thought I'd put this question out there before starting. I'm currently leaning towards option 2, since it looks like I'd get results quicker. I'm not terribly comfortable with a lot of work being done for me already but in the absence of any DX11 tutorials on sprites other than the C++ example in this book, I'm not sure I've got a lot of choice.

Thanks in advance.

Sponsor:

#2 CdrTomalak   Members   -  Reputation: 272

Like
0Likes
Like

Posted 13 August 2012 - 05:23 PM

Ok so I've done some more research and have noted that there is a serious issue with DX11 and 2D graphics in that Microsoft have not catered for it. There seem to be a few ways to get around this as per http://www.gamedev.net/topic/604514-slimdxd3d11-direct2d-interop/

Had I known this perhaps I couldn't have started using DX11 in the first place.

Apparently DX10 does not suffer from this problem, so I could start using that. Seems a bit of a cop out though.

Tell you what, if I have rendered a quad and applied a texture to it I can just go ahead and make a simple game like Snake quite easily right? If I can draw a single segment of a snake to the screen that's part way there and I'd just have to work on the rest of the game framework such as splitting the screen into a grid in which the snake can move around etc.

#3 Mike.Popoloski   Crossbones+   -  Reputation: 2923

Like
0Likes
Like

Posted 13 August 2012 - 09:53 PM

Drawing sprites using textured quads is a perfectly good solution. D3D11 doesn't include this support natively, but it's relatively simple to add on yourself.

The link you gave refers to Direct2D, a separate library for drawing vector graphics. It's not widely used, precisely because it does not play well with D3D11. I wouldn't worry about it; D2D isn't necessarily well suited for games anyway.
Mike Popoloski | Journal | SlimDX

#4 CdrTomalak   Members   -  Reputation: 272

Like
0Likes
Like

Posted 14 August 2012 - 04:13 AM

Thanks Mike - I'm pressing on with textured quads instead of the sprites DX11 mine-field. The author of SpriteTextRenderer‏, Nico Schertler, said the same thing. I suspect I'll look into using his library for when I'm ready to add text, but for graphics it seems as though I've got what I need.

#5 mhagain   Crossbones+   -  Reputation: 8141

Like
1Likes
Like

Posted 14 August 2012 - 06:01 AM

Sprites in other versions of D3D are nothing more than a wrapper around textured quads, so that approach is perfectly fine.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





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