Visual Basic Callback Interfaces

The Microsoft® Direct3D® Retained Mode callback interfaces for Microsoft Visual Basic® are:

To use the callback interfaces, for example Direct3DRMDeviceUpdateCallback3, perform the following steps.

  1. Copy the following line into the Code Editor window.
    Implements Direct3DRMDeviceUpdateCallback3
    
  2. Press ENTER.
  3. Select Direct3DRMDeviceUpdateCallback3 from the Object list box. The syntax block for the Direct3DRMDeviceUpdateCallback3 interface appears on your form.
    Private Sub Direct3DRMDeviceUpdateCallback3_CallbackRMUpdate(
        ByVal f As DxVBLib.Direct3DRMDevice3, ByVal arg As Object, 
        ByVal n As Long, Update As DxVBLib.D3DRECT)
    	'do something
    End Sub
    

Direct3DRMCallback.CallbackRMDestroyObject

Removes an object.

Syntax

object_CallbackRMDestroyObject(ByVal args As Object)

Parts

object
Object expression that resolves to a Direct3DRMCallback object.
args
Application-defined data passed to this callback.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMDeviceUpdateCallback3.CallbackRMUpdate

Alerts the application when the device changes. This callback is application-defined.

Syntax

object_CallbackRMUpdate(ByVal f As DxVBLib.Direct3DRMDevice3,
  ByVal arg As Object,
  ByVal n As Long,
  Update As DxVBLib.D3DRECT)

Parts

object
Object expression that resolves to a Direct3DRMDeviceUpdateCallback3 object.
f
Direct3DRMDevice3 object to which this callback applies.
arg
Application-defined data passed to this callback.
n
Number of rectangles specified in the Update parameter.
Update
D3DRECT type that describes the area to be updated. The coordinates are specified in device units.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMEnumerateObjectsCallback.CallbackRMEnumerateObjects

Enumerates objects in response to a call to the Direct3DRM3.EnumerateObjects method. This callback is application-defined.

Syntax

object_CallbackRMEnumerateObjects(ByVal Object As DxVBLib.Direct3DRMObject,
  ByVal userArgument As Object)

Parts

object
Object expression that resolves to a Direct3DRMEnumerateObjectsCallback object.
object
Direct3DRMObject object.
userArgument
Application-defined data passed to this callback.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameMoveCallback3.CallbackRMFrameMove

Enables an application to apply customized algorithms when a frame is moved or updated. You can use this callback to compensate for changing frame rates. This callback is application-defined.

Syntax

object_CallbackRMFrameMove(ByVal f As DxVBLib.Direct3DRMFrame3,
  ByVal arg As Object,
  ByVal delta As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameMoveCallback3 object.
f
Direct3DRMFrame3 object that is being moved.
arg
Application-defined data passed to this callback.
delta
Amount of change to apply to the movement. There are two components to the change in position of a frame: linear and rotational. The change in each component is equal to velocity_of_component × delta. Although either or both of these velocities can be set relative to any frame, the system automatically converts them to velocities relative to the parent frame for the purpose of applying time deltas.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Remarks

Your application can synthesize the acceleration of a frame relative to its parent frame. To do so, on each tick your application should set the velocity of the child frame relative to itself to (a units per tick) × 1 tick, where a is the required acceleration. This is equal to a × delta units per tick. Internally, a × delta units per tick relative to the child frame is converted to (v + (a × delta)) units per tick relative to the parent frame, where v is the current velocity of the child relative to the parent.

You can add and remove this callback from your application by using the Direct3DRMFrame3.AddMoveCallback and Direct3DRMFrame3.DeleteMoveCallback methods.

When determining the order in which to use callbacks, the system searches the objects highest in the hierarchy first, and then uses their callbacks in the order in which they were created.

Direct3DRMLoadCallback.CallbackRMLoad

Loads objects named in a call to the Direct3DRM3.LoadFromFile method. This callback is application-defined.

Syntax

object_CallbackRMLoad(Obj As DxVBLib.Direct3DRMObject,
  ByVal guid As String,
  ByVal userArgument As Object)

Parts

object
Object expression that resolves to a Direct3DRMLoadCallback object.
Obj
Direct3DRMObject object being loaded.
guid
Globally unique identifier (GUID) of the object being loaded.
userArgument
Application-defined data passed to this callback.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Remarks

When determining the order in which to use callbacks, the system searches the objects highest in the hierarchy first, and then uses their callbacks in the order in which they were created.

See Also

Direct3DRM3.LoadFromFile

Direct3DRMLoadTextureCallback3.CallbackRMLoadTexture

Loads texture maps from a file or resource named in a call to one of the LoadFromFile methods. Textures must have a width and length divisible by 2. This callback is application-defined.

Syntax

object_CallbackRMLoadTexture(ByVal textureName As String,
  ByVal userArgument As Object) As DxVBLib.Direct3DRMTexture3

Parts

object
Object expression that resolves to a Direct3DRMLoadTextureCallback3 object.
textureName
String containing the name of the texture.
userArgument
Application-defined data passed to this callback.

Return Value

Returns a Direct3DRMTexture3 object.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Remarks

Applications can use this callback to implement support for textures that are not in the Microsoft® Windows® bitmap (.bmp) or Portable Pixelmap bitmap (.ppm) P6 format. The P6 format is a binary file format for color images.

When determining the order in which to use callbacks, the system searches the objects highest in the hierarchy first, and then uses their callbacks in the order in which they were created.

See Also

Direct3DRM3.LoadFromFile, Direct3DRMAnimationSet2.LoadFromFile, Direct3DRMFrame3.LoadFromFile, Direct3DRMMeshBuilder3.LoadFromFile


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.