Exemplo n.º 1
0
 public GLFWImage(int width, int height, byte[] pixeldata)
 {
     if (pixeldata.Length != (width * height) * 4)
     {
         throw new ArgumentException($"Expected a pixel array of size {(width * height) * 4} but got {pixeldata.Length}. " +
                                     $"The pixels need to be 4 byte each. 1 byte per color channel (R,G,B,A). The pixeldata array needs to be width * height * 4 in length.");
     }
     Handle = Glfw_HelperFunctions.__CreateGlfwImage();
     Width  = width;
     Height = height;
     SetPixels(pixeldata);
 }