RECT *mSpriteSourceRects;
...
mSpriteSourceRects = (RECT *)malloc(frames *(sizeof(RECT)));
is this correct? It doesnt seem to work logically in my program(but it will compile ok). Please shed some light on this, thanks
Edited by - shdaga on August 15, 2001 9:27:24 PM
How do I dynamically...
...allocate an array of RECTs for DX? The code I use looks like this:
Here's a new dance everyone can do, do the Kirby:<(*.*<) <(^.^)> (>*.*)> <(^.^)> <(*.*<) (>^.^)>
Ah poop, never mind! I figured it out.
Here's a new dance everyone can do, do the Kirby:<(*.*<) <(^.^)> (>*.*)> <(^.^)> <(*.*<) (>^.^)>
If you''re using C++ (and who isn''t? I havenm''t seen a genuine C only compiler for a while) you should prefer new to malloc.
Then you get:
which is much more readable, I find.
The only catch is making sure you call delete[] instead of delete but that''s pretty easy to figure out.
--
Then you get:
|
which is much more readable, I find.
The only catch is making sure you call delete[] instead of delete but that''s pretty easy to figure out.
--
Games, Anime and more at GKWorld
Meet Bunny luv'' and the girls, ready to perform on your desktop just for you (warning: adult content).
All respect to the
---
blahpers
new
and delete
. A big "poo-poo" on malloc
and kin. ---
blahpers
---blahpers
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement