DirectX 9 in VB.NET. How to store data to XFile? 
Author Message
 DirectX 9 in VB.NET. How to store data to XFile?

Hi all,
    I have started to use DirectX 9 in VB.NET.
And here is the first big problem (for me). How to store some data to
XFile and how to read them?
I tried to make two samples. The first sample would save some instance
of Vector3 to XFile and second one would create an instance of the
same vector from XFile.

1) Store Vector3 to XFile
*****************************************************************************
Dim loc_Manager As XFileManager
Dim loc_SaveObject As XFileSaveObject
Dim loc_Data As XFileData
Dim loc_Vector As Vector3
Dim loc_Byte() as Byte

loc_Vector = New Vector3(10, 20, 30)
loc_Manager = New XFileManager()
loc_SaveObject = loc_Manager.CreateSaveObject("D:\Temp\Mesh.x",XFileFormat.Text)

'And here is the first problem.
'The last argument of "CreateDataObject" method is an array of bytes.
'How to store bytes from "loc_Vector" to "loc_Byte()" ?
'Is there some function in DirectX or in VB.NET for it?
'Or am I doing some other mistake in my code?

loc_Data = loc_SaveObject.CreateDataObject(XFileGuid.Vector, "ABCD",
XFileGuid.Vector, loc_Byte)
loc_SaveObject.SaveData(loc_Data)
*****************************************************************************

2) Read Vector3 from XFile
*****************************************************************************
Dim loc_Manager As XFileManager
Dim loc_Data As XFileData
Dim loc_XFile As XFile
Dim loc_Vector As Vector3

loc_Manager = New XFileManager()
loc_XFile = loc_Manager.LoadFromFile("D:\Temp\arrow.x")
loc_Data = loc_XFile.GetDataObjectByName("ABCD")
'And here is the second problem. How would the arguments of GetData
method look like?
'I was only guessing how the arguments could look.
loc_Vector = loc_Data.GetData("", loc_Vector.GetType)
*****************************************************************************

Any answer will be very appreciated.
Thanks!



Sun, 09 Oct 2005 06:05:02 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ASP.net VB.Net Stored Procedures in SQL Server

2. VB.Net => Ado.Net = Stored Procedure

3. VB.Net and DirectX 9: creating an event

4. VB.NET and DirectX

5. DirectX and VB.net problem, help!

6. DirectX and VB.Net

7. DirectX in VB.NET

8. DirectX with VB.NET

9. DirectX 8(.1) and VB.NET

10. vb.net Directx - InValidCastException with SetFont method

11. DirectX and VB.Net ?

12. directx and vb.net

 

 
Powered by phpBB® Forum Software