Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
You got this from ".NET Game Programming with DirectX 9" eh?

I love that book :).

 

Hey btw, there are a couple problems with the sprite class from that book, and it has to do with creating the vertex buffer:

 

First of all, the FVF_CUSTOMVERTEX in the class you attached is not defined :p.

Second of all:

Dim Vertices as CustomVertex() is not a good way to code... this is because you must specify the type of CustomVertex... for example

 

Dim Vertices As CustomVertex.PositionTextured().

 

In either case, Dim Vertices as CustomVertex() would not work becuase in the book, it is defined in another class (GameClass I beleive)

 

3rd of all, in public sub Draw:

If transparent then

objDirect3DDevice.Alphablend = True

End If

 

would not work :), in the book they turn on the SourceBlend and the InvSourceBlend in the Initialize sub in the GameClass.

 

4th of all, CreateFlexVertex (arguments) as CUSTOMVERTEX would not work, becuase CUSTOMVERTEX is defined in GameClass in the book (or something like that)..

The easiest thing to do is rather than use that function, just say

Vertices(0) = new CustomVertex.<whatever>(arguments)

 

The book is great(that's what my tutorials are mainly based off of), but its got a few quirks here and there :P)

 

Just remember, don't define anything as "CustomVertex"... becuase CustomVertex is a DirectX class,

 

-The Pentium Guy

 

In all honesty, I haven't come across one tutorial that didn't have its quirks. I think that it is part of the learning experience for them to have quirks. If you can fix the quirks, you have successfully "learned" the material.

Posted

This was tested in FullScreen, a 393216 vertex Heightmap was rendered on a:

3.0c & 1 gb ddr3200 & radeon 9800 pro overclocked to XT speeds

 

Using the "Paint Trick"... FPS = 44

Without using the Paint Trick... FPS = 43

 

... DOH :), you're right, this has no effect on FullScreen whatsoever.

 

-The Pentium Guy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted (edited)
This was tested in FullScreen' date=' a 393216 vertex Heightmap was rendered on a:

3.0c & 1 gb ddr3200 & radeon 9800 pro overclocked to XT speeds

 

Using the "Paint Trick"... FPS = 44

Without using the Paint Trick... FPS = 43

 

... DOH :), you're right, this has no effect on FullScreen whatsoever.

 

-The Pentium Guy

 

Ya, I would hope it didn't have any effect. If it did...I would be worried. ;)

 

That is because when you have fullscreen, it gives you exclusive rights to the screen pretty much. Which means a really nice boost in speed. The reason why your paint trick works is not because loops are "slow", it is because GDI+'s paint() function is slow. When you override it like that, you are effectively speeding it up.

Edited by Aragorn7
Posted

cant check it now.. vacation.. Will check when i come home.. Cant you just download my project and check self?? It should be ready to compile...

 

EDIT: I saw you edited your post.. :p

 

--Loffen

Erutangis a si tahw
Posted
Ok.. here it is.. Had very short time, so if i missed a part just tell me..

Rendering the transparent sprite is not included though...

 

I'm attempting to get this code to run, but can't. Maybe it's because I'm using the summer 04 update.

 

I get the following error:

C:\Documents and Settings\Nick\My Documents\Visual Studio Projects\EngineDocumented\GraphicsText.vb(45): Overload resolution failed because no accessible 'DrawText' can be called with these arguments:

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As Integer) As Integer': Value of type 'String' cannot be converted to 'Microsoft.DirectX.Direct3D.Sprite'.

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As Integer) As Integer': Value of type 'System.Drawing.Rectangle' cannot be converted to 'String'.

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As Integer) As Integer': Value of type 'Integer' cannot be converted to 'System.Drawing.Point'.

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As Integer) As Integer': Value of type 'System.Drawing.Color' cannot be converted to 'Integer'.

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As System.Drawing.Color) As Integer': Value of type 'String' cannot be converted to 'Microsoft.DirectX.Direct3D.Sprite'.

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As System.Drawing.Color) As Integer': Value of type 'System.Drawing.Rectangle' cannot be converted to 'String'.

'Public Function DrawText(sprite As Microsoft.DirectX.Direct3D.Sprite, text As String, pos As System.Drawing.Point, color As System.Drawing.Color) As Integer': Value of type 'Integer' cannot be converted to 'System.Drawing.Point'.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...