vsTASKER 7 Tutorial
×
Menu
Index

GL-Studio

 
  
GL-Studio outputs a C++ code that instanciate several graphic objects belonging to their own library. These graphic objects have either some input values, output values or both, depending of these categories.
vsTASKER is able to mix his own generated code with the one generated by GL-Studio in order to actuate graphic objects. It also can be controlled from graphic objects.
 
  
Open or create you model inside GL-Studio (here _altimeter.gls)
 
We will use the two variables to set the Altitude and the Barometer, plus the two callback functions to react to user input on the ELECT/PNEU switch and the BARO knob (in magenta on the picture above)
 
GL-Studio can now generate the code:
 
Create the GL-Studio object inside vsTASKER then open it:
 
In the property window, set for File the GL-Studio model saved from inside GL-Studio application:
 
Then specify the source code directory (Code) where GL-Studio has put its generated code.
This will be used to extract the interface:
 
Now, in the code, let's define two variables:
 public:
   float bar;  //&& DEF[28]
   float alt;  //&& DEF[5000]
 
In the runtime part of the code, let's access the object (O:) variable and feed them with the actual entity values:
  alt = E:getDyn()->getAltitude();
 
 O:Altitude(alt);
 O:Barometer(bar);
 
You now need to use a GL-Studio viewer.
See here on how to do.
 
Compile, generate then run.
You will see the altimeter object output running nicely on its own little window.
  
 
O: is a macro that returns a pointer to the GL-Studio graphical object.