Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 VB.NET 2005 & DX

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Kal_Torak Posted - May 22 2005 : 1:02:29 PM
Is anyone using the new 2005 versions of VB with DirectX?

I'm new to DirectX and with the lack of tutorials/documentation I am not doing very well. ( I can't even draw a triangle!!)

Any good ideas or helpfuls on this?
10   L A T E S T    R E P L I E S    (Newest First)
Kal_Torak Posted - Jun 11 2005 : 8:03:51 PM
Hehe cbx! I had already found that site via search engine, and downloaded most of the tutorials about 3 days ago. :)
Kal_Torak Posted - Jun 11 2005 : 8:02:36 PM
Hmm, mabye I'll buy the book then...
I'll go look at that site cbx.
I found a kickstart for DX9 that works in VB 2k5, so I'm not totally stuck now ;)
Lachlan87 Posted - Jun 07 2005 : 12:18:24 PM
It's not in VB, but the CD that comes with it has the VB.NET Source code. Also, I think you'll find it pretty easy to convert C# code to VB.NET. I did.
cbx Posted - Jun 06 2005 : 11:18:48 AM
I have a few example code snips on my web site at http://www.createdbyx.com/Default.aspx?tabid=32 that may help you get started.
Kal_Torak Posted - May 29 2005 : 08:36:26 AM
Yeah, I have looked quite a lot for books on it.. but all I found was Millers that looked like what I wanted. I almost bought it then I realized it was not VB
Krisc Posted - May 28 2005 : 9:09:11 PM
I would ask around and/or look for a book that is highly similar to Miller's Managed DirectX 9.0 Kick Start book because I know the version I got is written in C#. It is an amazing book and resource, you learn how to do a ton of useful stuff in Direct3D and you even make a really simple game.
Kal_Torak Posted - May 27 2005 : 7:54:33 PM
Eh! Thanks! I drew my first triangle! Excitment! lol

Now will someone write a tut showing how to use a .X mesh ?
:)
Krisc Posted - May 27 2005 : 6:15:56 PM
It can never call MakeVerts() because it returns true and exits the function. Try putting the return true after the MakeVerts() call.
Kal_Torak Posted - May 26 2005 : 09:50:37 AM
I am following this tutorial: http://www.vbgamer.com/tutorial.asp?ndx=12

I did the first one about Initializing d3d first...



Here is my code with the error message in the Render sub.

  
Imports Microsoft.DirectX  
Imports Microsoft.DirectX.Direct3D  
  
Public Class Form1  
  
    Dim Dev As Device = Nothing  
    Private VertBuff As VertexBuffer  
    Private strings As String = "ASD"  
  
  
  
  
  
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load  
  
  
        If Init3ds() = False Then
            MessageBox.Show("Awww.. No D3D for you!")  
        End If
  
        Me.Show()  
        Do
            Render()  
            Application.DoEvents()  
        Loop
  
  
    End Sub
  
    Public Function Init3ds() As Boolean
        Try
            Dim pParams As New PresentParameters()  
            pParams.Windowed = True
            pParams.SwapEffect = SwapEffect.Discard  
            Dev = New Device(0, DeviceType.Hardware, Me, CreateFlags.SoftwareVertexProcessing, pParams)  
            Return True
  
            MakeVerts()  
  
        Catch e As DirectXException  
            Return False
        End Try
    End Function
  
    Private Sub Render()  
        'grab the error with Catch  
        'A first chance exception of type 'Microsoft.DirectX.Direct3D.InvalidCallException' occurred in Microsoft.DirectX.Direct3D.dll  
        'Error in the application.  
        '-2005530516 (D3DERR_INVALIDCALL)  
        'at(Microsoft.DirectX.Direct3D.Device.BeginScene())  
        'at DX.Form1.Render() in C:\...\Form1.vb:line 49  
  
        Try
            Dev.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0F, 0)  
            Dev.BeginScene()  
            '==============  
            Dev.SetStreamSource(0, VertBuff, 0)  
            Dev.VertexFormat = CustomVertex.TransformedColored.Format  
            Dev.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 1)  
            '==============  
            Dev.EndScene()  
            Dev.Present()  
        Catch ex As DirectXException  
            Debug.WriteLine(ex)  
  
  
        End Try
  
  
  
    End Sub
  
  
    Public Sub MakeVerts()  
        VertBuff = New VertexBuffer(GetType(CustomVertex.TransformedColored), 3, Dev, 0, CustomVertex.TransformedColored.Format, Pool.Default)  
        Dim verts As CustomVertex.TransformedColored() = CType(VertBuff.Lock(0, 0), CustomVertex.TransformedColored())  
        verts(0).X = 150  
        verts(0).Y = 50  
        verts(0).Z = 0.5F  
        verts(0).Rhw = 1  
        verts(0).Color = Color.Aqua.ToArgb  
  
        verts(1).X = 250  
        verts(1).Y = 250  
        verts(1).Z = 0.5F  
        verts(1).Rhw = 1  
        verts(1).Color = Color.Brown.ToArgb  
  
        verts(2).X = 50  
        verts(2).Y = 250  
        verts(2).Z = 0.5F  
        verts(2).Rhw = 1  
        verts(2).Color = Color.LightPink.ToArgb  
  
        VertBuff.Unlock()  
    End Sub
  
End Class  
  
  
  
  

Krisc Posted - May 23 2005 : 12:58:52 AM
It works in the same was as VS.net 2003. You need to go to the Project menu and Add References. From there you scroll and click the DirectX and Direct3D references and add them. Beyond that I am not so sure, what tutorial are you using? What are the problems, do you just not see anything? Have you turned off lighting? We need more information to help you...

VBGamer © Go To Top Of Page
This page was generated in 0.23 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.