• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

A small module to load raw image data for Desktop, Android and iOS.

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
1,146
Had a bit of time to spare, so I knocked up a module to load image data into a data structure.
Instructions in the attached zip.

Updated to include Android.
Updated to include iOS.

I would suggest keeping an eye on the amount of memory being used.
 

Attachments

  • imageload.zip
    9.2 KB · Views: 77
Last edited:
Well done dawlane.

Jimmy, I think that repository contains nothing regarding Android, only the title. Besides that, GLFW is mainly a Window handler, so I fail to see the usage in porting it to a mobile platform. But the authors millage may vary.
 
@MikeHart Just realised that the glfw, android and ios target modules have public image loaders in the BBGame class. They just need to be wrapped to get the image data back in a Cerberus Array. I'll probably have a look at the weekend.
 
Looking forward to that, nice progress!
 
Just realised that the glfw, android and ios target modules have public image loaders in the BBGame class. They just need to be wrapped to get the image data back in a Cerberus Array. I'll probably have a look at the weekend.
OK. Update.
Trying to wrap that code isn't going to be easy. So I've stuck to keeping the loading in the module depending on the target.

I've updated the first post to include an updated module, with name changes and Android support.
On Android you are pretty much at the mercy of when it's garbage collector decided to free memory.
 
This is really nice examples how to make native extensions! Much appreciated!
 
I've updated the first post to include an updated module, with iOS support.
 
Nice! Is it possible to save using the same technique on iOS?
 
Nice! Is it possible to save using the same technique on iOS?
No. Different method.
Search for converting byte array to UIImage and Save UIImage to file.
 
I don't have any ios device to try on yet but thanks for the tip

First I need to riddle out common support API 30 on Android that will take a few weeks I guess. This time it seems like they settle down for what API to use, which is nice.
 
I will only use API 30's MediaStore and Intents on Android to make it easier and more user-friendly.
A general file access would be nice of course so might look into that as well.
 
Back
Top Bottom