Thread: DirectX8 FVFs

  1. #16
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    First of all you must specify to Direct3D that your vertex buffer is dynamic. Specify D3DUSAGE_DYNAMIC. This will not only allow you to lock the vertex buffer but Direct3D will optimize it so that locks are not nearly as expensive.

    Second there is no need to create a second vertex buffer. Creating multiple vertex buffers that are static and then attempting to lock them will not work. Use only the vertex buffers you need to get the job done. Multiple vertex buffers and multiple locks will slow your code down.

    Third, read the optimization tips in the DX9 SDK help file. They will give you many more ideas.

  2. #17
    Registered User
    Join Date
    Jun 2003
    Alright, well, after some thought, I'm pretty sure what I was trying to do, even if I DID get it working, would be pretty useless. There's no reason I should have to create more Vertices after intialising the first time, it just wouldn't make sense. My main reason for what I was attempting was because I wanted to draw several boxes (but all the same shape), now, why would I need more vertices if I can just call D3DXMatrixTranslation and then render the same vertices again. Perhaps what I was trying would be useful under some circumstances, but definitely not under the motives I had.

    I'm going to fall back on the good old fill out all vertices with the values I'll need and make sure my bases are covered for the future.

    I wanna say thanks one more time Bubba, I've gotten through that code of yours there, and thus far I've got an engine working for an initialisation of D3D and all 2D neccessities (Fonts, Bitmaps) covered. Next job: a class for 3D objects.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. small programming job VC++ Wavs in DirectX8
    By calgonite in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 02-16-2006, 11:52 AM
  2. DirectX8: Render Only Portions of Screen?
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 12-24-2003, 02:30 PM
  3. Transparancy in DirectX8
    By Tommaso in forum Game Programming
    Replies: 3
    Last Post: 08-27-2003, 04:18 PM