Game Development Community

How to create a control in C++ (Tutorial)

by Abdiel Jaramillo · 02/16/2009 (2:40 am) · 2 comments

I recently needed to create a control to display graphs and decided to investigate the C++ engine source code. And as it turned out it is not that hard. So I wonder if some of you guys are interested in a tutorial about this.

Here is a snapshot of a simulation where I use the control (an early version).

escapexsoft.web.officelive.com/images/graphcontrol.png
Example of script code to add data to the graph:

function clientCmdOnDataLineReceived(%dataPos, %dataVel)
{
  tlBallPos.addRow(0, %dataPos);
  tlBallVel.addRow(0, %dataVel);

  [b]DataGraph.addPoint(getWord(%dataPos,0)/1000, getWord(%dataPos,3))[/b];  
}

Please let me know what you think.

About the author

Recent Blogs

• FREE Physica 0.5

#1
02/16/2009 (6:48 am)
I would be interested in any contribution you would be willing to make towards these kinds of tutorials. Thank you in advance for your efforts.
#2
02/16/2009 (12:44 pm)
Always welcome! very good work btw!