Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a Janet equivalent for LoadImageFromMemory ? #63

Open
gamecubate opened this issue May 3, 2024 · 1 comment
Open

Is there a Janet equivalent for LoadImageFromMemory ? #63

gamecubate opened this issue May 3, 2024 · 1 comment

Comments

@gamecubate
Copy link
Contributor

Raylib's LoadImageFromMemory seems absent from Jaylib functions. Too complex to port or in the works? If neither, I'll take a look at it.

@kamisori
Copy link
Contributor

kamisori commented May 4, 2024

static Janet cfun_LoadImageFromBuffer(int32_t argc, Janet *argv) {
    janet_fixarity(argc, 2);
    const char *fileType = janet_getcstring(argv, 0);
    JanetBuffer* data = janet_getbuffer(argv, 1);
    Image *image = janet_abstract(&AT_Image, sizeof(Image));
    *image = LoadImageFromMemory(fileType, data->data, data->count);
    return janet_wrap_abstract(image);
}

c48b965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants