Example #1
0
 private Cursor(GLFW.GLFW.Cursor cursor)
 {
     _image  = new GLFW.GLFW.Image();
     _cursor = cursor;
     HotX    = 0;
     HotY    = 0;
 }
Example #2
0
        /// <summary>
        /// Load an image and use it as a cursor.
        /// </summary>
        /// <param name="image">The path to the image.</param>
        public void FromImage(string image)
        {
            ImageImporter importer = new ImageImporter();
            Image         img      = importer.LoadImage(image);

            importer.Dispose();

            img.Bind();
            _image.Width  = img.Width;
            _image.Height = img.Height;
            _image.Pixels = IL.CopyPixels(0, 0, 0, img.Width, img.Height, 1, DataFormat.BGRA, DataType.UnsignedByte);
            img.Unbind();

            img.Dispose();

            _cursor = GLFW.GLFW.CreateCursor(_image, HotX, HotY);
        }