Skip to content

Instantly share code, notes, and snippets.

@EgorBo
Created July 18, 2017 18:26
Show Gist options
  • Save EgorBo/df1b17a4bbb698b60bf7b410df7ec6d4 to your computer and use it in GitHub Desktop.
Save EgorBo/df1b17a4bbb698b60bf7b410df7ec6d4 to your computer and use it in GitHub Desktop.
load image.cs
byte[] imageBytes = ... //png,jpg, etc..
var image = new Image();
image.Load(new Urho.MemoryBuffer(imageBytes));
var texture = new Texture2D();
texture.SetData(image, true);
var material = new Material();
material.SetTechnique(0, CoreAssets.Techniques.Diff, 0, 0);
material.SetTexture(TextureUnit.Diffuse, texture);
myObj.SetMaterial(material);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment