Hi,

Where you are saying that im using 3.2? Because of this?

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);

I tried put 3/0, 2/0, 2/2. But the problems is exactly the same.

I don't understand why its happen.

Thanks.


On Thursday, January 24, 2019 at 9:29:34 PM UTC-2, Floh wrote:
>
> Ah... check out the answer I wrote in the ImGui github issue thread.
>
> I think there's 2 problems:
>
> You're telling SDL to create a 3.2 Core Profile GL context, which is a 
> desktop GL version. You'd need to find out what the emscripten SDL port 
> does in that case (it looks like it is not creating a WebGL2 context but a 
> WebGL1 context), even than it's not guaranteed that all GL 3.2 API calls 
> translate to WebGL2 (which is GLES 3.0), so some code changes may be 
> necessary.
>
> Second problem is that your shader code is for 3.2 Core Profile GL, this 
> won't work in WebGL or WebGL2, the shader code needs to be rewritten to be 
> GLES2 or GLES3 compatible.
>
> So basically, the C code and shader code needs to be ported to GLES3.0 
> (shader code being more important because that's definitely not translated 
> by the emscripten GL wrapper, the C code may be taken care of by 
> emscripten's "desktop GL emulation", as long as you can convince SDL to 
> create a WebGL2 context).
>
> Cheers!
>
> On Thursday, 24 January 2019 21:46:00 UTC+1, Paulo Coutinho wrote:
>>
>> Hi,
>>
>> After try a lot i don't have other option instead of put here. I think 
>> imgui dont work nativelly with emscripten or im doing something wrong.
>>
>>
>> I tried use opengl2 and opengl3 but both generate error with emscripten.
>>
>>
>> Im trying to use opengl3 at least, and when i run, i got:
>>
>>
>> [image: image] 
>> <https://user-images.githubusercontent.com/395096/51707233-d57b5380-2007-11e9-9d53-1628c439dee7.png>
>>
>>
>> I don't know how to solve it. I tried a lot of params in emscripten 
>> compiler, but nothing. I tried the forum on google groups, but nothing.
>>
>>
>> My source code:
>>
>> https://github.com/ezored/sample-wasm/blob/imgui/source/local/dependency-app/build/source/cpp/canvas/main.cpp
>>
>>
>> Without imgui it is working here:
>> http://public.ezored.com/sample-wasm/wasm-canvas/Release/index.html
>>
>>
>>
>> Thanks for any help.
>>
>>
>>
>> On Thursday, January 17, 2019 at 3:41:00 PM UTC-2, Paulo Coutinho wrote:
>>>
>>> Hi,
>>>
>>> Im trying make an example of using imgui inside a sample of my tool 
>>> ezored (http://www.ezored.com) with emscripten.
>>>
>>> Im using emscripten 1.38.22, sdl2, opengl2 and this imgui example as 
>>> reference:
>>>
>>> https://github.com/ocornut/imgui/blob/master/examples/example_sdl_opengl2/main.cpp
>>>
>>> But i have some problems. 
>>>
>>>
>>>    1. What i really need for imgui and sdl2 and wasm? I put some TODOs 
>>>    because my project is working with that TODO lines, 
>>> "SDL_GL_SetAttribute", 
>>>    "SDL_GL_SwapWindow", and other marked with TODO. If anyone can help me 
>>> the 
>>>    main.cpp file is here:
>>>    
>>>    
>>> https://github.com/ezored/sample-wasm/blob/imgui/source/local/dependency-app/build/source/cpp/canvas/main.cpp
>>>    
>>>    Only need search for "TODO: WE NEED IT FOR WASM?".
>>>    
>>>    My working example without these specific opengl functions is here:
>>>    http://public.ezored.com/sample-wasm/    (CANVAS EXAMPLE)
>>>    
>>>    2. Based on my main.cpp file im getting compilation error:
>>>    
>>>    error: undefined symbol: glColorPointer
>>>    
>>>    warning: To disable errors for undefined symbols use `-s 
>>>    ERROR_ON_UNDEFINED_SYMBOLS=0`
>>>    
>>>    error: undefined symbol: glDisableClientState
>>>    
>>>    error: undefined symbol: glEnableClientState
>>>    
>>>    error: undefined symbol: glOrtho
>>>    
>>>    error: undefined symbol: glPolygonMode
>>>    
>>>    error: undefined symbol: glPopAttrib
>>>    
>>>    error: undefined symbol: glPopMatrix
>>>    
>>>    error: undefined symbol: glPushAttrib
>>>    
>>>    error: undefined symbol: glPushMatrix
>>>    
>>>    error: undefined symbol: glTexCoordPointer
>>>    
>>>    Error: Aborting compilation due to previous errors
>>>    
>>>    shared:ERROR: '/Users/paulo/Developer/emsdk/node/8.9.1_64bit/bin/node 
>>>    /Users/paulo/Developer/emsdk/emscripten/1.38.22/src/compiler.js 
>>>    /tmp/tmpBF_WjX.txt 
>>>    
>>> /Users/paulo/Developer/emsdk/emscripten/1.38.22/src/library_pthread_stub.js'
>>>  
>>>    failed (1)
>>>    
>>>
>>> Can anyone help me finish this example?
>>>
>>> Thanks.
>>>
>>

-- 
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