Basics of 2d vector style graphics. (C#, SlimDX)

Started by
2 comments, last by Promit 14 years, 1 month ago
First off let me state that I'm using SlimDX and C# and want to make a 2D renderer that has a look similar to Geometry Wars ie colorful vector graphics. But I'm not actually making a game that's anything like GW, it's just the look of it I like. I want to use this renderer in several projects actually. Anyhow, I'm a novice when it comes to graphics programing and I want to know the best practices for passing lines and points and all that to the graphics card in an efficient manner. I remember from a few years back dealing with openGL that it was better to load every thing into a contiguous memory area and pass the whole thing at one shot. I'm amusing this still hold true? The problem I'm facing is that I have many small shapes that are all updated independently. Each of these objects would store just a handful of points (x and y values and a color value, maybe a "glow" parameter). Passing each individually seems inefficient and copying each into a big array and passing that to the GPU seems expensive. (lots of copies). I had an idea to just have a general pool of points stored in a contiguous array, and have each object store references to the points in that array that belong to it and just update them as needed. Then the renderer goes over that whole array in one shot. Sound good? Or am I over thinking it? If I'm barring up the wrong tree then what would a good render loop look like, and what kind of structure should I use to store or pass my geometry data to the GPU? Also what specific SlimDX calls am I looking for to render everything. [Edited by - Grain on February 18, 2010 3:16:13 PM]
Advertisement
Bump...
In the SlimDX samples there is an asteriod's games that uses vector graphics, it should be a good start to what you are tying to do.

It's located in Samples\Games\Asteriods
Note that the sample isn't in our February SDK, as we're in the midst of retooling them. The old one is in the August SDK.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement