WynterStorm - Batched Primitives

Published May 31, 2011
Advertisement
Tonight I spent way too much time making sure batches were properly managed in WynterStorm. When I say 'properly managed' here, I mean simply that the engine should batch all quads using the same texture and render that as a single VBO, makes sense right? When I say 'properly managed' I also am using the term very cautiously. I do not think the code is proper at all right now; I actually find the code to be quite the opposite. I spent so much time trying to get batched primitives working that the code has become a horrible mess. Thankfully the messy code is only in two files. The reason for this? I got ambitious. I set a goal for tonight and the goal was higher than I should have set it without planning ahead. My goal was to be rendering multiple batched primitives onto the screen using VBOs. Before tonight I didn't have any code in place for actually rendering data to the screen so this was quite a leap considering I wasn't sure how I'd prepare this. Now though I need to restructure the code to make it proper once again. As it stands though, the code seems to do it's job well enough. May be a bit slow from my lack of experience using VBOs, but it's a good start I think. In order to render onto the screen, you first create a simple quad using the Shade::Quad structure. Triangles will come next, but I was mainly aiming for getting quads up quick. I also have no interest in rendering lines or points in batches, as the batches are linked to texture ids. Trying to rewrite the code to support points and lines using the [0] texture (which will render with no texture attached) would be too complicated for a feature I don't see myself using very much. WynterStorm will also allow developers to render their own VBO's without using the batch code, it just requires a little extra work on their part.

I've attached a screenshot to show the code in action. Tomorrow I will try and make some time for WynterStorm after work and clean up the mess I made, then maybe I can post some code to show how easy it will be to render textured primitives.

Thanks for reading my horribly jumbled, written at 2:00AM post.
-Wynter Woods
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement