K
K
Kirill Nesmeyanov2020-02-24 13:37:32
Windows
Kirill Nesmeyanov, 2020-02-24 13:37:32

How to make libGLESv2 friends with GLFW or SDL2?

I use GLFW and SDL2 (I tried two options, I thought there was a jamb in them) for rendering windows and I try to drag libGLESv2 to work with gl * functions (shaders and other tinsel). I cut everything in the form of libraries.

The Angle code itself is as follows:

glClearColor(0.0, 1.0, 0.0, 1.0); // green 1
glClear(0x00000100 | 0x00004000); // GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT


And here lies the problem itself:
1) If you use opengl32.dll, which is in system32, then everything is ok. The code is working, I get a green screen:
lnqi7qyp8rbaoggomdzqm-4jmby.png

2) If I use libGLESv2 (which is Google's angle), it doesn't work, I get a black screen on the primitive code:
a3ybmcjsccbxxi9mvn4mbqtdz2w.png

What I tried to do:
1) I tried to throw libGLESv2 into system32 (suddenly there are not enough rights?).
2) Tried to completely (successfully) recompile libGLESv2 from source.
3) I tried to tear it out of other programs (including from Google Chrome) - the same thing. Assembly is not the problem.
4) With the debugger of the studio, which allows you to get close to the finished process - I did not make friends. Hooking (breakpoint) on glClearColor function calls - doesn't help.

PS I would like any OpenGL wrapper (with cdecl calls) that allows you to assemble shaders. Alas, native opengl does not allow this, and GLEW stupidly does not work through FFI. So I settled on libGLESv2 because no alternatives found.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Nesmeyanov, 2020-04-16
@SerafimArts

The issue is resolved, the result:
_p5gzal9hsu3cujnndggguh2zfe.gif
In short, it was necessary to use native opengl, and the functions that are not enough to be loaded via wglGetProcAddress, so the function (for example) of compiling shaders looks like this:

$gl = ....;

$glCreateShader = $gl->cast('GLuint (*)(GLenum shaderType​)', $gl->wglGetProcAddress('glCreateShader'));

$glCreateShader(....);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question