WickedX Functions Plug-In
with DirectX Device Recovery
This is one of a handful of projects I have been working on. Some functions are subject for deletion, particularly the memory functions as I really don’t see the need. I have a intensive list of additional functions in mind. But, to be honest if there’s no interest I see no point in continuing. If you are interested I welcome your input. If you have a function you would like to see added or have an issue with any function, I would like to hear from you. Included are several source demo's that demonstrate various functions.
List of functions from the WXFunc.ini file.
PI==*no parameters*
RADIAN==(Angle Degree)
DEGREE==(Angle Radian)
RADIAN VECTOR3==Vector3Result, Vector3Degree
DEGREE VECTOR3==Vector3Result, Vector3Radian
FREE VECTOR==*no parameters*
VECTOR EXIST==(Vector, VectorType)
SET MATRIX4 ELEMENT==Matrix4Result, Element Index, Value
ANGLE VECTOR3==Vector3Result, Vector3
RIGHT VECTOR3==Vector3Result, Matrix4
UP VECTOR3==Vector3Result, Matrix4
AT VECTOR3==Vector3Result, Matrix4
BUILD ROTATION MATRIX4 VECTOR3==Vector3Result, Matrix4
BUILD ROTATION VECTOR3 MATRIX4==Matrix4Result, Vector3
DECOMPOSE MATRIX4==Vector3ResultScale, Vector4ResultRotation, Vector3ResultTranslation, Matrix4
BUILD ROTATION QUATERNION MATRIX4==Matrix4Result, Vector4
SET IDENTITY QUATERNION==Vector4Result
SET FOREGROUND COLOR==Forground Color
SET BACKGROUND COLOR==Background Color
GET FOREGROUND COLOR==*no parameters*
GET BACKGROUND COLOR==*no parameters*
LOCK PIXEL DATA==*no parameters*
UNLOCK PIXEL DATA==*no parameters*
DOT2==[X, Y][X, Y, Color]
LINE2==X1, Y1, X2, Y2
BOX2==[X1, Y1, X2, Y2, Fill][X1, Y1, X2, Y2, Color1, Color2, Color3, Color4]
CIRCLE2==X, Y, Radius, Fill
ELLIPSE2==X, Y, X Radius, Y Radius, Fill
LOAD DBO OBJECT==[Filename, Object Number][Filename, Object Number, DBPro Mode][Filename, Object Number, DBPro Mode, Divide Texture]
MAKE OBJECT NEW==Object Number, Vertex Count, Index Count
SAVE DBO OBJECT==Filename, Object Number
D3D LINE==X1, Y1, Z1, X2, Y2, Z2, Width
CAMERA ASPECT==[*no parameters*][(Camera Number)]
CAMERA FOV==[*no parameters*][(Camera Number)]
CAMERA NEAR==[*no parameters*][(Camera Number)]
CAMERA FAR==[*no parameters*][(Camera Number)]
SET PROJECTION MATRIX4==[Matrix4][Camera Number, Matrix4]
POKE BYTE==Address, Index, Value
POKE WORD==Address, Index, Value
POKE DWORD==Address, Index, Value
PEEK BYTE==(Address, Index)
PEEK WORD==(Address, Index)
PEEK DWORD==(Address, Index)
FREE MEMBLOCK==*no parameters*
WINDOW ACTIVE==*no parameters*
DEVICE LOST==*no parameters*
DEVICE RESET==*no parameters*
RECYCLE==FilePath, Flag
GET WINDOW==Index
SET WINDOW==Index, NewValue
ADJUST WINDOW==Width, Height, MenuFlag
FIND FONT==Fontname
LOAD FONT==Fontname
UNLOAD FONT==Fontname
DISABLE SYSKEYS==*no parameters*
ENABLE SYSKEYS==*no parameters*
Request: If anyone would like to write the HTML help document for this plug-in, please contact me. I would also appreciate if you can test the Device Lost demo. I have ran this in windowed, fullscreen windowed and exclusive fullscreen modes and also in a maximized window with flawless recovery on my Windows 7 system. Here is the include file for the Device Lost demo. I have made this specific to the demo but, it can easily be generalized and the functions added in the plug-in.
DXControl.dba
#constant TRUE 1
#constant FALSE 0
type t_DXCamera
bckDrop as boolean
bckDropColor as dword
xPos as float
yPos as float
zPos as float
endtype
type t_DXObject
objID as integer
objSize as float
xAng as float
yAng as float
zAng as float
endType
global DXAutoCam as boolean
global DXCamera as t_DXCamera
global DXObject as t_DXObject
_DXInitialize:
DXAutoCam = TRUE
DXCamera.bckDrop = FALSE
DXCamera.bckDropColor = 0xFF000080
DXCamera.xPos = camera position x()
DXCamera.yPos = camera position y()
DXCamera.zPos = camera position z()
return
function DXBackDropOn()
backdrop on
DXCamera.bckDrop = TRUE
endfunction
function DXColorBackdrop(bckColor as dword)
color backdrop bckColor
DXcamera.bckDropColor = bckColor
endfunction
function DXAutoCamOff()
autocam off
DXAutoCam = FALSE
endfunction
function DXPositionCamera(xPos as float, yPos as float, zPos as float)
position camera xPos, yPos, zPos
DXCamera.xPos = xPos
DXCamera.yPos = yPos
DXCamera.zPos = zPos
endfunction
function DXMakeObjectCube(objID as integer, objSize as float)
make object cube objID, objSize
DXObject.objID = objID
DXObject.objSize = objSize
DXObject.xAng = object angle x(objID)
DXObject.yAng = object angle y(objID)
DXObject.zAng = object angle z(objID)
endfunction
function DXYRotateObject(objID as integer, yAng as float)
yrotate object objID, yAng
DXObject.yAng = yAng
endfunction
function DXObjectAngleY(objID)
local yAng as float
yAng = DXObject.yAng
endfunction yAng
function DXRecover()
if (DXAutoCam)
autocam on
else
autocam off
endif
if (DXCamera.bckDrop)
backdrop on
else
backdrop off
endif
color backdrop DXCamera.bckDropColor
position camera DXCamera.xPos, DXCamera.yPos, DXCamera.zPos
make object cube DXObject.objID, DXObject.objSize
rotate object DXObject.objID, DXObject.xAng, DXObject.yAng, DXObject.zAng
endfunction