Jump to content

  • Log In with Google      Sign In   
  • Create Account


SpriteBatcher, rendering, and objects


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 noodleBowl   Members   -  Reputation: 183

Like
0Likes
Like

Posted 15 September 2013 - 09:29 PM

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, 17 September 2013 - 06:15 AM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS