Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
BIN
Library/dxx8/samples/Multimedia/DirectInput/FFConst/directx.ico
Normal file
BIN
Library/dxx8/samples/Multimedia/DirectInput/FFConst/directx.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
555
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.cpp
Normal file
555
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.cpp
Normal file
@@ -0,0 +1,555 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: FFConst.cpp
|
||||
//
|
||||
// Desc: Demonstrates an application which sets a force feedback constant force
|
||||
// determined by the user.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#define STRICT
|
||||
#include <tchar.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <basetsd.h>
|
||||
#include <mmsystem.h>
|
||||
#include <dinput.h>
|
||||
#include <math.h>
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||
BOOL CALLBACK EnumFFDevicesCallback( const DIDEVICEINSTANCE* pInst, VOID* pContext );
|
||||
BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* pContext );
|
||||
HRESULT InitDirectInput( HWND hDlg );
|
||||
VOID FreeDirectInput();
|
||||
VOID OnPaint( HWND hDlg );
|
||||
HRESULT OnMouseMove( HWND hDlg, INT x, INT y, UINT keyFlags );
|
||||
VOID OnLeftButtonDown( HWND hDlg, INT x, INT y, UINT keyFlags );
|
||||
VOID OnLeftButtonUp( HWND hDlg, INT x, INT y, UINT keyFlags );
|
||||
INT CoordToForce( INT x );
|
||||
HRESULT SetDeviceForcesXY();
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Defines, constants, and global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
|
||||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||||
|
||||
#define FEEDBACK_WINDOW_X 20
|
||||
#define FEEDBACK_WINDOW_Y 60
|
||||
#define FEEDBACK_WINDOW_WIDTH 200
|
||||
|
||||
LPDIRECTINPUT8 g_pDI = NULL;
|
||||
LPDIRECTINPUTDEVICE8 g_pDevice = NULL;
|
||||
LPDIRECTINPUTEFFECT g_pEffect = NULL;
|
||||
BOOL g_bActive = TRUE;
|
||||
DWORD g_dwNumForceFeedbackAxis = 0;
|
||||
INT g_nXForce;
|
||||
INT g_nYForce;
|
||||
DWORD g_dwLastEffectSet; // Time of the previous force feedback effect set
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Entry point for the application. Since we use a simple dialog for
|
||||
// user interaction we don't need to pump messages.
|
||||
//-----------------------------------------------------------------------------
|
||||
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
|
||||
{
|
||||
// Display the main dialog box.
|
||||
DialogBox( hInst, MAKEINTRESOURCE(IDD_FORCE_FEEDBACK), NULL, MainDlgProc );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: MainDlgProc
|
||||
// Desc: Handles dialog messages
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( msg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
if( FAILED( InitDirectInput( hDlg ) ) )
|
||||
{
|
||||
MessageBox( NULL, _T("Error Initializing DirectInput ")
|
||||
_T("The sample will now exit."),
|
||||
_T("FFConst"), MB_ICONERROR | MB_OK );
|
||||
EndDialog( hDlg, 0 );
|
||||
}
|
||||
|
||||
// Init the time of the last force feedback effect
|
||||
g_dwLastEffectSet = timeGetTime();
|
||||
break;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
if( FAILED( OnMouseMove( hDlg, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), (UINT)wParam ) ) )
|
||||
{
|
||||
MessageBox( NULL, _T("Error setting effect parameters. ")
|
||||
_T("The sample will now exit."),
|
||||
_T("FFConst"), MB_ICONERROR | MB_OK );
|
||||
EndDialog( hDlg, 0 );
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
OnLeftButtonDown( hDlg, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), (UINT)wParam );
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
OnLeftButtonUp( hDlg, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), (UINT)wParam );
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
OnPaint( hDlg );
|
||||
break;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
if( WA_INACTIVE != wParam && g_pDevice )
|
||||
{
|
||||
// Make sure the device is acquired, if we are gaining focus.
|
||||
g_pDevice->Acquire();
|
||||
|
||||
if( g_pEffect )
|
||||
g_pEffect->Start( 1, 0 ); // Start the effect
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDCANCEL:
|
||||
EndDialog( hDlg, 0 );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE; // Message not handled
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
// Cleanup everything
|
||||
KillTimer( hDlg, 0 );
|
||||
FreeDirectInput();
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE; // Message not handled
|
||||
}
|
||||
|
||||
return TRUE; // Message handled
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: InitDirectInput()
|
||||
// Desc: Initialize the DirectInput variables.
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT InitDirectInput( HWND hDlg )
|
||||
{
|
||||
DIPROPDWORD dipdw;
|
||||
HRESULT hr;
|
||||
|
||||
// Register with the DirectInput subsystem and get a pointer
|
||||
// to a IDirectInput interface we can use.
|
||||
if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION,
|
||||
IID_IDirectInput8, (VOID**)&g_pDI, NULL ) ) )
|
||||
{
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Look for a force feedback device we can use
|
||||
if( FAILED( hr = g_pDI->EnumDevices( DI8DEVCLASS_GAMECTRL,
|
||||
EnumFFDevicesCallback, NULL,
|
||||
DIEDFL_ATTACHEDONLY | DIEDFL_FORCEFEEDBACK ) ) )
|
||||
{
|
||||
return hr;
|
||||
}
|
||||
|
||||
if( NULL == g_pDevice )
|
||||
{
|
||||
MessageBox( NULL, _T("Force feedback device not found. ")
|
||||
_T("The sample will now exit."),
|
||||
_T("FFConst"), MB_ICONERROR | MB_OK );
|
||||
EndDialog( hDlg, 0 );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Set the data format to "simple joystick" - a predefined data format. A
|
||||
// data format specifies which controls on a device we are interested in,
|
||||
// and how they should be reported.
|
||||
//
|
||||
// This tells DirectInput that we will be passing a DIJOYSTATE structure to
|
||||
// IDirectInputDevice8::GetDeviceState(). Even though we won't actually do
|
||||
// it in this sample. But setting the data format is important so that the
|
||||
// DIJOFS_* values work properly.
|
||||
if( FAILED( hr = g_pDevice->SetDataFormat( &c_dfDIJoystick ) ) )
|
||||
return hr;
|
||||
|
||||
// Set the cooperative level to let DInput know how this device should
|
||||
// interact with the system and with other DInput applications.
|
||||
// Exclusive access is required in order to perform force feedback.
|
||||
if( FAILED( hr = g_pDevice->SetCooperativeLevel( hDlg,
|
||||
DISCL_EXCLUSIVE |
|
||||
DISCL_FOREGROUND ) ) )
|
||||
{
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Since we will be playing force feedback effects, we should disable the
|
||||
// auto-centering spring.
|
||||
dipdw.diph.dwSize = sizeof(DIPROPDWORD);
|
||||
dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
|
||||
dipdw.diph.dwObj = 0;
|
||||
dipdw.diph.dwHow = DIPH_DEVICE;
|
||||
dipdw.dwData = FALSE;
|
||||
|
||||
if( FAILED( hr = g_pDevice->SetProperty( DIPROP_AUTOCENTER, &dipdw.diph ) ) )
|
||||
return hr;
|
||||
|
||||
// Enumerate and count the axes of the joystick
|
||||
if ( FAILED( hr = g_pDevice->EnumObjects( EnumAxesCallback,
|
||||
(VOID*)&g_dwNumForceFeedbackAxis, DIDFT_AXIS ) ) )
|
||||
return hr;
|
||||
|
||||
// This simple sample only supports one or two axis joysticks
|
||||
if( g_dwNumForceFeedbackAxis > 2 )
|
||||
g_dwNumForceFeedbackAxis = 2;
|
||||
|
||||
// This application needs only one effect: Applying raw forces.
|
||||
DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y };
|
||||
LONG rglDirection[2] = { 0, 0 };
|
||||
DICONSTANTFORCE cf = { 0 };
|
||||
|
||||
DIEFFECT eff;
|
||||
ZeroMemory( &eff, sizeof(eff) );
|
||||
eff.dwSize = sizeof(DIEFFECT);
|
||||
eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS;
|
||||
eff.dwDuration = INFINITE;
|
||||
eff.dwSamplePeriod = 0;
|
||||
eff.dwGain = DI_FFNOMINALMAX;
|
||||
eff.dwTriggerButton = DIEB_NOTRIGGER;
|
||||
eff.dwTriggerRepeatInterval = 0;
|
||||
eff.cAxes = g_dwNumForceFeedbackAxis;
|
||||
eff.rgdwAxes = rgdwAxes;
|
||||
eff.rglDirection = rglDirection;
|
||||
eff.lpEnvelope = 0;
|
||||
eff.cbTypeSpecificParams = sizeof(DICONSTANTFORCE);
|
||||
eff.lpvTypeSpecificParams = &cf;
|
||||
eff.dwStartDelay = 0;
|
||||
|
||||
// Create the prepared effect
|
||||
if( FAILED( hr = g_pDevice->CreateEffect( GUID_ConstantForce,
|
||||
&eff, &g_pEffect, NULL ) ) )
|
||||
{
|
||||
return hr;
|
||||
}
|
||||
|
||||
if( NULL == g_pEffect )
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: EnumAxesCallback()
|
||||
// Desc: Callback function for enumerating the axes on a joystick and counting
|
||||
// each force feedback enabled axis
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
|
||||
VOID* pContext )
|
||||
{
|
||||
DWORD* pdwNumForceFeedbackAxis = (DWORD*) pContext;
|
||||
|
||||
if( (pdidoi->dwFlags & DIDOI_FFACTUATOR) != 0 )
|
||||
(*pdwNumForceFeedbackAxis)++;
|
||||
|
||||
return DIENUM_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: EnumFFDevicesCallback()
|
||||
// Desc: Called once for each enumerated force feedback device. If we find
|
||||
// one, create a device interface on it so we can play with it.
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL CALLBACK EnumFFDevicesCallback( const DIDEVICEINSTANCE* pInst,
|
||||
VOID* pContext )
|
||||
{
|
||||
LPDIRECTINPUTDEVICE8 pDevice;
|
||||
HRESULT hr;
|
||||
|
||||
// Obtain an interface to the enumerated force feedback device.
|
||||
hr = g_pDI->CreateDevice( pInst->guidInstance, &pDevice, NULL );
|
||||
|
||||
// If it failed, then we can't use this device for some
|
||||
// bizarre reason. (Maybe the user unplugged it while we
|
||||
// were in the middle of enumerating it.) So continue enumerating
|
||||
if( FAILED(hr) )
|
||||
return DIENUM_CONTINUE;
|
||||
|
||||
// We successfully created an IDirectInputDevice8. So stop looking
|
||||
// for another one.
|
||||
g_pDevice = pDevice;
|
||||
|
||||
return DIENUM_STOP;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: FreeDirectInput()
|
||||
// Desc: Initialize the DirectInput variables.
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID FreeDirectInput()
|
||||
{
|
||||
// Unacquire the device one last time just in case
|
||||
// the app tried to exit while the device is still acquired.
|
||||
if( g_pDevice )
|
||||
g_pDevice->Unacquire();
|
||||
|
||||
// Release any DirectInput objects.
|
||||
SAFE_RELEASE( g_pEffect );
|
||||
SAFE_RELEASE( g_pDevice );
|
||||
SAFE_RELEASE( g_pDI );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: OnPaint()
|
||||
// Desc: Handles the WM_PAINT window message
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID OnPaint( HWND hDlg )
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
HPEN hpenOld;
|
||||
HPEN hpenBlack;
|
||||
HBRUSH hbrOld;
|
||||
HBRUSH hbrBlack;
|
||||
INT x;
|
||||
INT y;
|
||||
|
||||
hDC = BeginPaint( hDlg, &ps );
|
||||
if( NULL == hDC )
|
||||
return;
|
||||
|
||||
// Everything is scaled to the size of the window.
|
||||
hpenBlack = GetStockPen( BLACK_PEN );
|
||||
hpenOld = SelectPen( hDC, hpenBlack );
|
||||
|
||||
// Draw force feedback bounding rect
|
||||
MoveToEx( hDC, FEEDBACK_WINDOW_X, FEEDBACK_WINDOW_Y, NULL );
|
||||
|
||||
LineTo( hDC, FEEDBACK_WINDOW_X,
|
||||
FEEDBACK_WINDOW_Y + FEEDBACK_WINDOW_WIDTH );
|
||||
LineTo( hDC, FEEDBACK_WINDOW_X + FEEDBACK_WINDOW_WIDTH,
|
||||
FEEDBACK_WINDOW_Y + FEEDBACK_WINDOW_WIDTH );
|
||||
LineTo( hDC, FEEDBACK_WINDOW_X + FEEDBACK_WINDOW_WIDTH,
|
||||
FEEDBACK_WINDOW_Y );
|
||||
LineTo( hDC, FEEDBACK_WINDOW_X,
|
||||
FEEDBACK_WINDOW_Y );
|
||||
|
||||
// Calculate center of feedback window for center marker
|
||||
x = FEEDBACK_WINDOW_X + FEEDBACK_WINDOW_WIDTH / 2;
|
||||
y = FEEDBACK_WINDOW_Y + FEEDBACK_WINDOW_WIDTH / 2;
|
||||
|
||||
// Draw center marker
|
||||
MoveToEx( hDC, x, y - 10, NULL );
|
||||
LineTo( hDC, x, y + 10 + 1 );
|
||||
MoveToEx( hDC, x - 10, y, NULL );
|
||||
LineTo( hDC, x + 10 + 1, y );
|
||||
|
||||
hbrBlack = GetStockBrush( BLACK_BRUSH );
|
||||
hbrOld = SelectBrush( hDC, hbrBlack );
|
||||
|
||||
x = MulDiv( FEEDBACK_WINDOW_WIDTH,
|
||||
g_nXForce + DI_FFNOMINALMAX,
|
||||
2 * DI_FFNOMINALMAX );
|
||||
|
||||
y = MulDiv( FEEDBACK_WINDOW_WIDTH,
|
||||
g_nYForce + DI_FFNOMINALMAX,
|
||||
2 * DI_FFNOMINALMAX );
|
||||
|
||||
x += FEEDBACK_WINDOW_X;
|
||||
y += FEEDBACK_WINDOW_Y;
|
||||
|
||||
Ellipse( hDC, x-5, y-5, x+6, y+6 );
|
||||
|
||||
SelectBrush( hDC, hbrOld );
|
||||
SelectPen( hDC, hpenOld );
|
||||
|
||||
EndPaint( hDlg, &ps );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: OnMouseMove()
|
||||
// Desc: If the mouse button is down, then change the direction of
|
||||
// the force to match the new location.
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT OnMouseMove( HWND hDlg, INT x, INT y, UINT keyFlags )
|
||||
{
|
||||
HRESULT hr;
|
||||
DWORD dwCurrentTime;
|
||||
|
||||
if( NULL == g_pEffect )
|
||||
return S_OK;
|
||||
|
||||
if( keyFlags & MK_LBUTTON )
|
||||
{
|
||||
dwCurrentTime = timeGetTime();
|
||||
|
||||
if( dwCurrentTime - g_dwLastEffectSet < 100 )
|
||||
{
|
||||
// Don't allow setting effect more often than
|
||||
// 100ms since every time an effect is set, the
|
||||
// device will jerk.
|
||||
//
|
||||
// Note: This is not neccessary, and is specific to this sample
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
g_dwLastEffectSet = dwCurrentTime;
|
||||
|
||||
x -= FEEDBACK_WINDOW_X;
|
||||
y -= FEEDBACK_WINDOW_Y;
|
||||
|
||||
g_nXForce = CoordToForce( x );
|
||||
g_nYForce = CoordToForce( y );
|
||||
|
||||
InvalidateRect( hDlg, 0, TRUE );
|
||||
UpdateWindow( hDlg );
|
||||
|
||||
if( FAILED( hr = SetDeviceForcesXY() ) )
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: OnLeftButtonDown()
|
||||
// Desc: Capture the mouse so we can follow it, and start updating the
|
||||
// force information.
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID OnLeftButtonDown( HWND hDlg, INT x, INT y, UINT keyFlags )
|
||||
{
|
||||
SetCapture( hDlg );
|
||||
OnMouseMove( hDlg, x, y, MK_LBUTTON );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: OnLeftButtonUp()
|
||||
// Desc: Stop capturing the mouse when the button goes up.
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID OnLeftButtonUp( HWND hDlg, INT x, INT y, UINT keyFlags )
|
||||
{
|
||||
ReleaseCapture();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: CoordToForce()
|
||||
// Desc: Convert a coordinate 0 <= nCoord <= FEEDBACK_WINDOW_WIDTH
|
||||
// to a force value in the range -DI_FFNOMINALMAX to +DI_FFNOMINALMAX.
|
||||
//-----------------------------------------------------------------------------
|
||||
INT CoordToForce( INT nCoord )
|
||||
{
|
||||
INT nForce = MulDiv( nCoord, 2 * DI_FFNOMINALMAX, FEEDBACK_WINDOW_WIDTH )
|
||||
- DI_FFNOMINALMAX;
|
||||
|
||||
// Keep force within bounds
|
||||
if( nForce < -DI_FFNOMINALMAX )
|
||||
nForce = -DI_FFNOMINALMAX;
|
||||
|
||||
if( nForce > +DI_FFNOMINALMAX )
|
||||
nForce = +DI_FFNOMINALMAX;
|
||||
|
||||
return nForce;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: SetDeviceForcesXY()
|
||||
// Desc: Apply the X and Y forces to the effect we prepared.
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT SetDeviceForcesXY()
|
||||
{
|
||||
// Modifying an effect is basically the same as creating a new one, except
|
||||
// you need only specify the parameters you are modifying
|
||||
LONG rglDirection[2] = { 0, 0 };
|
||||
|
||||
DICONSTANTFORCE cf;
|
||||
|
||||
if( g_dwNumForceFeedbackAxis == 1 )
|
||||
{
|
||||
// If only one force feedback axis, then apply only one direction and
|
||||
// keep the direction at zero
|
||||
cf.lMagnitude = g_nXForce;
|
||||
rglDirection[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If two force feedback axis, then apply magnitude from both directions
|
||||
rglDirection[0] = g_nXForce;
|
||||
rglDirection[1] = g_nYForce;
|
||||
cf.lMagnitude = (DWORD)sqrt( (double)g_nXForce * (double)g_nXForce +
|
||||
(double)g_nYForce * (double)g_nYForce );
|
||||
}
|
||||
|
||||
DIEFFECT eff;
|
||||
ZeroMemory( &eff, sizeof(eff) );
|
||||
eff.dwSize = sizeof(DIEFFECT);
|
||||
eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS;
|
||||
eff.cAxes = g_dwNumForceFeedbackAxis;
|
||||
eff.rglDirection = rglDirection;
|
||||
eff.lpEnvelope = 0;
|
||||
eff.cbTypeSpecificParams = sizeof(DICONSTANTFORCE);
|
||||
eff.lpvTypeSpecificParams = &cf;
|
||||
eff.dwStartDelay = 0;
|
||||
|
||||
// Now set the new parameters and start the effect immediately.
|
||||
return g_pEffect->SetParameters( &eff, DIEP_DIRECTION |
|
||||
DIEP_TYPESPECIFICPARAMS |
|
||||
DIEP_START );
|
||||
}
|
||||
|
||||
|
||||
|
||||
173
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.dsp
Normal file
173
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.dsp
Normal file
@@ -0,0 +1,173 @@
|
||||
# Microsoft Developer Studio Project File - Name="FFConst" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=FFConst - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ffconst.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ffconst.mak" CFG="FFConst - Win32 Debug Unicode"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "FFConst - Win32 Debug Unicode" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "FFConst - Win32 Release Unicode" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "FFConst - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "FFConst - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "FFConst - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "FFConst - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "FFConst - Win32 Debug Unicode"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Win32_Debug_Unicode"
|
||||
# PROP BASE Intermediate_Dir "Win32_Debug_Unicode"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Win32_Debug_Unicode"
|
||||
# PROP Intermediate_Dir "Win32_Debug_Unicode"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "_MBCS" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "FFConst - Win32 Release Unicode"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Win32_Release_Unicode"
|
||||
# PROP BASE Intermediate_Dir "Win32_Release_Unicode"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Win32_Release_Unicode"
|
||||
# PROP Intermediate_Dir "Win32_Release_Unicode"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "_MBCS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "FFConst - Win32 Release"
|
||||
# Name "FFConst - Win32 Debug"
|
||||
# Name "FFConst - Win32 Debug Unicode"
|
||||
# Name "FFConst - Win32 Release Unicode"
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FFConst.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FFConst.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\readme.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "FFConst"=.\ffconst.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
350
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.mak
Normal file
350
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.mak
Normal file
@@ -0,0 +1,350 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ffconst.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=FFConst - Win32 Debug Unicode
|
||||
!MESSAGE No configuration specified. Defaulting to FFConst - Win32 Debug Unicode.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "FFConst - Win32 Release" && "$(CFG)" != "FFConst - Win32 Debug" && "$(CFG)" != "FFConst - Win32 Debug Unicode" && "$(CFG)" != "FFConst - Win32 Release Unicode"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ffconst.mak" CFG="FFConst - Win32 Debug Unicode"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "FFConst - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "FFConst - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "FFConst - Win32 Debug Unicode" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "FFConst - Win32 Release Unicode" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "FFConst - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ffconst.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\FFConst.obj"
|
||||
-@erase "$(INTDIR)\FFConst.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\ffconst.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\ffconst.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\FFConst.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ffconst.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\ffconst.pdb" /machine:I386 /out:"$(OUTDIR)\ffconst.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\FFConst.obj" \
|
||||
"$(INTDIR)\FFConst.res"
|
||||
|
||||
"$(OUTDIR)\ffconst.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "FFConst - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ffconst.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\FFConst.obj"
|
||||
-@erase "$(INTDIR)\FFConst.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\ffconst.exe"
|
||||
-@erase "$(OUTDIR)\ffconst.ilk"
|
||||
-@erase "$(OUTDIR)\ffconst.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\ffconst.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\FFConst.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ffconst.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\ffconst.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ffconst.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\FFConst.obj" \
|
||||
"$(INTDIR)\FFConst.res"
|
||||
|
||||
"$(OUTDIR)\ffconst.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "FFConst - Win32 Debug Unicode"
|
||||
|
||||
OUTDIR=.\Win32_Debug_Unicode
|
||||
INTDIR=.\Win32_Debug_Unicode
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Win32_Debug_Unicode
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ffconst.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\FFConst.obj"
|
||||
-@erase "$(INTDIR)\FFConst.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\ffconst.exe"
|
||||
-@erase "$(OUTDIR)\ffconst.ilk"
|
||||
-@erase "$(OUTDIR)\ffconst.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "_MBCS" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /Fp"$(INTDIR)\ffconst.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\FFConst.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ffconst.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\ffconst.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ffconst.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\FFConst.obj" \
|
||||
"$(INTDIR)\FFConst.res"
|
||||
|
||||
"$(OUTDIR)\ffconst.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "FFConst - Win32 Release Unicode"
|
||||
|
||||
OUTDIR=.\Win32_Release_Unicode
|
||||
INTDIR=.\Win32_Release_Unicode
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Win32_Release_Unicode
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ffconst.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\FFConst.obj"
|
||||
-@erase "$(INTDIR)\FFConst.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\ffconst.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "_MBCS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /Fp"$(INTDIR)\ffconst.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\FFConst.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ffconst.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxguid.lib winmm.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\ffconst.pdb" /machine:I386 /out:"$(OUTDIR)\ffconst.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\FFConst.obj" \
|
||||
"$(INTDIR)\FFConst.res"
|
||||
|
||||
"$(OUTDIR)\ffconst.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("ffconst.dep")
|
||||
!INCLUDE "ffconst.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "ffconst.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "FFConst - Win32 Release" || "$(CFG)" == "FFConst - Win32 Debug" || "$(CFG)" == "FFConst - Win32 Debug Unicode" || "$(CFG)" == "FFConst - Win32 Release Unicode"
|
||||
SOURCE=.\FFConst.rc
|
||||
|
||||
"$(INTDIR)\FFConst.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\FFConst.cpp
|
||||
|
||||
"$(INTDIR)\FFConst.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
111
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.rc
Normal file
111
Library/dxx8/samples/Multimedia/DirectInput/FFConst/ffconst.rc
Normal file
@@ -0,0 +1,111 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_FORCE_FEEDBACK DIALOG DISCARDABLE 0, 0, 162, 188
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Force Feedback Constant Force Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Exit",IDCANCEL,97,167,50,14
|
||||
LTEXT "Click the mouse inside the square below to",IDC_STATIC,
|
||||
7,7,135,8
|
||||
LTEXT "set the strength and direction of the force ",
|
||||
IDC_STATIC,7,15,132,8
|
||||
LTEXT "feedback effect. ",IDC_STATIC,7,23,55,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_JOY_FEEDBACK, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 155
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 181
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_MAIN ICON DISCARDABLE "directx.ico"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Sample Name: FFConst Sample
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
This application applies raw forces to a force feedback input device,
|
||||
illustrating how a simulator-type application can use force feedback to
|
||||
generate forces computed by a physics engine.
|
||||
|
||||
You must have a force feedback device connected to your system in order to
|
||||
run the application.
|
||||
|
||||
Path
|
||||
====
|
||||
Source: DXSDK\Samples\Multimedia\DInput\FFConst
|
||||
|
||||
Executable: DXSDK\Samples\Multimedia\DInput\Bin
|
||||
|
||||
User's Guide
|
||||
============
|
||||
When you run the application, it displays a window with a crosshair and a
|
||||
black spot in it. Click the mouse anywhere within the window's client area to
|
||||
move the black spot. (Note that moving the device itself does not do
|
||||
anything.) FFConst exerts a constant force on the device from the
|
||||
direction of the spot, in proportion to the distance from the crosshair. You
|
||||
can also hold down the mouse button and move the spot continuously.
|
||||
|
||||
Programming Notes
|
||||
=================
|
||||
This sample program enumerates the input devices and acquires the first
|
||||
force-feedback device that it finds. If none are detected, it displays a
|
||||
message and terminates.
|
||||
|
||||
When the user moves the black spot, the joySetForcesXY function converts the
|
||||
cursor coordinates to a force direction and magnitude. This data is used to
|
||||
modify the parameters of the constant force effect.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by FFconst.rc
|
||||
//
|
||||
#define IDD_FORCE_FEEDBACK 102
|
||||
#define IDI_MAIN 102
|
||||
#define IDC_CLOSE 1000
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user