Jump to content
  • Advertisement
Sign in to follow this  
noodleBowl

SpriteBatcher, rendering, and objects

This topic is 2130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone!

I got a few questions about some stuff and was hoping you guys could help me out.

1.) I have an alpha stage spritebatcher I made (Code here: http://pastebin.com/M5tG2WjA ). I was testing my draw function out and I noticed that the little red square I draw seems to grow / shrink or have a heartbeat type motion as it moves. I thought it was because I was passing in a int for its position, but I changed everything to floats and it still seems to grow/shrink. Am I loading my vertexs in wrong or is it something else? Any ideas?
//Global float set to 25.0fx++;//Begin the batchbatcher.beginBatch();//Make the little square (seems to grow and shrink)batcher.draw(x,25,32,32, D3DCOLOR_XRGB(255, 0, 0));//End the batchbatcher.endBatch(device);
2.) I have not used a objects in C++ in a very long time and was wondering what are the benefits of using a "pointer object" vs a "non pointer object" are other than memory management. Also is there any time when I should use a "pointer object" over a "non pointer object"?
//Sample code for object stuff//Pointer ObjectSpriteBatcher *a;//Non pointer objectSpriteBatcher b;void stuff(){        //Create the pointer object 	a = new SpriteBatcher();        //Do stuff	a->drawSquare(0, 0, 32, 32);	b.drawSquare(0, 0, 32, 32);        //Kill the pointer object and free mem	delete a;}
3. I would like to change my vertex array max to a const. Is there someway to properly have a const in a header file?

If any of these question, especially question 1, could be answered it would be greatly appreciated!
Thanks Noodle Edited by noodleBowl

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!