PDA

Click to See Complete Forum and Search --> : DirectX4Vb sux. Anything better?


Hu Flung Dung
May 21st, 2002, 04:12 PM
The first graphics tutorial for DirectX8 on www.directx4vb.com was poorly written and assumes too much knowledge.

Here's the initialize procedure in that tutorial:


'// Initialise : This procedure kick starts the whole process.
'// It'll return true for success, false if there was an error.
Public Function Initialise() as Boolean
On Error Goto ErrHandler:

Dim DispMode as D3DDISPLAYMODE '//Describes our Display Mode
Dim D3DWindow as D3DPRESENT_PARAMETERS '//Describes our Viewport

Set Dx = New DirectX8 '//Create our Master Object
Set D3D = Dx.Direct3DCreate() '//Make our Master Object create the Direct3D Interface

D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode '//Retrieve the current display Mode

D3DWindow.Windowed = 1 '//Tell it we're using Windowed Mode
D3DWindow.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC '//We'll refresh when the monitor does
D3DWindow.BackBufferFormat = DispMode.Format '//We'll use the format we just retrieved...

'//This line will be explained in detail in a minute...
Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, FrmMain.Hwnd, _
_ D3DCREATE_SOFTWARE_VERTEXPROCESSING, _
_ D3DWindow)

Initialise = True '//We succeeded
Exit Function
ErrHandler:
'//We failed; for now we wont worry about why.
Initialise = False
End Function


This tutorial assumes knowledge of the following words:

viewport, swapeffect, backbuffer, rasterizer.

I have never heard these words before. What do they mean? The tutorial should define them.

Also, this tutorial passes 'frmMain.hWnd' to the CreateDevice procedure without ever telling you to change the name of Form1 to frmMain.

Heres the 'Render' procedure:


Public Sub Render()
'//1. We need to clear the render device before we can draw anything
' This must always happen before you start rendering stuff...
D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, &HCCCCFF, 1#, 0
'the hexidecimal value in the middle is the same as when you're using colours in HTML - if you're familiar
'with that.

'//2. Next we would render everything. This lesson doesn't do this, but if it did it'd look something
' like this:

D3DDevice.BeginScene
'All rendering calls go between these two lines
D3DDevice.EndScene

'//3. Update the frame to the screen...
' This is the same as the Primary.Flip method as used in DirectX 7
' These values below should work for almost all cases...
D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
End Sub


First of all, it shouldn't assume knowledge of what the hex numbers do. It took me a while to figure out what it means.

This tutorial never described what 'D3DClear_Target' does, or what the '1#' does.

This tutorial never even described what the 'Present' procedure does.

In the 'FormLoad' procedure, there's an uncommented line, 'On Error Resume Next', but it was still colored green on the tutorial. This proves that this tutorial was never revised.

After all of this, the tutorial then says that you should know what everything means before moving on to other tutorials.

Are there any good online DirectX8 tutorials for beginners? I dont know why you guys always recommend this one.

Fox
May 21st, 2002, 04:16 PM
Since you're a beginner, what about starting out trying to code in pure VB? I have no problem to understand the copied code at all and DX4VB is a great site and the tutorials are commented enough. If you don't get it learn something easier first.

In the 'FormLoad' procedure, there's an uncommented line, 'On Error Resume Next', but it was still colored green on the tutorial. This proves that this tutorial was never revised.
This simple sentence of you show me that you know less than nothing about the language itselves.. go learn vb.

Hu Flung Dung
May 21st, 2002, 05:06 PM
Originally posted by Fox
Since you're a beginner, what about starting out trying to code in pure VB? I have no problem to understand the copied code at all and DX4VB is a great site and the tutorials are commented enough. If you don't get it learn something easier first.


This simple sentence of you show me that you know less than nothing about the language itselves.. go learn vb.

I know the language just fine. I've been programming with it for 3 years. I've recently made a Game Commander 2 - type program (converting verbal commands to keystrokes for use in games), and a program to send and recieve emails (not just text-only ones either).

As for that sentence, did you even take a look at the line of code? It was not commented, but still colored green on the web site. I understand what it means perfectly, its just that the author didn't do a very good job of revising his tutorial.

Just because my knowledge of graphics programming is limited doesn't mean my Visual Basic knowledge is the same.

