iinputplugin.h

来自「VIGASOCO (VIdeo GAmes SOurce COde) Windo」· C头文件 代码 · 共 44 行

H
44
字号
// IInputPlugin.h
//
//	Abstract class that defines the interface to handle game's input with a 
//	specific device.
//
//	The inputs are updates in the process method. When an input is pressed, the
//	input plugin should increment the associated input entry, but only if the
//	entry is active (!= -1).
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _IINPUT_PLUGIN_H_
#define _IINPUT_PLUGIN_H_

#include <string>
#include "Types.h"

class IInputPlugin
{
// methods
public:
	// initialization and cleanup
	IInputPlugin(){}
	virtual ~IInputPlugin(){}
	virtual bool init() = 0;
	virtual void end() = 0;

	virtual void acquire() = 0;
	virtual void unAcquire() = 0;

	virtual void process(int *inputs) = 0;

	// access to custom plugin properties
	virtual const std::string *getProperties(int *num) const = 0;
	virtual const int *getPropertiesType() const = 0;
	virtual void setProperty(std::string prop, int data) = 0;
	virtual void setProperty(std::string prop, int index, int data) = 0;
	virtual int getProperty(std::string prop) const = 0;
	virtual int getProperty(std::string prop, int index) const = 0;
};


#endif // _IINPUT_PLUGIN_H_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?