Results 1 to 2 of 2

Thread: vb d3d8 here we go again (drawing problem)

Threaded View

  1. #1

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    vb d3d8 here we go again (drawing problem)

    i again have a drawing problem.
    when i wnat to draw a tile of the tilesheet it draws the right tile but it also draws 1 pixel in height a difrent tile and it goes off the screen i think i got the cord right because with dd7 it worked fine.

    VB Code:
    1. 'init tilesheet(2x2 tiles)
    2.     Let Strip(0) = CreateTLVertex(0, 0, 0.5, 0.5)
    3.     Let Strip(1) = CreateTLVertex(TileWidth, 0, 1, 0.5)
    4.     Let Strip(2) = CreateTLVertex(0, TileHeight, 0.5, 1)
    5.     Let Strip(3) = CreateTLVertex(TileWidth, TileHeight, 1, 1)
    6.  
    7.     Set CTTiles = New CTexture
    8.     Call CTTiles.File(D3DX, D3DD, App.Path & "\GFX\GT\" & Dir$(App.Path & "\GFX\GT\*.bmp"), vbHXMagenta)
    9.  
    10. Public Sub File(ByVal D3DX As D3DX8, ByVal D3DD As Direct3DDevice8, ByVal Path As String, Optional ByVal ColorKey As Long)
    11.     Set D3DT = D3DX.CreateTextureFromFileEx(D3DD, Path, D3DX_DEFAULT, D3DX_DEFAULT, 1, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_FILTER_POINT, D3DX_FILTER_POINT, ColorKey, ByVal 0, ByVal 0)
    12.     Call D3DT.GetLevelDesc(0, D3DSD)
    13. End Sub
    14.  
    15. 'then draw
    16.             Call D3DD.SetTexture(0, CTTiles.D3DT)
    17.             Call D3DD.DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, Strip(0), Len(Strip(0)))
    Attached Images Attached Images  
    Last edited by nareth; Jan 22nd, 2005 at 09:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width