I'm working on a simple game that has the user control a space ship that shoots small circular projectiles. However, I'm not sure how to render these. Right now I know how to make a LPDIREC3DSURFACE
for a sprite and render it onto a LPDIRECT3DDEVICE9
, but that's only for a single sprite. I assume I don't need to constantly create new surfaces and devices.
How should projectile generation/rendering be handled?
Thanks in advance.
| |||||
feedback
|
closed as not a real question by mh01, Byte56, Josh Petrie, Laurent Couvidou, Gajoo Dec 9 at 6:59
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
You seem to be beginning with game development. For beginners I would always suggest starting with a game engine. Once you have few simple games under your belt, you will have much better idea about how 'expensive' certain operations are etc. and you can give a go at your own engine if you wish. There are many way of rendering objects. But your question is flawed. You should be asking how do I render things with acceptable speed. Once you get to several hundred objects, unless you have properly setup your rendering pipeline, you will quickly hit performance bottleneck. The idea behind performance is to queue as many operations as possible and then hand them over to the GPU for rendering. So for practice, it does not matter what you render, chose your projectiles for example, but then setup a test where you render 5000 of them, and make sure you can get a good framerate (60fps minimum). Unless you can hit this milestone, there is no point coding other stuff. Once this works, then instead of rendering 5000 identical images, use the same principle but render what you want. Once again, you see how this is getting complicated quickly. I suggest you use a game engine like Orge, Allegro etc. | |||
feedback
|