Skip to content

WebGL and Typed Arrays Support #14

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

Merged
merged 2 commits into from
Mar 31, 2014
Merged

WebGL and Typed Arrays Support #14

merged 2 commits into from
Mar 31, 2014

Conversation

mseddon
Copy link
Contributor

@mseddon mseddon commented Mar 23, 2014

This is a cleaned up, squashed version of #13 adjusted according to suggestions kindly provided by @sjrd.

@sjrd
Copy link
Member

sjrd commented Mar 23, 2014

GitHub tip: you don't need to close a pull request for this. You can simply force-push to the branch used for the PR, and the PR on GitHub will automatically update. It is better than reopening a new PR because comments are kept and correlated with the new commits for lines that have not changed.


object WebGLRenderingContext extends js.Object {
/* ClearBufferMask */
val DEPTH_BUFFER_BIT = 0x00000100
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In hindsight, maybe actually providing the defined constant is not such a great idea.
The upshot is maybe the minified code would be smaller, and fwiw scalac can probably constant-fold or'd constants but perhaps these should just be = ??? instead.
Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make them = ???. They can still be val's (but they need an explicit type!)
(As you wrote it, the actual constant is ignored by the compiler.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, good to know!

@lihaoyi
Copy link
Contributor

lihaoyi commented Mar 23, 2014

Unfortunately, I've lost the code I used to do the original scraping. It was somewhere around 150 lines, so not particularly difficult, as CLASS.METHOD maps to https://developer.mozilla.org/en-US/docs/Web/API/CLASS/METHOD pretty cleanly and after that it's just using JSoup to guess which paragraph is the one you want.

However, given the sparsity of MDN docs for the various webgl classes and functions, it may be worth just going through and C&Ping the ones you can find. It seems tedious, but if you sit down for an hour and a half and just do it I bet you could get through almost everything.

Whatever you do, download the MDN doc bundle locally to open in your browser, because MDN itself is as slow as a three legged dog.

@mseddon
Copy link
Contributor Author

mseddon commented Mar 23, 2014

@sjrd ah, that's handy, I cringed as I closed it for that reason :)
@lihaoyi Ok, well, that's good enough. I shall attempt something along those lines.

@mseddon
Copy link
Contributor Author

mseddon commented Mar 23, 2014

Update: The Mozilla documentation is quite poor for WebGL (possibly not helped by the number of places the spec just links directly to the OpenGL ES 2.0 spec rather than give a definition itself), so I've opted to write them myself. Not a fun task, but at least there can be a brief one liner for every method this way.

@lihaoyi
Copy link
Contributor

lihaoyi commented Mar 25, 2014

Looks good to me =) Have you tried it out locally? Just want to make sure that the stuff at least kind of works before we merge it

@mseddon
Copy link
Contributor Author

mseddon commented Mar 25, 2014

It appears to work for me, but I'm happy to hold off a proper merge until I've had some time to test it over the weekend. I've not really used it much yet- so that should flush out any really silly things I may have done.

@lihaoyi
Copy link
Contributor

lihaoyi commented Mar 26, 2014

Cool, you should be able to just publishLocal it for now, and it'll be a pretty seamless switch when we do end up merging it. Just remove the locally-published version from your .sbt/.ivy2 folder and it'll pick up the published-from-github version

@mseddon
Copy link
Contributor Author

mseddon commented Mar 31, 2014

I've had a chance to get a few simple hello worldy examples working, (testing out array buffers, getting things actually on the screen, compiling shaders, etc.) No issues so far. Love to have a bit more time to play with it, but hey ho. Maybe good to go with a big disclaimer of bleeding edge?

@lihaoyi
Copy link
Contributor

lihaoyi commented Mar 31, 2014

K cool, I say merge it first and fix it later then =)

lihaoyi added a commit that referenced this pull request Mar 31, 2014
WebGL and Typed Arrays Support
@lihaoyi lihaoyi merged commit 79f8b65 into scala-js:master Mar 31, 2014
@mseddon
Copy link
Contributor Author

mseddon commented Mar 31, 2014

👍

@lihaoyi
Copy link
Contributor

lihaoyi commented Mar 31, 2014

Feel free to send PRs for stuff that's broken; I don't expect that the
initial code dump was perfect =P With this kind of wrapper code there's no
real solution other than just fixing stuff as you find them.

On Mon, Mar 31, 2014 at 1:09 PM, mseddon notifications@github.com wrote:

[image: 👍]

Reply to this email directly or view it on GitHubhttps://github.com//pull/14#issuecomment-39135038
.

@mseddon
Copy link
Contributor Author

mseddon commented Mar 31, 2014

Absolutely, will do! I fully intend to use it quite a bit, but unfortunately I lack the time at the moment. There will at least be one user of this part of the library at some point, however :)

@mseddon mseddon mentioned this pull request Sep 1, 2015
Visbone pushed a commit to Visbone/scala-js-dom that referenced this pull request Mar 18, 2021
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.

3 participants