@marsim wrote:
Hi all,
I hope to be clear
I load 10 Models in 10 different Model objects say:
Model a;
Model b;
...a = Content.Load("a");
b = Content.Load("b");
...Then I store these models into a List
models = new List();models.add(a);
models.add(b);
...then I have a Model p that points to the first object in the List
p = models[0];
after pressing a key, p is assigned to the next list element
p = models[1]
Obviously, the model is drawed in the Draw() function.
All works correctly except that after the third model I've the error below.
I've tried to load and draw all models one by one and I've no error.
Exception thrown: 'SharpDX.SharpDXException' in SharpDX.dll
Exception thrown: 'SharpDX.SharpDXException' in SharpDX.dll
Exception thrown: 'System.InvalidOperationException' in MonoGame.Framework.dll
An unhandled exception of type 'System.InvalidOperationException' occurred in MonoGame.Framework.dll
An error occurred while preparing to draw. This is probably because the current vertex declaration does not include all the elements required by the current vertex shader. The current vertex declaration includes these elements: SV_Position0, TEXCOORD0.**'MG - SauroTest.exe' (CLR v4.0.30319: MG - SauroTest.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll'. **
The program '[8752] MG - SauroTest.exe' has exited with code -1 (0xffffffff).
Posts: 1
Participants: 1