Jump to content
  • Advertisement
Sign in to follow this  
Mesut

[SlimDX] RenderToSurface line disappearing problem

This topic is 3248 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have some problems with RenderToSurface when I try to draw axes with lines. If I use simple mesh for axes then everything is normal. If I use line for axes then lines disappear when rotating or zooming. There is no error in debug output. I changed viewport, view and proj matrixes but no improvement. Axes with mesh: Axes with lines: I don't know what causes this problem so I am sending only code that I used to render into surface. One other thing is that when I set color black in device.clear call then nothing appears.
 public void RenderIntoSurface(Matrix World)
        {
            view = new Viewport();
            view.Width = RenderSurfaceSize;
            view.Height = RenderSurfaceSize;
            view.MaxZ = 1;
            view.MinZ = 0;
            view.X = 0;
            view.Y = 0;
            
            rts.BeginScene(renderSurface, view);
            device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, color, 1.0f, 0);
            device.SetTransform(TransformState.World, World);
            foreach (IDrawObject DO in surfaceDrawObjects)
            {
                if (DO != null)
                {
                    DO.Draw(World);//lines or meshes are drawn with this call.
                }
            }
            rts.EndScene(Filter.None);
        }

Share this post


Link to post
Share on other sites
Advertisement
I used device.StretchRectangle instead of RenderToSurface and Sprite class but nothing changed. Does that mean we can't draw transformed lines on surfaces with line class?

Note: Same problem occurs in managed directx too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!