Kyra with SMPEG

Help
Chris C.
2006-04-10
2013-06-04
  • Chris C.

    Chris C. - 2006-04-10

    Hi,

    I'm trying to use SMPEG within a Kyra application, and without trying to work around Kyra and SDL, I thought the best way to do this might be to use a KrCanvas. I am trying to find a quick way to copy the SDL_Surface returned from SMPEG to the KrCanvasResource, but as of yet, I am running up against a brick wall.  Any ideas?

    Regards,
    Chris

     
    • Chris C.

      Chris C. - 2006-04-10

      just as a note I am able to copy it pixel by pixel (I'm getting 1 frame a sec give or take) with the following code:

      for ( int i=0; i < size; i++ )
      {       
        color.all = *((int*)surf->pixels + i ) + amask;
        *( canvas->Pixels() + i ) = color;
      }

       
    • Lee Thomason

      Lee Thomason - 2006-04-10

      Chris -

      I know nothing about SMPEG, but one idea is that you treat the Kyra surface as an SDL_Surface, by passing in the CanvasResource to:

      SDL_CreateRGBSurfaceFrom

      and then blit to it. (Making sure you call Refresh() on the resource after the blit)

      Would that work with SMPEG?
      lee

       
    • Chris C.

      Chris C. - 2006-04-11

      This works excellent.  Thanks for the help.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks