Finally, I integrate regal gl into emscripten. You should call
RegalMakeCurrent((RegalSystemContext)1); to associate emscripten gl context
with regal gl context. Like this:

    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(width, height);
    glutCreateWindow("app");

    RegalMakeCurrent((RegalSystemContext)1);

    glutDisplayFunc(draw);

Now in logs I see that regal gl do the job, it is rendering the game
scenes. However, I don`t see anything, I think it is because this errors:

    [.Offscreen-For-WebGL-0x3d6b0c429c00]GL ERROR :GL_INVALID_OPERATION :
glDrawElements: attempt to access out of range vertices in attribute 0

Also regal report about non supported features:

    warning  | Regal does not support glClientActiveTexture for ES 2.0 -
skipping.
    warning  | glDisable does not support GL_POINT_SPRITE for ES 2.0.
    warning  | Regal does not support glClientActiveTexture for ES 2.0 -
skipping.

More over I build myproject+regal in native enviroment in force ES2.0 mode,
and I see many graphical artifacts in rendering.

Regarding to emscripten docs:

    You can consider building the codebase against the Regal Desktop OpenGL
emulation library. That project offers a more complete set of emulated
Desktop OpenGL features on top of OpenGL ES 2.0.

I think that this statement is incorrect, built-in LEGACY_GL_EMULATION is
much better that emulation from regal. At least it works.


2017-01-26 15:26 GMT+03:00 caiiiycuk <[email protected]>:

> Ok, I found where problem is. Regal should be compiled to emscripten with
> special options, I use this command:
>
> emmake make -f Makefile SYSTEM=emscripten
>
> After that, in lib folder of Regal you can find static libs for
> emscripten. This libs contains rgl* methods that replace original opengl
> api. So, I add GL/Regal.h and compile my project again. Project was builded
> without any error. But when I run it in browser I does not see anything,
> just black screen and no errors. This project renders graphics correctly
> without regal on LEGACY_GL_EMULATION=1, so I think that project code is
> fine and problem is in integration of regal into emscripten.
>
> I try to use all flags LEGACY_GL_EMULATION=1 | FULL_ES2=1 | FULL_ES3 = 1
> results are same - black screen. Funny thing that Regal use
>  LEGACY_GL_EMULATION=1 to build itself. I can`t understand how I can found
> where problem is. Any ideas?
>
> Also I try to build project without linking Regal libs, only with headers,
> and when I run program then I have this errors:
>
> xception thrown: ReferenceError: GL is not defined,ReferenceError: GL is
> not defined
>     at Object.createContext
>     at _glutCreateWindow
>     at Object._main
>     at Object.callMain
>     at doRun
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
С уважением, Гурьянов Александр

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to