BASIC

Author Topic: Passing an array to another cpp?  (Read 3695 times)

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Passing an array to another cpp?
« on: 2016-Jan-16 »
On Linux/RPi, how can I fast pass an array (not command args nor serial) from a running GLBasic program to a running cpp (compiled with g++)?  :'( :S

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5009
  • O Rly?
    • View Profile
Re: Passing an array to another cpp?
« Reply #1 on: 2016-Jan-18 »
Write to a file or use a scriptlanguage like LUA?
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Passing an array to another cpp?
« Reply #2 on: 2016-Jan-18 »
A file (or serial) stream seems to be my only option and I will have to try this now. I have done this before with a webcam image crated in opengl then opened in glbasic. It just requires an incremented file and then a follow up clean up. I suppose I can research g++ to g++ later.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10683
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Passing an array to another cpp?
« Reply #3 on: 2016-Jan-20 »
To another process or a linked library?

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Passing an array to another cpp?
« Reply #4 on: 2016-Jan-21 »
"Experimental demo of 1K of bitmap data from 3D GLB screen and then read on the RPi2 via cpp that runs the monochrome OLED.
In this case the GLBasic app is running on Windows and saving locally with a forced frame delay of 100ms without frame drops. The RPi2 is connected via network drive to read the data.
If could be faster if the bitmap array (even larger colour buffers) could be passed to the process directly and also the GLB app can run on the Rpi also.
This is similar to my Nokia monochrome LCD video stream demo."

<a href="http://www.youtube.com/watch?v=jlZWYpBzkds" target="_blank">http://www.youtube.com/watch?v=jlZWYpBzkds</a>

Offline UBERmonkeybot

  • Mr. Polyvector
  • ***
  • Posts: 243
    • View Profile
Re: Passing an array to another cpp?
« Reply #5 on: 2016-Jan-21 »
That's cool.Nice.   =D

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4174
    • View Profile
    • Portfolio
Re: Passing an array to another cpp?
« Reply #6 on: 2016-Jan-22 »
Funky groovy experimentation! Do you have a final intention with it?

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Passing an array to another cpp?
« Reply #7 on: 2016-Jan-22 »
Not entirely sure what a need would be but I am thinking how it might be more portable with the Pi0. I'm sure I could demo a game but the idea that GLBasic is drawing rather than cpp. Note it's not the re-imaging that's new here as it's simply writing/reading a file. I've done this with Arduino serial video but this time I was hoping to get this 1k file as an array directly to the process. As you can see I used the Rpi2, as I am hesitant to solder in header pin in the Pi0 just for a general demo video.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4174
    • View Profile
    • Portfolio
Re: Passing an array to another cpp?
« Reply #8 on: 2016-Jan-22 »
So, you have a glb program running on PC that sends data to a glb program running on Pi and it uses this data to draw?
Is that what is actually happening?

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Passing an array to another cpp?
« Reply #9 on: 2016-Jan-22 »
No, it simply saves to a file. In this case over netbios but I was/am aiming for a RPi local version because the whole point to this thread is to casually find out how to get it sent to the process, not a cool demo otherwise my video wouldn't be unlisted.  :zzz:

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
Re: Passing an array to another cpp?
« Reply #10 on: 2016-Jan-23 »
what is your goal ? i cant understand.

i build a sort of wrapper for 2d commands on the rpi , it reads the serial data from my micromite
and shows it.

<a href="http://www.youtube.com/watch?v=Qq71AohqhwY" target="_blank">http://www.youtube.com/watch?v=Qq71AohqhwY</a>

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Passing an array to another cpp?
« Reply #11 on: 2016-Jan-23 »
We really need to post less experimental video demos.   :'(

There's not more that I can imagine unless anyone has some ideas to share. The most sensible I can think of, aside from games, is 3D navigation mapping but doesn't seem practical.  :x

« Last Edit: 2016-Jan-23 by matchy »

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Passing an array to another cpp?
« Reply #12 on: 2016-Jan-23 »
So if I got it right, you want to send data from one program to an other? You can do this with SOCK_ command, thats what i did between 2 instances of my DDGui-Creator.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Passing an array to another cpp?
« Reply #13 on: 2016-Jan-23 »
That is how I send via a web server but with TCP not UCP like with the multiplayer game. Perhaps I wil try that then.  ;)

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
« Last Edit: 2016-Jan-24 by Marmor »