2

I'm looking for an example of loading a png-file on MonoDroid using OpenTK. Anyone?

Thanks!

Andreas
  • 5,501
  • 2
  • 20
  • 23

1 Answers1

2

Put TexLib into your code and do the following:

  1. save the texture into your Assets folder and give it the Build Action "AndroidAsset"
  2. Add the following function to the TexLib.cs:

    public static int CreateTextureFromStream (InputStream stream)
     {
         return CreateTextureFromBitmap (new Bitmap (Bitmap.FromStream (stream)));
     }
    
  3. Call the function with your asset:

    int textureId = TexUtil.CreateTextureFromStream (Assets.Open ("my_texture.png"));
    
Rodja
  • 7,998
  • 8
  • 48
  • 55