Fox
May 21st, 2002, 05:37 PM
This doesn't change my views, if you describe yourself as a good programmer why do you have problems with that code then? Programming does not only mean knowing the language, you should be able to find sources by yourself. All commands of course are documented in the DirectX SDK which you can download from microsoft.com. I assume that you already downloaded that so why don't you use it? I had no problems at all and I startet out reading the DirectX documentation from the beginning. If you don't appreciate the samples from DX4VB don't complain about it, just ask for another source or write your own tutorial. I dislike people judging about sources as long as they can't do it better.

Zaei
May 21st, 2002, 06:19 PM
Programming isnt about having a tutorial tell you each and everything. You have the SDK Docs available to you, which would explain what half of the stuff you commented on does, and the MSDN, which could to another quarter. The other stuff is simply stuff that an experienced VB programmer SHOULD know (1# is a really good example). Many of the things you listed arent even necessary to understand the tutorial (rasterizer, viewport), while backbuffer is a VERY common word to anyone with any graphics programming experience, as well as hexidecimal numbers.

In the 'FormLoad' procedure, there's an uncommented line, 'On Error Resume Next', but it was still colored green on the tutorial. This proves that this tutorial was never revised.

You try to be perfect. For the rest of us, its pretty obvious.

From the amount of knowledge that you show, you shouldnt be thinking about D3D. Try BitBlt, for now, and get into the harder stuff later.

Z.

ChuckB
May 21st, 2002, 11:25 PM
I just spent some time at www.directx4vb.com. Try clicking on the DirectX 8, DirectX Graphics button at top of the main page. There are over 20 lessons with the first one being "Getting Started".

I opened up a blank project, and copied each code section into my VB project. After reading the lesson, I ran the program and saw clearly what the author meant.

I got up to lesson 5 before taking a break.

Try it and you may change your opinion of the site.

danielkw
Jan 7th, 2003, 05:38 AM
if you read the whole tutorial you will notice that everything that isn't described in the code is described somewhere else in the tutorial. you are suppose to read the everything in order to understand it, not just looking at the code...

NoteMe
Jan 7th, 2003, 08:54 AM
Once and for all DirectX4VB is a great site....it does a great job learning VB programmers DirectX. I started out learning DX from their site, and I'm still learing from that site....It's the best DX for VB site I have ever seen...

Sheppe
Jan 7th, 2003, 10:38 AM
Originally posted by Hu Flung Dung
I know the language just fine. I've been programming with it for 3 years. I've recently made a Game Commander 2 - type program (converting verbal commands to keystrokes for use in games), and a program to send and recieve emails (not just text-only ones either).

As for that sentence, did you even take a look at the line of code? It was not commented, but still colored green on the web site. I understand what it means perfectly, its just that the author didn't do a very good job of revising his tutorial.

Just because my knowledge of graphics programming is limited doesn't mean my Visual Basic knowledge is the same.

You're still coming across as a noob. You do know that the comment color can be changed away from green, right? Copy and paste the code, step through it, and modify it. That's how you'll learn. You can't have someone hold your hand all the time. DirectX4VB is a great site.

Hu Flung Dung
Jan 7th, 2003, 12:16 PM
OMG! This thread is back up again!! :eek: :eek: Its from MAY 2002!!!

Anyway, call me strange, but I much prefer the documentation in the DirectX SDK to DirectX4VB! Its goes over everything in a lot more detail.

BTW: Sorry I said it sux, it isn't that bad at all. What was I thinking back then?

kleinma
Jan 7th, 2003, 12:39 PM
Originally posted by Hu Flung Dung
OMG! This thread is back up again!! :eek: :eek: Its from MAY 2002!!!

Anyway, call me strange, but I much prefer the documentation in the DirectX SDK to DirectX4VB! Its goes over everything in a lot more detail.

BTW: Sorry I said it sux, it isn't that bad at all. What was I thinking back then?

well SDK documentation is always going to be the most complete.. although it can prove to be a little cryptic sometimes... but most SDKs come with code examples to illustrate the use of the properties and methods...

as for dx4vb.com... they took a lot of time to provide a free source for learning which is cool... there are also many books written on the subject.. but you have to pay for them of course.. any decent free knowledge is great compaired to the same that you must pay for...