Here's a file from my
DarkGDK OOP Lib that has those already typed you can snag if you want. the alternate is the DIK keys that are declared in Microsoft's DirectH headers.. yeah I know I didn't name them.
jgc_common.h
/*============================================================================
| _________ _______ _______ ______ _______ Jegas, LLC |
| /___ ___// _____/ / _____/ / __ / / _____/ JasonPSage@jegas.com |
| / / / /__ / / ___ / /_/ / / /____ |
| / / / ____/ / / / / / __ / /____ / |
|____/ / / /___ / /__/ / / / / / _____/ / |
/_____/ /______/ /______/ /_/ /_/ /______/ |
| Under the Hood |
==============================================================================
Copyright(c)2008 Jegas, LLC
============================================================================*/
#pragma once
#include <DarkGDK.h>
#include "jgc_configuration.h"
#ifdef USE_DARKPHYSICS
#include <DarkPhysics.h>
#endif
#include "jgc_vector.h"
#include "jgc_camera.h"
#include "jgc_timer.h"
#include "jgc_image.h"
#include "jgc_bitmap.h"
#include "jgc_light.h"
#include "jgc_clock.h"
#include "jgc_display.h"
#include "jgc_music.h"
#include "jgc_sound.h"
#include "jgc_memblock.h"
#include "jgc_mesh.h"
#include "jgc_matrix.h"
#include "jgc_sprite.h"
#include "jgc_daddy.h"
#include "jgc_bitmapfonts.h"
#include "jgc_terrain.h"
#include "jgc_darkphysics.h"
#include "jgc_frustrumculling.h"
#include "jgc_effect.h"
#include "jgc_pixelgrid.h"
#include "jgc_file.h"
#include "jgc_userinput.h"
#include "jgc_gui.h"
//============================================================================
// Begin Generic Definitions
//============================================================================
//----------------------------------------------------------------------------
// Sparky Collision Types
//----------------------------------------------------------------------------
#define ciSCPoly 0
#define ciSCSphere 1
#define ciSCBox 2
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Keyboard Scan Codes - Shorter Name Idea: FussPawn. :)
//----------------------------------------------------------------------------
#define Key_Escape 1
#define Key_A 30
#define Key_B 48
#define Key_C 46
#define Key_D 32
#define Key_E 18
#define Key_F 33
#define Key_G 34
#define Key_H 35
#define Key_I 23
#define Key_J 36
#define Key_K 37
#define Key_L 38
#define Key_M 50
#define Key_N 49
#define Key_O 24
#define Key_P 25
#define Key_Q 16
#define Key_R 19
#define Key_S 31
#define Key_T 20
#define Key_U 22
#define Key_V 47
#define Key_W 17
#define Key_X 45
#define Key_Y 21
#define Key_Z 44
#define Key_F1 59
#define Key_F2 60
#define Key_F3 61
#define Key_F4 62
#define Key_F5 63
#define Key_F6 64
#define Key_F7 65
#define Key_F8 66
#define Key_F9 67
#define Key_F10 68
#define Key_LeftSingleQuote 41
#define Key_1 2
#define Key_2 3
#define Key_3 4
#define Key_4 5
#define Key_5 6
#define Key_6 7
#define Key_7 8
#define Key_8 9
#define Key_9 10
#define Key_0 11
#define Key_Minus 12
#define Key_Equal 13
#define Key_BackSpace 14
#define Key_Tab 15
#define Key_LeftBracket 26
#define Key_RightBracket 27
#define Key_BackSlash 43
#define Key_Enter 28
#define Key_Caps 58
#define Key_LShift 42
#define Key_RShift 54
#define Key_SemiColon 39
#define Key_SingleQuote 40
#define Key_Comma 51
#define Key_Period 52
#define Key_ForwardSlash 53
#define Key_LWinKey 219
#define Key_LAlt 56
#define Key_RAlt 184
#define Key_RWinKey 220
#define Key_WinMenu 221
#define Key_LCntl 29
#define Key_RCntl 157
#define Key_PrintScreen 183
#define Key_ScrollLock 70
//#define Key_Pause 197
#define Key_Break 197
#define Key_Ins 210
#define Key_Del 211
#define Key_Home 199
#define Key_End 207
#define Key_PgUp 201
#define Key_PgDn 209
#define Key_UpArrow 200
#define Key_DownArrow 208
#define Key_LeftArrow 203
#define Key_RightArrow 205
#define Key_NumLock 69
#define Key_NumForwardSlash 181
#define Key_NumStar 55
#define Key_NumMinus 74
#define Key_NumPlus 78
#define Key_NumEnter 156
#define Key_NumPeriod 83
#define Key_Num1 79
#define Key_Num2 80
#define Key_Num3 81
#define Key_Num4 75
#define Key_Num5 76
#define Key_Num6 77
#define Key_Num7 71
#define Key_Num8 72
#define Key_Num9 73
#define Key_Num0 82
#define Key_SpaceBar 57
//----------------------------------------------------------------------------
// FVF Flags - DIRECT X Brand
//----------------------------------------------------------------------------
#define FVF_XYZ 0x002
#define FVF_XYZRHW 0x004
#define FVF_XYZB1 0x006
#define FVF_XYZB2 0x008
#define FVF_XYZB3 0x00a
#define FVF_XYZB4 0x00c
#define FVF_XYZB5 0x00e
#define FVF_NORMAL 0x010
#define FVF_PSIZE 0x020
#define FVF_DIFFUSE 0x040
#define FVF_SPECULAR 0x080
#define FVF_TEX0 0x000
#define FVF_TEX1 0x100
#define FVF_TEX2 0x200
#define FVF_TEX3 0x300
#define FVF_TEX4 0x400
#define FVF_TEX5 0x500
#define FVF_TEX6 0x600
#define FVF_TEX7 0x700
#define FVF_TEX8 0x800
//FORMAT HEX DEC
//FVF_XYZ => 0x002 => 2
//FVF_XYZRHW => 0x004 => 4
//FVF_XYZB1 => 0x006 => 6
//FVF_XYZB2 => 0x008 => 8
//FVF_XYZB3 => 0x00a => 10
//FVF_XYZB4 => 0x00c => 12
//FVF_XYZB5 => 0x00e => 14
//FVF_NORMAL => 0x010 => 16
//FVF_PSIZE => 0x020 => 32
//FVF_DIFFUSE => 0x040 => 64
//FVF_SPECULAR => 0x080 => 128
//FVF_TEX0 => 0x000 => 0
//FVF_TEX1 => 0x100 => 256
//FVF_TEX2 => 0x200 => 512
//FVF_TEX3 => 0x300 => 768
//FVF_TEX4 => 0x400 => 1024
//FVF_TEX5 => 0x500 => 1280
//FVF_TEX6 => 0x600 => 1536
//FVF_TEX7 => 0x700 => 1792
//FVF_TEX8 => 0x800 => 2048
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// How to emulate GetMatrix4Element
//----------------------------------------------------------------------------
/*
float DK_Vectors_GetMatrixElement( int Matrix, int Element )
{
float res = 0.0;
D3DXMATRIX mat = dbGetMatrix(Matrix);
if (Element>=0 && Element<=15) res = mat[Element];
return res;
}
*/
//----------------------------------------------------------------------------
//============================================================================
// End Generic Definitions
//============================================================================
//============================================================================
// Begin Generic Function Declarations
//============================================================================
//----------------------------------------------------------------------------
// DarkGDK Missing Functions
//----------------------------------------------------------------------------
//float __cdecl dbGetMatrix4Element(int,int);//Experimental--nope didn't work.
float GetMatrix4Element( int Matrix, int Element );// LIT Workaround
void SetMatrixElement( int Matrix, int Element, float Value );
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Generic Game Making Functions
//----------------------------------------------------------------------------
float Distance(float p_xpos,float p_ypos,float p_zpos,int p_ObjectID);
float Distance(float p_xpos,float p_ypos,float p_zpos,
float p_xpos2,float p_ypos2,float p_zpos2);
float Distance(float p_x,float p_y,float p_z);
//----------------------------------------------------------------------------
//============================================================================
// End Generic Function Declarations
//============================================================================
//============================================================================
namespace JGC{
//============================================================================
extern JFC_STRING *Str;
extern JGC_FILE* File;
extern JGC_CLOCK *Clock;
extern JGC_DISPLAY *Display;
extern JGC_DARKPHYSICS *DarkPhysics;
extern JGC_CULL *Cull;
extern JGC_VECTOR *mthDistanceVector;
extern JGC_VECTORARRAY *VectorArray;
extern JGC_EFFECTARRAY *EffectArray;
extern JGC_CAMERA *Cam0;
extern JGC_CAMERAARRAY *CameraArray;
extern JGC_OBJECTARRAY *ObjectArray;
extern JGC_OBJECT *ObjAngleFinder;
extern JGC_OBJECT *ObjToy;
extern JGC_OBJECT *ObjAnchor;
extern JGC_TIMERARRAY *TimerArray;
extern JGC_BITMAPARRAY *BitmapArray;
extern JGC_BITMAP *Bitmap0;
extern JGC_IMAGEARRAY *ImageArray;
extern JGC_IMAGE *ImgTest;
extern JGC_IMAGE *ImgRed;
extern JGC_IMAGE *ImgGreen;
extern JGC_IMAGE *ImgBlue;
extern JGC_IMAGE *ImgYellow;
extern JGC_LIGHTARRAY *LightArray;
extern JGC_MUSICARRAY *MusicArray;
extern JGC_SOUNDARRAY *SoundArray;
extern JGC_TERRAINARRAY *TerrainArray;
extern JGC_MEMBLOCKARRAY *MemblockArray;
extern JGC_MESHARRAY *MeshArray;
extern JGC_MATRIXARRAY *MatrixArray;
extern JGC_SPRITEARRAY *SpriteArray;
extern JGC_DADDY *Daddy;
extern JGC_BITMAPFONTARRAY *BitmapFontArray;
extern int BitmapFontIndex_Default;
extern int BitmapFontIndex_DefaultBold;
extern JGC_BITMAPTEXTARRAY *BitmapTextArray;
extern JGC_PIXELGRIDARRAY *PixelGridArray;
extern JGC_USERINPUT *UserInput;
extern JGC_GUI *GUI;
};
//============================================================================