rFactorPluginServer/Include/Example.hpp

83 lines
3.8 KiB
C++
Raw Normal View History

2022-02-09 13:27:02 +00:00
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F> <20>
//<2F> Module: Internals Example Header File <20>
//<2F> <20>
//<2F> Description: Declarations for the Internals Example Plugin <20>
//<2F> <20>
//<2F> <20>
//<2F> This source code module, and all information, data, and algorithms <20>
//<2F> associated with it, are part of CUBE technology (tm). <20>
//<2F> PROPRIETARY AND CONFIDENTIAL <20>
//<2F> Copyright (c) 1996-2014 Image Space Incorporated. All rights reserved. <20>
//<2F> <20>
//<2F> <20>
//<2F> Change history: <20>
//<2F> tag.2005.11.30: created <20>
//<2F> <20>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifndef _INTERNALS_EXAMPLE_H
#define _INTERNALS_EXAMPLE_H
#include "InternalsPlugin.hpp"
// This is used for the app to use the plugin for its intended purpose
class ExampleInternalsPlugin : public InternalsPluginV01 // REMINDER: exported function GetPluginVersion() should return 1 if you are deriving from this InternalsPluginV01, 2 for InternalsPluginV02, etc.
{
public:
// Constructor/destructor
ExampleInternalsPlugin() {}
~ExampleInternalsPlugin() {}
// These are the functions derived from base class InternalsPlugin
// that can be implemented.
void Startup( long version ); // game startup
void Shutdown(); // game shutdown
void EnterRealtime(); // entering realtime
void ExitRealtime(); // exiting realtime
void StartSession(); // session has started
void EndSession(); // session has ended
// GAME OUTPUT
long WantsTelemetryUpdates() { return( 1 ); } // CHANGE TO 1 TO ENABLE TELEMETRY EXAMPLE!
void UpdateTelemetry( const TelemInfoV01 &info );
bool WantsGraphicsUpdates() { return( false ); } // CHANGE TO TRUE TO ENABLE GRAPHICS EXAMPLE!
void UpdateGraphics( const GraphicsInfoV01 &info );
// GAME INPUT
bool HasHardwareInputs() { return( false ); } // CHANGE TO TRUE TO ENABLE HARDWARE EXAMPLE!
void UpdateHardware( const double fDT ) { mET += fDT; } // update the hardware with the time between frames
void EnableHardware() { mEnabled = true; } // message from game to enable hardware
void DisableHardware() { mEnabled = false; } // message from game to disable hardware
// See if the plugin wants to take over a hardware control. If the plugin takes over the
// control, this method returns true and sets the value of the double pointed to by the
// second arg. Otherwise, it returns false and leaves the double unmodified.
bool CheckHWControl( const char * const controlName, double &fRetVal );
bool ForceFeedback( double &forceValue ); // SEE FUNCTION BODY TO ENABLE FORCE EXAMPLE
// SCORING OUTPUT
bool WantsScoringUpdates() { return( false ); } // CHANGE TO TRUE TO ENABLE SCORING EXAMPLE!
void UpdateScoring( const ScoringInfoV01 &info );
// COMMENTARY INPUT
bool RequestCommentary( CommentaryRequestInfoV01 &info ); // SEE FUNCTION BODY TO ENABLE COMMENTARY EXAMPLE
private:
void WriteToAllExampleOutputFiles( const char * const openStr, const char * const msg );
double mET; // needed for the hardware example
bool mEnabled; // needed for the hardware example
};
#endif // _INTERNALS_EXAMPLE_H