Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

SL - XNA bridge? RSS

22 replies

Last post Nov 13, 2010 12:09 PM by pmonteil

(0)
  • pmonteil

    pmonteil

    Member

    104 Points

    71 Posts

    SL - XNA bridge?

    Mar 17, 2010 08:51 AM | LINK

    WM7's support for SL and XNA is great, but is it possible to bridge the two technologies by,
    for example, performing XNA rendering to a bitmap and have that bitmap reflected in the SL UI?

    Since both the iPhone and Android SDKs provide an access to a 3D rendering engine, OpenGL,
    a similar capability is _required_ on WM7 IMO.

    BTW, an access to the graphic portion of the XNA framework on all versions of SL would be _very_ appreciated :-)!

    Philippe Monteil
    Paris - France

     

     

  • doobiwan

    doobiwan

    Member

    22 Points

    10 Posts

    Re: SL - XNA bridge?

    Mar 17, 2010 03:26 PM | LINK

     I agree, but could we do it the other way? Can we get XNA to support XAML? That way we can do awesome scalable graphics in Blend.

  • bykinag

    bykinag

    Participant

    1049 Points

    312 Posts

    Re: SL - XNA bridge?

    Mar 17, 2010 03:31 PM | LINK

    Alexander G. Bykin
    ►MCP: Silverlight Developer
    ►(If I answered your question, please click on "mark as answer" on this post. Thank you!)
  • akaza

    akaza

    Member

    24 Points

    7 Posts

    Re: SL - XNA bridge?

    Mar 18, 2010 05:31 AM | LINK

    At this point we do not support XNA and SL in the same page. It was something we considered but could not get to because of timing issues. But definitely something on our list :) for the future.

  • pmonteil

    pmonteil

    Member

    104 Points

    71 Posts

    Re: SL - XNA bridge?

    Mar 18, 2010 08:22 AM | LINK

    Thanks for your answer.

    IMO, the ability to map a XNA render target to a SL bitmap would be a first and already satisfying bridge between XNA and SL,
    and shouldn't be very difficult to implement...


  • Tuska

    Tuska

    Member

    33 Points

    15 Posts

    Re: SL - XNA bridge?

    Mar 19, 2010 11:00 AM | LINK

    Here is a sample how to render XNA content into Silverlight WriteableBitmap:

    http://www.uta.fi/~tp79800/Silverlight/WindowsPhoneApplicationXNA.zip
  • pmonteil

    pmonteil

    Member

    104 Points

    71 Posts

    Re: SL - XNA bridge?

    Mar 19, 2010 11:39 AM | LINK

    thanks a lot for the sample!

    I see that the transfer between the XNA target and the WriteableBitmap is done like this

                 target.GetData<Color>(colors);

                for (int i = 0; i < 800*480; i++)
                {
                    bitmap.Pixels[i] = colors[i].B + (colors[i].G << 8) + (colors[i].R << 16) + (colors[i].A << 24);
                }

                bitmap.Invalidate();

    It runs nicely in the emulator but I would be curious to see how it performs on a real phone.

    A hardware based, high speed native method transfering the content of an XNA target to a SL bitmap
    would be sufficient to bridge the two technologies: please MS :-)!

     

  • akaza

    akaza

    Member

    24 Points

    7 Posts

    Re: SL - XNA bridge?

    Mar 19, 2010 05:08 PM | LINK

    There are a few issues with this approach:

    1. The speed of what you are trying to do on a mobile device will not be as smooth as you want it to be.

    2. Input will be an interesting problem

    3. There is also stablity risk in cross pollinating technologies in this manner.

    In general just transferring bits is not adequate, there is also sharing the underlying graphics subsystem and such that has to be considered for robustness. In the long term we hope to solve this problem but for now its not in the current release.

  • pmonteil

    pmonteil

    Member

    104 Points

    71 Posts

    Re: SL - XNA bridge?

    Mar 19, 2010 05:46 PM | LINK

     <<1. The speed of what you are trying to do on a mobile device will not be as smooth as you want it to be.
    Thats is why I suggested to provide an optimized way of transferring the data between an XNA target and a SL
    WriteableBitmap, or to define a new type of ImageSource mapping an XNA target directly...

    I am not sure that I understand the points 2. and 3.

    You mention a 'long term' solution, but the problem is that both the iPhone and Android SDKs offer an access to
    a 3d rendering engine. WP7 is a very interesting platform, but I would like it to offer us at least the same capabilities
    as its competitors.

     

     

  • pmonteil

    pmonteil

    Member

    104 Points

    71 Posts

    Re: Re: SL - XNA bridge?

    Sep 12, 2010 09:51 AM | LINK

    Has anyone been able to test the following sample

    http://www.uta.fi/~tp79800/Silverlight/WindowsPhoneApplicationXNA.zip

    demonstrating a method of bridging XNA and WP7/SL
    on a real device?


    Philippe