Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / Array DLL - Updated ... again

Author
Message
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Sep 2003 02:24
I have doubled the number of commands in the array dll ... by allowing all commands to also accept an array address as an argument in place of an array name.

For example, these pieces of code are equivalent



What's the gain? Now you can pass array identities into functions:



This allows you to write functions that do not have hard-coded array names inside them. I have a great example of what you can do that I'll post here tomorrow.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Sep 2003 00:00
Hot off the presses ...

You can now pass arrays by reference and access them as arrays in the normal way.



Oh, and I've also included three small example program in the zip file
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Sep 2003 23:37
Here's that example code I promised two days ago ... a bit late, but never mind

To use it, you will need my Array plugin and the Extend1 plugin.

The idea behind this is that you can assemble your meshes into an array instead of a memblock which simplifies and speeds up your code (array access is far faster than memblock access). Then when your array is complete, you call one of the Make????FromVertexBuffer functions that quickly copies all the array data into a memblock and makes a mesh from it.

Despite all the copying that happens you will find that this code still runs faster than the equivalent memblock code. My original code ran at 58fps, this code runs at 67fps.
D Man
22
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 3rd Sep 2003 00:05
That's really useful!
I think I'll test it.

God is real, unless declared integer.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Sep 2003 10:10 Edited at: 16th Sep 2003 10:11
Just a quick update for everyone in regard to Update 5.1

Unfortunately, this latest update has slightly broken the type system within the compiler. It now makes the wrong decision as to which version of the command you want in relation to using an array or an array pointer. It will always try and use the pointer version and will give you a 'cast' error.

The quick fix for you is for any code that you have that looks like this:

REVERSE ARRAY a()

Change it to this:

REVERSE ARRAY get array ptr( a() )

I'll be updating the dll tonight to rename all of the pointer related commands to avoid the conflict.

Please note, that will will only affect *this* dll, as no-one else is currently using arrays in this way.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Sep 2003 10:40
Version 4 of the DLL is now available.

I have solved the problem by simply renaming all commands that access a pointer instead of an array to use the work ARRAYPTR instead of ARRAY in the command name.

Hopefully, this won't break too much of anyones code

Login to post a reply

Server time is: 2024-11-21 14:05:13
Your offset time is: 2024-11-21 14:05:13