Created
July 18, 2017 18:26
-
-
Save EgorBo/df1b17a4bbb698b60bf7b410df7ec6d4 to your computer and use it in GitHub Desktop.
load image.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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