Objects and Pointers
BlitzMax Forums/BlitzMax Beginners Area/Objects and Pointers
| ||
Hi quick question, in my current project I have a number of objects, each object contains the field Field image:Timage. which is the image data I use to draw the object. In the game each object uses 1 of 5 different images, so I am thinking rather than store the image data in each object I should be storing a pointer to the image data in each object? Thanks |
| ||
What you are doing is effectively storing a pointer. All Blitz types are pointers to structures, so you only have to load an image once and you can have thousands of objects referencing it. |
| ||
ok I see. Thanks for the help |
| ||
On the same kind of topic. Just tried out this code to explain something to myself: Am I right in thinking that square.test is a pointer to ball? As the line square.test.one=6 changes the value of ball.one? |
| ||
yes run this |
| ||
Yip thought so. Cheers |