locked
WinJS window composition with natively (winRT) rendered frame RRS feed

  • Question

  • Hi,
    I have a JS metro application (game like) that uses winRT component to render a frame. THe problem is that the content of the frame is not seen in winJS window.

    How to make sure that what is rendered by native component is composed with winJS window content?


    I have these methods on native side exposed to JS:

    void init()

    {

    Windows::UI::Core::CoreWindow^ window = Windows::UI::Core::CoreWindow::GetForCurrentThread( );

    init_d3d( window );

    }

    void draw( ){ }





    • Edited by Vladbph Tuesday, May 15, 2012 10:08 PM
    Tuesday, May 15, 2012 10:06 PM

Answers

  • Hi Vlad,

    You cannot write directly to a window.  Rendering in an HTML/JavaScript app is handled by the HTML rendering engine.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, May 16, 2012 1:23 PM
    Moderator
  • You are correct on both points, the Windows does get painted but the render engine will plop over top of it.

    It would be nice to have a special frame area you could define to write into!  I would not expect to see this anytime soon however.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, May 17, 2012 2:26 PM
    Moderator

All replies

  • Hi Vlad,

    You cannot write directly to a window.  Rendering in an HTML/JavaScript app is handled by the HTML rendering engine.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, May 16, 2012 1:23 PM
    Moderator
  • Hi Jeff,

    IMO it is a huge limitation...in comparison to other platforms... I would assume you could have a compositor after HTML rendering engine that can do that. 

    Thanks

    Vlad

    P.S. The interesting thing is that I actually can see my content in winJS window for a fraction of a second when switching back and forth between studio and my application... meaning that I'm using correct CoreWindow handle, but then html rendrerer overwrites it...

    Wednesday, May 16, 2012 4:50 PM
  • You are correct on both points, the Windows does get painted but the render engine will plop over top of it.

    It would be nice to have a special frame area you could define to write into!  I would not expect to see this anytime soon however.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, May 17, 2012 2:26 PM
    Moderator