Hallo,
Ich habe ein XNA Device auf einer VB.NET Windows Form erstellt das gleiche auch mit XNA in C# (zumindestens die gleichen Textures) jedoch bekomm ich in der Vb.Net Anwendung einige Grafik Fehler woran liegt das??
hier ist ein Video
christopher.kilu.de/video.wmv (1,78 MB)
christopher.kilu.de/video.zip (1,72 MB)
Hier der Code
C#
Spoiler anzeigen
GraphicsDevice.Clear(Color.CornflowerBlue);
effect.World = worldMatrix;
effect.View = viewMatrix;
effect.Projection = projectionMatrix;
effect.VertexColorEnabled = true;
this.effect.Begin();
foreach(EffectPass pass in this.effect.CurrentTechnique.Passes) {
pass.Begin();
GraphicsDevice.VertexDeclaration = vertexDeclaration;
//this.graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionColor.VertexElements);
this.graphics.GraphicsDevice.RenderState.CullMode = CullMode.None;
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 6);
pass.End();
VB.net
Spoiler anzeigen
Vielen Dank
Ich habe ein XNA Device auf einer VB.NET Windows Form erstellt das gleiche auch mit XNA in C# (zumindestens die gleichen Textures) jedoch bekomm ich in der Vb.Net Anwendung einige Grafik Fehler woran liegt das??
hier ist ein Video
christopher.kilu.de/video.wmv (1,78 MB)
christopher.kilu.de/video.zip (1,72 MB)
Hier der Code
C#
GraphicsDevice.Clear(Color.CornflowerBlue);
effect.World = worldMatrix;
effect.View = viewMatrix;
effect.Projection = projectionMatrix;
effect.VertexColorEnabled = true;
this.effect.Begin();
foreach(EffectPass pass in this.effect.CurrentTechnique.Passes) {
pass.Begin();
GraphicsDevice.VertexDeclaration = vertexDeclaration;
//this.graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionColor.VertexElements);
this.graphics.GraphicsDevice.RenderState.CullMode = CullMode.None;
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 6);
pass.End();
VB.net
VB.NET-Quellcode
- Sub Render()
- _device.Clear(Color.CornflowerBlue)
- effect.World = worldMatrix
- effect.View = viewMatrix
- effect.Projection = projectionMatrix
- effect.VertexColorEnabled = True
- Me.effect.Begin()
- For Each pass As EffectPass In Me.effect.CurrentTechnique.Passes
- pass.Begin()
- _device.VertexDeclaration = VertexDeclaration
- 'this.graphics.GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionColor.VertexElements);
- _device.RenderState.CullMode = CullMode.None
- _device.DrawUserPrimitives(Of VertexPositionColor)(PrimitiveType.TriangleList, vertices, 0, triindex)
- pass.[End]()
- Next
- Me.effect.[End]()
- _device.Present()
- End Sub
Vielen Dank