http://pastebin.com/6C2RTMb2 -draw.h
http://pastebin.com/6ysGygxp -draw.cpp (using texture rectangles)
http://pastebin.com/R7Daf8n5 -draw.cpp (replacement functions for using texture_2d instead of texture rectangles)
So, first of all I'll just say that it's all fully working 2d sprite rendering code... That is to say fully working for me, my friend claims that no matter what I change my draws just render as white rectangles, despite the fact that it's fully working on my own machine (nvidia 8800gt) and an old crappy laptop I own which only has intel integrated graphics. I just wanted to know if it should be working properly and it's just a driver error/problem on his half. Also other than that I would like general advice on how I could improve and also what I can do to make it as compatible as possible.
Secondly when doing smooth rotation using linear interpolation on the min and mag filters I get magenta fuzz around the sprite (magenta is set to 0 opacity on image load) and image zoom is linear as well. Nearest Neighbour zoom is good but the rotation is horrible. Is it possible to get smooth rotation without the magenta fuzz and to scale up using NN? I guess ideally what I want is AA for the edge of the sprite whilst using NN body rotation and zoom, which I hadn't thought of until I just came to write it down. Is that easily achievable?
some notes(/brain farts - ignorable):
Texture rectangles seem a lot easier to set up but support should be a lot less, especially for older hardware. The last thing I was going to try with Texture_2D is matching/square power of 2 w&h (32*32, 64*64 etc.), the last thing I did there was to make it power of 2 w&h but nearest increment for w&h separately (so it could be 32*64, 64*128 etc.) which I thought should be extremely compatible?
Here's my self written image loader if you wanted to view it: http://pastebin.com/ejkj2hvm at the moment it only loads and saves 24bit BMPs, honestly I don't need any more functionality than that and it was fun to learn. If I wanted to load more types I won't be trying that myself, BMPS are far enough in terms of enjoyment/difficulty to implement.
And just for my interest would porting this code to OGL ES be straightforward? This is just a secondary question I don't plan to any time soon but my friend thinks that it would be cool to port an app to the iPhone or iPad (though honestly I personally hate apple products) and besides it won't be happening for a while anyway even I decided I wanted to.
Edited by robolee, 05 July 2012 - 05:35 PM.






