home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
People with DirectX knowledge wanted!
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="koniosis" data-source="post: 9323" data-attributes="member: 11134"><p>Ideally you want to create the vertex buffer for your button with the correct dimensions and then use that buffer for the remainder of the application run and never lock it again. Your vertex buffers are going to contain I'm assuming four points for each corner of the image. It'll be more efficient to just keep hold of the vertex buffer throughout the life of the program, even if you leave a screen which contains buttons, just keep the vertex buffer for when the user returns to the screen with buttons.</p><p></p><p>This way you shouldn't ever have to lock the buffer. Without needing to lock the buffer you can create the vertex buffer with the WriteOnly property so that DirectX places the buffer in the correct memory location, usually AGP memory (though not always) where it can be accessed with maximum performance. e.g:</p><p></p><p>VertexBuffer vb = new VertexBuffer(..., ..., ..., Usage.WriteOnly, ..., ...);</p><p>vb.SetData(..., ..., LockFlags.None);</p><p></p><p>Note that if you do create a vertex buffer like this you CANNOT lock it; which you shouldn't do anyway! You only need to lock vertex buffers when doing custom vertex data otherwise just use the SetData() function (which essential locks the buffer for you).</p></blockquote><p></p>
[QUOTE="koniosis, post: 9323, member: 11134"] Ideally you want to create the vertex buffer for your button with the correct dimensions and then use that buffer for the remainder of the application run and never lock it again. Your vertex buffers are going to contain I'm assuming four points for each corner of the image. It'll be more efficient to just keep hold of the vertex buffer throughout the life of the program, even if you leave a screen which contains buttons, just keep the vertex buffer for when the user returns to the screen with buttons. This way you shouldn't ever have to lock the buffer. Without needing to lock the buffer you can create the vertex buffer with the WriteOnly property so that DirectX places the buffer in the correct memory location, usually AGP memory (though not always) where it can be accessed with maximum performance. e.g: VertexBuffer vb = new VertexBuffer(..., ..., ..., Usage.WriteOnly, ..., ...); vb.SetData(..., ..., LockFlags.None); Note that if you do create a vertex buffer like this you CANNOT lock it; which you shouldn't do anyway! You only need to lock vertex buffers when doing custom vertex data otherwise just use the SetData() function (which essential locks the buffer for you). [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
People with DirectX knowledge wanted!
Contact us
RSS
Top
Bottom