Creating VertexDeclaration every frame
Hi @ll
i have a simple quiestion bout examples in xna tutorials
why VertexDeclaration is creating every frame
using( VertexDeclaration decl = new VertexDeclaration(
graphics.GraphicsDevice, VertexPositionColor.VertexElements ) )
{....
Why instead of it just create it once on start and use then every frame?
[347 byte] By [
NeTBaPb] at [2007-12-25]
it seems this is the only place in docs with this bug
Mitch Walker - MSFT wrote: |
| This is a bug. You shouldn't create a VertexDeclaration each frame. |
|
that's what i want to hear, thx for quick reply :)
btw, i've tried to use BasicEffect, but seems it's bugged, no vertex color, no lighting (there r light artifacts; edit: ohh, i forgot to define vertex normals ^_^) or maybe i'm doing something wrong :)
The version of BasicEffect we shipped in the beta doesn't support vertex color, but we're hoping to add that for the final release.
Lighting works fine with BasicEffect as long as you have normals in your geometry data.