Kode Forum

  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  1. Home
  2. romamik
  3. Best
  • More Toggle Dropdown
    • Flag Profile
    • Block User
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
  • Profile
  • R
    romamik

    I've created something. It's not finished, but you can look at it here:
    https://github.com/romamik/Kha/tree/_image_fromFileBytes
    https://github.com/romamik/Kore/tree/_kha_imageFromFileBytes

    I've added function

    Image.fromFileBytes(bytes: Bytes, fileExtention: String, doneCallback: Image -> Void, errorCallback: String->Void, readable:Bool = false)
    

    It currently works good for flash and html5.

    It also works for Kore, but there is no error checking at all for now. So if there is bad data application crashes. I will handle this, at least for cases where stbi_load_from_memory is used.

    Also the way I've done this in Kore feels a bit hacky: to create Texture from memory buffer one needs to call Image::setNullFilenameData and then create Texture suppling null instead of filename. That is because from one side Texture's constructor receives filename from the other side it has different implementations for different backends, and I currently do not want to write code that is not common for all backends. It can be refactored so that Texture's constructor receive Reader, not filename, but this involves changes and thus testing for every backend, which I can't handle.

    posted in Kode • read more
  • R
    romamik

    Before the update is ready, it is possible to use previous version of Android Studio: http://tools.android.com/download/studio/builds/1-5-2

    I also found that everything works only with JDK 1.7, not 1.8. http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

    posted in Kode • read more