3 ms·
I just downloaded and installed the latest Minefield nightly. I enabled the single webgl option in about:config. Not a single one of the examples from http://t
by mr_luc 17y ago
I just downloaded and installed the latest Minefield nightly. I enabled the single webgl option in about:config.
Not a single one of the examples from http://trac.webkit.org/changeset/48330 http://trac.webkit.org/changeset/48330 are loading for me.
They all error with:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://trac.webkit.org/export/48330/trunk/WebCore/manual-tests/webgl/resources/utils3d.js http://trac.webkit.org/export/48330/trunk/WebCore/manual-tes... :: initWebGL :: line 19" data: no]
etc.
Anyone on here get it working?
- deleted 17y ago[deleted]
- gcb 17y agothe offending line is: var gl = canvas.getContext("webkit-3d"); I tried to change it to all the values I found on developer's blogs and even in the Painting the Web Oreily book. "3d", "-moz-webgl2.0", "webgl2.0", "webgl", "gl", "moz-gles11" All got me the same NS_ERROR_ILLEGAL_VALUE
- gcb 17y agotried to grep the source. but all I could find was // IID for the nsIRenderingContext interface // 37762dd8-8df0-48cd-a5d6-24573ffdb5b6 #define NS_IRENDERING_CONTEXT_IID \ { 0x37762dd8, 0x8df0, 0x48cd, \ { 0xa5, 0xd6, 0x24, 0x57, 0x3f, 0xfd, 0xb5, 0xb6 } } which does not mean anything to me. other example, that also do not work with minefield: http://www.c3dl.org/ http://www.c3dl.org/ Official word: https://wiki.mozilla.org/Canvas:3D https://wiki.mozilla.org/Canvas:3D
- mr_luc 17y agoDo their forums even work for you? I just got back, and I'm needing to look at the google cache of almost every mozilla forum page; I haven't gotten through to their forums a single time yet. Their 'search moz code' thingy still works -- searching it for WebGL turns up lots ... I mean LOTS ... of code. But even though I've found a list of enums for contexts, etc, I still haven't quite found where the mapping is, or where the actual base getcontext() function is located. I have powerful procrastination forces pushing me, though.
- mr_luc 17y agoWoot! Got Canvas3D to create a buffer! (I got distracted by NPR's telling of the ADM price-fixing story, sorry). Okay, the relevant/revelatory code can be seen at: http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLCanvasElement.cpp#441 http://mxr.mozilla.org/mozilla-central/source/content/html/c... Here's the string being constructed in the getContext method, after some checking: nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id="); ctxString.Append(ctxId); Where ctxId is, say, "2d". I'd assume it's some kind of resource naming convention or somesuch ... but, anyway, searching for strings "@mozilla.org/" and canvas and gl ... You get nsLayoutModule.cpp ... { "Canvas WebGL Rendering Context", NS_CANVASRENDERINGCONTEXTWEBGL_CID, "@mozilla.org/content/canvas-rendering-context;1?id=moz-webgl", CreateCanvasRenderingContextWebGL }, ... bingo! "moz-webgl" WORKS. The first example I tried fails: gl.clearDepth is not a function. :( But, anyway, it's a start.
- mastersenbie 17y agoTry using "for in" to iterate through the returned canvas's properties. You'll get all the methods of the canvas. So far this sort of stuff works (OSX Leopard): gl.clearColor(0,0,0,0); gl.clear(gl.COLOR_BUFFER_BIT);