Skip to content
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

Managed to build glshim for android #4

Closed
tobimensch opened this issue May 21, 2016 · 13 comments
Closed

Managed to build glshim for android #4

tobimensch opened this issue May 21, 2016 · 13 comments

Comments

@tobimensch
Copy link

Then most of the undefined reference gl* errors went away when linking except for these:

error: undefined reference to 'glEnableVertexAttribArray'
error: undefined reference to 'glVertexAttribPointer'
error: undefined reference to 'glDisableVertexAttribArray'

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

You are trying to link something that need OpenGL 2.0 functions. glshim only support OpenGL up to 1.5 for now.

What are you trying to compile?

@tobimensch
Copy link
Author

I looked it up and the functions seem to be part of glesv2.

I'm porting a small game to Android.

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

Yes, there are part of GLESv2, but the glesv2 backend of glshim is not working. I plan to work on that, but much later. The GLESv2 part should not be activated.
The link error is during link of glshim or link of your game?

@tobimensch
Copy link
Author

tobimensch commented May 21, 2016

the link error is during linking of the game!

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

This game is probably not compatible with glshim for now, it need GL 2+ functions that are not available.

@tobimensch
Copy link
Author

Isn't all the glshim needs to do to forward those calls to openglesv2?

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

Yes and no.
If the game use a GLES2 compatible context, then yes (but in that case, you probably don't need glshim and can just link with libGLESv2.so).
GLSL langage between full GL and GLESv2 are different (not much, but still GLSL 1.0 from ES is a subsample of GL v1.20). Plus all fixed pipeline function should be emulated with GLES2 functions.
So, for most game, no, it's not that simple.

@tobimensch
Copy link
Author

I can't just link with libGLESv2.so, because then I get many many more undefined references when linking.
Linking with with glshim eliminates almost all of these link errors except for these 3 functions above. I think the game is overwhelmingly opengl1.x and very little opengl2.0.

@tobimensch
Copy link
Author

Here's a little information about those functions and what they are used for:

http://www.gamedev.net/topic/655785-is-glenablevertexattribarray-redundant/

Quote:
"Much of this is legacy from the old fixed pipeline (glEnable/DisableVertexAttribArray were modelled on glEnable/DisableClientState and first appeared in GL_ARB_vertex_program roundabout OpenGL 1.5: the older calls go back to 1.1) and dates to a time when you might be mixing vertex array drawing with immediate mode drawing. So you'd use vertex arrays for your complex meshes and maybe glBegin/glEnd for your 2D GUI."

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

If there is little to no GL 2.0, you can do the other way then.
Create some dumys function yourself for those 3 function with;

void glEnableVertexAttribArray(GLuint index) { }
void glDisableVertexAttribArray(GLuint index); { }
void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) { }

Put that in some C sources of your game (better not put it in glshim itself).
and it should link. Chance are it will not behave correctly if those functions are really used.

@tobimensch
Copy link
Author

Unfortunately they are really used. :-(

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

Is your game opensource (if yes, which one is it)? I can try to hack some kind of support for that, but I'm not sure I undestood how it really works / what is the expected behavour of thoses functions.

@ptitSeb
Copy link
Owner

ptitSeb commented May 21, 2016

It doesn't make much sense to have this function in fixed pipeline mode. I will probably close that ticket for now.

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

No branches or pull requests

2 participants