OnCreateVertexBuffer”的重载均与委托“System.EventHandler”不匹配 哪错了?要怎么改?
publicvoidOnCreateDevice(objectsender,EventArgse){Devicedev=(Device)sender;vertexBuff...
public void OnCreateDevice(object sender, EventArgs e)
{
Device dev = (Device)sender;
vertexBuffer = new VertexBuffer(typeof(CustomVertex.TransformedColored), 18, dev, 0, CustomVertex.TransformedColored.Format, Pool.Default);
vertexBuffer.Created += new System.EventHandler(this.OnCreateVertexBuffer); //有问题??
this.OnCreateVertexBuffer(vertexBuffer, null);
}
public void OnCreateVertexBuffer(object sender, EventHandler e)
{
CustomVertex.TransformedColored[] verts = (CustomVertex.TransformedColored[])vertexBuffer.Lock(0,0);
verts[0].Position = new Vector4(100f, 50f, 0f, 1f);
verts[0].Color = Color.Red.ToArgb(); 展开
{
Device dev = (Device)sender;
vertexBuffer = new VertexBuffer(typeof(CustomVertex.TransformedColored), 18, dev, 0, CustomVertex.TransformedColored.Format, Pool.Default);
vertexBuffer.Created += new System.EventHandler(this.OnCreateVertexBuffer); //有问题??
this.OnCreateVertexBuffer(vertexBuffer, null);
}
public void OnCreateVertexBuffer(object sender, EventHandler e)
{
CustomVertex.TransformedColored[] verts = (CustomVertex.TransformedColored[])vertexBuffer.Lock(0,0);
verts[0].Position = new Vector4(100f, 50f, 0f, 1f);
verts[0].Color = Color.Red.ToArgb(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询