Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have the following code to render to a texture:

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();

 

It's crashing on creation of the texture. Is there another option other than the bitmap creation?

 

Thanks.

 

-Nick

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...