You are viewing the NetWars Project

The entrance (WinMain) to the application is in NetWars.cpp. It is currently utilizing DirectX, D3DX, XInput (360 controller), Box2D and eventually Enet for networking.

Last Updated 5/30/08

B2DWrapper.cpp
B2DWrapper.h
Engine.cpp
Engine.h
GameBorder.cpp
GameBorder.h
LinkedList.h
NetWars.cpp
NetWars.h
SceneObject.cpp
SceneObject.h
Shield.cpp
Shield.h
SimpleWindow.cpp
SimpleWindow.h
SpaceShip.cpp
SpaceShip.h
UserInput.cpp
UserInput.h

Zips :
The zip file contains the exe and the dll's needed to run the application.

NetWars.zip


Syntax Highlighting by: SyntaxHighlighter
//-----------------------------------------------------------------------------
// UserInput Declaration
//-----------------------------------------------------------------------------
#ifndef USERINPUT_H
#define USERINPUT_H

//-----------------------------------------------------------------------------
// Input Class
//-----------------------------------------------------------------------------
class UserInput
{
public:
	UserInput( HWND window );
	~UserInput();

	void Update();

	bool GetKeyPress( char key, bool ignorePressStamp = false );

	bool GetButtonPress( char button, bool ignorePressStamp = false );
	long GetMouseX();
	long GetMouseY();
	long GetDeltaX();
	long GetDeltaY();
	long GetDeltaWheel();

	float GetAngleRightThumb();
	float GetAngleLeftThumb();	
	
	float GetRadiusRightThumb();
	float GetRadiusLeftThumb();

	b2Vec2 GetDirLeftThumb();
	b2Vec2 GetDirRightThumb();
	int GetLeftTrigger();
	int GetRightTrigger();

	void processInput();

	IDirectInput8 * GetDirectInput();

private:

	void ApplyDeadzones();

	HWND m_WindowHWND;	/// Handle to the window for the User Input.
	IDirectInput8 * m_DirectInput; // DirectInput object.
	unsigned long m_pressStamp; // Current press stamp (incremented every frame).

	IDirectInputDevice8 * m_Keyboard; // DirectInput keyboard device.
	char m_keyState[256]; // Stores the state of the keyboard keys.
	unsigned long m_keyPressStamp[256]; // Stamps the last frame each key was preseed.

	IDirectInputDevice8 * m_Mouse; // DirectInput mouse device.
	DIMOUSESTATE m_mouseState; // Stores the state of the mouse buttons.
	unsigned long m_buttonPressStamp[11]; // Stamps the last frame each button was preseed.
	POINT m_position; // Stores the position of the mouse cursor on the screen.

	XINPUT_STATE m_gamepadState; // Stores the state of the gamepad.
	bool m_gamepadConnected;
	int m_thumbDeadzone; // 7849
	int m_triggerThreshhold; //    30


	
};


#endif