I have the following code to render to a texture:
Its crashing on creation of the texture. Is there another option other than the bitmap creation?
Thanks.
-Nick
Code:
Bitmap bm=new Bitmap(512, 512);
Texture tex=new Texture(device,
bm,
Usage.RenderTarget,
Pool.Default);
device.SetRenderTarget(0, tex.GetSurfaceLevel(0));
device.Clear(ClearFlags.Target | ClearFlags.ZBuffer , Color.Blue, 1f, 0);
SetupCamera();
device.BeginScene();
Draw();
device.EndScene();
device.Present();
Its crashing on creation of the texture. Is there another option other than the bitmap creation?
Thanks.
-Nick