473,379 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

DirectX 8 Help

I'm new to VB.net and DirectX, so I'm following a tutorial in a book
that is apparently written in VS6. I'm using the the VB Express 2005.
The problem lies using the CopyRects function. In the book, the
function calls for a RECT variable. The CopyRects function now calls
for a IntPtr variable where the RECT was in the book. The same goes
for a POINT variable later in the function. Here is a snipet of the
code:

Dim sourceRect As DxVBLibA.RECT

'Setup RECT
sourceRect.left = sourcex
sourceRect.top = sourcey
sourceRect.right = sourcex + width
sourceRect.bottom = sourcey + height

'Create POINT
Dim point1 As DxVBLibA.POINT

'Setup POINT
point1.x = destx
point1.y = desty

'Draw Tile
d3ddev.CopyRects(source, sourceRect, 1, backBuffer, point1)

d3ddev is of dxvbliba.direct3ddevice8. What the function is calling
for is a IntPtr in place where the sourceRect and point1 is located.
If anyone has any clue, please help.

Thanks in advance,
Klaki

Nov 23 '05 #1
2 2257

ka*****@outgun.com wrote:
I'm new to VB.net and DirectX, so I'm following a tutorial in a book
that is apparently written in VS6. I'm using the the VB Express 2005.
Is there a pressing reason why you can't use DX 9, which has managed
(ie .net-friendly) libraries? Targeting the DX8 libraries from VB.NET
means you have effectively *two* transitions to make: from .net to
unmanaged, and from VB to C++-oriented.
The problem lies using the CopyRects function. In the book, the
function calls for a RECT variable. The CopyRects function now calls
for a IntPtr variable where the RECT was in the book. The same goes
for a POINT variable later in the function. Here is a snipet of the
code:

Dim sourceRect As DxVBLibA.RECT

'Setup RECT
sourceRect.left = sourcex
sourceRect.top = sourcey
sourceRect.right = sourcex + width
sourceRect.bottom = sourcey + height

'Create POINT
Dim point1 As DxVBLibA.POINT

'Setup POINT
point1.x = destx
point1.y = desty

'Draw Tile
d3ddev.CopyRects(source, sourceRect, 1, backBuffer, point1)

d3ddev is of dxvbliba.direct3ddevice8. What the function is calling
for is a IntPtr in place where the sourceRect and point1 is located.
If anyone has any clue, please help.


How is CopyRects being declared? In a type library, or by a Declare? I
don't have the DX docs to hand, but I see from the WinCE DX stuff that
the CopyRects function there expects an array of RECT and an array of
POINT - which of course C-style is passed as a pointer to a RECT and a
pointer to a POINT, which I suppose might get translated as IntPtrs.
Really you want a declaration of CopyRects that understands this. But
see my first comment as I'm already out of my depth.

--
Larry Lard
Replies to group please

Nov 23 '05 #2
i don't have any declare statements so I guess it's in the DxVBLibA
library. Here is how it's declared according to the Definition:

Sub CopyRects(ByVal SourceSurface As DxVBLibA.Direct3DSurface8, ByVal
FirstElementOfSourceRectsArray As System.IntPtr, ByVal NumberOfRects As
Integer, ByVal DestinationSurface As DxVBLibA.Direct3DSurface8, ByVal
FirstElementofDestPointArray As System.IntPtr)
Member of: DxVBLibA.Direct3DDevice8

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: kastillo | last post by:
Im trying to install directx 9.0 c , but i simply cant . When i run the installer it just says " The installed components are ready to use". This is the report on directx.log : 09/10/05...
2
by: Akkadian123 | last post by:
Hi guys, I'm a student of c#, and I was wondering how one would take advantage of multimedia in most c# apps/games. I assume one would use directx9, since there doesn't seem to be any support...
2
by: Michael Mayer | last post by:
First of all, sorry for the cross-post. Seems like there should be a managed directx newsgroup. I'm trying to open the following sample application that comes with the DirectX SDK....
6
by: ammd | last post by:
Hi, I installed Microsoft DirectX 9.0 SDK (Summer 2004) but when I create a project and try to add the necessary references I can't find them. Does anybody know where to look for them? BTW, I have VS...
4
by: Zoury | last post by:
look up your timezome settings... you have future posted.
4
by: Junaid Hussain | last post by:
Hi, I am thinking about developing a 3D pool game in C# using DirectX, however when I compile a C# at the command prompt using; csc PoolGame.cs , I get the following error message; The type or...
9
by: Mike P | last post by:
Problems, problems... Im trying to create DirectX Projects within C# and to also look at the latest DirectX C# Samples. I have just installed MS Visual C# .net Standard Edition on my Windows...
3
by: johnb41 | last post by:
I am building a .net app that does some simple image tasks (Tiff files): viewing Tiff, viewing thumbnails from multipage tiff, rotation, page (frame) deletion, etc. The problem is that it is so...
3
by: Abdul Azeez(BLR) | last post by:
Hi, I need to use DirectX in my application for drawing the network diagram. May I know the procedure to draw a Graph( Rectangular boxes connected with straight lines) using DirectX. Could you...
10
by: gerry | last post by:
i just downloaded and installed the directx aug 2006 sdk the machine i installed it on had both vs2003 & vs2005 the visual studio extensions were installed into vs2003 but not into vs2005. does...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.