Passing Data from a C application to a Blitz3D app

Blitz3D Forums/Blitz3D Userlibs/Passing Data from a C application to a Blitz3D app

yinch(Posted 2006) [#1]
Hi all,

Does anyone have any recommendation as to how to pass data quickly from a C application (which I will write) to a Blitz app?

For the reasons of needing to use callback functions, using CallDLL is not currently an option (unless someone knows otherwise, I would love to learn how to do that)

The data will be time critical and real-time, so I need the fastest (lowest latency) possible way of channeling the data. Fortunately the data is not big - probably 2k-4k in size. But this data will need to stream to the Blitz3D app at 30-60 fps. This gives a max throughput of 240kbytes/s

much thanks in advance for any help and advice.

yinch'06


bytecode77(Posted 2006) [#2]
check out the commands copyfile and deletefile. with this commands you can write a function which should do it!
hope i understood what you meant :)


yinch(Posted 2006) [#3]
Hi DC,

Thanks for the recommendation - I have already considered using the file system - but was hoping for a method that did not involve writing and deleting files

yinch'06


bytecode77(Posted 2006) [#4]
well, i dont know but maybee it is a good idea to try byte-per-byte copyying.
you opening the a new file and copy byte per byte from the file into the other file. this can be another solution


b32(Posted 2006) [#5]
C++ isn't one of my stronger points, however here is how banks are built up:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1518
And here is how to use a Blitz pointer in a C++ DLL:
http://www.blitzbasic.com/Community/posts.php?topic=44333
(It is Tom's post)
So, make a bank and pass "bank + 4" as a parameter to the DLL. Inside the dll, you should be able to do something like:

buffer = (unsigned int)*((int*)(buffer));