449
edits
m (→Background) |
No edit summary |
||
| Line 86: | Line 86: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'' | =Highlights on Creating a Hard Coded Instrument= | ||
==Header File: cam_display.hxx== | |||
The header file is used to simply initialize a new class that contains all functions related to this instrument. The Functions are just constructed here, the contents are put in the ''cam_display.cxx'' file. | |||
<syntaxhighlight lang="cpp"> | |||
// cam_display.hxx - simple function to render view to texture | |||
#ifndef __INSTRUMENTATION_CAMVIEW_HXX | |||
#define __INSTRUMENTATION_CAMVIEW_HXX | |||
#include <simgear/props/props.hxx> | |||
#include "od_gauge.hxx" | |||
class CamView : public SGPropertyChangeListener, public FGODGauge | |||
{ | |||
public: | |||
static const int TextureHalfSize = 256; | |||
CamView(SGPropertyNode* node); | |||
virtual ~CamView(); | |||
void updateTexture(); | |||
virtual void valueChanged(SGPropertyNode*); | |||
protected: | |||
void createTexture(const char* texture_name); | |||
}; | |||
#endif // __INSTRUMENTATION_CAMVIEW_HXX | |||
</syntaxhighlight> | |||
= Related = | = Related = | ||
edits