Howto:Use a Camera View in an Instrument: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (note about allocRT)
No edit summary
Line 128: Line 128:


#endif // __INSTRUMENTATION_CAMVIEW_HXX
#endif // __INSTRUMENTATION_CAMVIEW_HXX
</syntaxhighlight>
=Adding the Instrument to 'instrument_mgr.cxx'=
Your Instrument's header file, ''cam_display.hxx'' is a constructor for the main instrument class, and the functions are further defined in the ''cam_display.cxx'' function. Include the ''cam_display.hxx'' function in the ''instrument_mgr.cxx'' file so it knows where your function is.
<syntaxhighlight lang="cpp">
#include "cam_display.hxx"
</syntaxhighlight>
In the ''FGInstrumentMgr::build'' function, add an '''else if''' statement so that it checks whether your instrument too is called.
<syntaxhighlight lang="cpp">
else if ( name == "cam_display" ) {
            set_subsystem( id, new CamView( node ),1);
        }
</syntaxhighlight>
</syntaxhighlight>


449

edits

Navigation menu