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

Add WebGL.Texture.loadBytesWith #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justgook
Copy link

@justgook justgook commented May 14, 2019

adding ability to create textures out of bytes, this is task less api, for future it will allow as create custom image / scene format loaders, create default texture without waiting for task.

        pixelBytes =
            List.repeat 2 (Bytes.unsignedInt32 Bytes.BE 0xFF0000FF)
                |> (++) (List.repeat 18 (Bytes.unsignedInt32 Bytes.BE 0xFFFF))
                |> Bytes.sequence
                |> Bytes.encode

        resultTexture =
            WebGL.loadBytesWith WebGL.nonPowerOfTwoOptions ( 2, 10 ) RGBA pixelBytes

@folkertdev
Copy link

folkertdev commented May 15, 2019

I think much of the js/Kernel code in this PR could be moved into pure elm without any performance cost. Having less kernel code might increase the chances of this PR getting accepted.

In particular, an elm implementation of getByteCount would not be slower than the current kernel version. Then all size/dimension validation could happen on the elm side, and the Kernel code only deals with the actual creation of the webgl texture from a Bytes.

@justgook justgook force-pushed the master branch 3 times, most recently from 5de8961 to e9e1c15 Compare May 15, 2019 11:53
@w0rm w0rm force-pushed the master branch 2 times, most recently from 90bf628 to ac4f736 Compare August 20, 2019 19:47
@Herteby
Copy link

Herteby commented Mar 4, 2020

Would be nice to have this merged, if the issues have been fixed 🙂

@w0rm
Copy link
Collaborator

w0rm commented Mar 4, 2020

@Herteby
Copy link

Herteby commented Mar 4, 2020

Oh I see, so Evan needs to approve anything beyond patches.

@w0rm
Copy link
Collaborator

w0rm commented Mar 4, 2020

@Herteby my understanding is that the same rules apply for this package, as for any other browser integrations and changes to the core elm packages.

Base automatically changed from master to main February 8, 2021 19:24
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

Successfully merging this pull request may close these issues.

5 participants