Reputation
19,257
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
5 41 93
Newest
 Informed
Impact
~620k people reached

Dec
9
comment Making game totally from scratch
Re: "it's impossible" -- someone had to write those libraries. So obviously it's not impossible.
Dec
8
comment What are the cons of using DrawableGameComponent for every instance of a game object?
I have deigned to post another answer that will hopefully fully illustrate my point. I am keeping the old one as-is for historical reasons. I am a little miffed about having been nerd-sniped. Hopefully this is the last time I have to touch this pernicious subject.
Dec
8
comment What are the cons of using DrawableGameComponent for every instance of a game object?
If anyone is interested in questioning the legitimacy of my answer on the basis of upvotes: while it is true that (GDSE being aflush with aforementioned novices) VeraShackle's answer has managed to acquire a couple more upvotes than mine in recent years, don't forget that I have thousands more upvotes network-wide, largely on XNA. I have implemented the XNA API on multiple platforms. And I am a professional game developer using XNA. The pedigree of my answer is impeccable.
Dec
8
comment What are the cons of using DrawableGameComponent for every instance of a game object?
DrawableGameComponent is part of the core XNA API (again: mostly for historical reasons). Novice programmers use it because it is "there" and it "works" and they don't know any better. They see my answer telling them they are "wrong" and -- due to the nature of human psychology -- reject that and pick the other "side". Which happens to be VeraShackle's argumentative non-answer; which happened to pick up momentum because I didn't call it out immediately (see those comments). I feel that my eventual rebuttal there remains sufficient.
Dec
8
comment What are the cons of using DrawableGameComponent for every instance of a game object?
I can condense my answer here as follows: "Using DrawableGameComponent locks you into a single set of method signatures and a specific retained data model. These are typically the wrong choice initially, and the lock-in significantly hinders the evolution of the code the future." But let me tell you what is happening here...
Apr
8
comment Handle a canvas in a windows form application
@Riptide This answer is for a "Windows Forms Application".
Feb
5
comment How to correctly enable anti aliasing in XNA?
Also note that the default for MultiSampleAntiAlias is true, and it is true for the default RasterizerState for SpriteBatch.Begin. So in most circumstances you should not need to worry about it.
Feb
5
comment How to correctly enable anti aliasing in XNA?
See this answer about when to use ApplyChanges.
Jan
23
comment Drawing image with an angle
@Shiro DynamicVertexBuffer and VertexBuffer should behave the same, with one exception: DynamicVertexBuffer requires that you recreate the buffer on its ContentLost event (or when IsContentLost is true, or simply recreate it every frame before use). DynamicVertexBuffer performs better if you are changing its contents regularly. (SpriteBatch, for example, is built on top of a DynamicVertexBuffer.)
Jan
22
comment Drawing image with an angle
@Shiro Nothing great. Maybe try examining the code for roundline.codeplex.com - I think that uses it.
Jan
20
comment Drawing image with an angle
@Shiro Yes. For a particle system calling Begin for each particle is going to be horrible for performance. In your particular case you probably want to use a DynamicVertexBuffer to construct exactly the data you want (a full explanation is beyond the scope of a commment).
Jan
11
comment XNA texture garbage collection
It's worth pointing out that ContentManager is already basically a dictionary of strings to textures (and other resources).
Jan
6
comment XNA/Monogame inverting a BoundingBox
@SethBattin The subtlety is that the possible results of an intersection test are ternary (disjoint/intersects/contains), not binary. So applying a binary not operation might not give the desired result.
Jan
1
comment MonoGame SetRenderTarget is wiping the backbuffer
@James No worries. Regarding your second comment there: You have to set PreserveContents on the backbuffer to avoid the clear of the backbuffer during SetRenderTarget(null). The code you have there only avoids the clear of the render target when you call SetRenderTarget(renderTarget).
Oct
20
comment How to move vertices of matrix in order to cast a 2d shadow?
You should probably post a picture that shows what you are trying to achieve. "Affine" is a category of transformations (including things like rotation, translation), whereas "skew" is a specific type of affine transformation. See this answer for a discussion of how to create a skew matrix.
Oct
19
comment Why does GameComponent have an Initialize() method?
I'm not sure I fully understand the question. When GraphicsDeviceManager(this) runs, where this is a reference to Game, it inserts itself into the given Game.Services as both IGraphicsDeviceService and IGraphicsDeviceManager. This is how Game.Run is able to find the GDM to set up the GraphicsDevice. If you were so inclined, you could provide your own implementations of those two interfaces, and Game would work as expected. You could even skip Game all together and initialize GraphicsDevice yourself.
Oct
15
comment Incrase framerate in XNA
@Subsequent See this answer for how GraphicsDeviceManager works: stackoverflow.com/a/11287316/165500 (it's about resolution, but it applies to all settings, including vsync).
Oct
13
comment Emit light from items
Maybe a post a mock-up screenshot that shows what kind of effect you want to achieve?
Oct
6
comment Is it bad practice to add GameComponents and DrawableGameComponents outside of the main initialization method?
There is - what I would describe as - a bug in XNA, where the initialization mode switch-over does not happen until after Initialize returns. See my edit.
Sep
22
comment Processing periodical operations on the database
Here's a really old question that asks almost the same thing.