Yeah it should be possible. I have not looked at the default branch, I don't know how much changed. But it was really pretty minor.
The main changes I had to make (iirc) were
- Vertex array objects are an extension in opengles2. I assume that it is present, since I guess it usually is, but probably should check for it somehow.
- I didn't figure out about the compressed texture loading, I don't know if that is present, in my version I disabled it I think. Possibly it works? I don't know much about GLEW so I just commented out all that stuff...
- WebGL has some restrictions about using non-power of two textures. When I first started I only got a black screen and a bunch of these messages in console:
Code: Select all
Error: WebGL: A texture is going to be rendered as if it were black, as per the OpenGL ES 2.0.24 spec section 3.8.2, because it is a 2D texture, with a minification filter not requiring a mipmap, with its width or height not a power of two, and with a wrap mode different from CLAMP_TO_EDGE.
I put calls to this function at times when textures were being created, and that seemed to fix it.
Code: Select all
void OpenGLTexture::set_standard_tex_params()
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
- For a while I had sort of botched up headers because of difficulties getting the VAO extension to be defined, although actually I figured it out now... going to fix on the repo...
Code: Select all
#include <GLES2/gl2.h>
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2ext.h>
- I had to comment out the "blit_to_memory" function in Texture.cpp, which returns texture memory from opengl to the cpu, because that doesn't exist really in opengles2 as far as I know. There might be some work around?
http://stackoverflow.com/questions/3981 ... mbedded-plIt seems that this feature is not really needed by cegui, at least as far as I can tell. So I'm not sure if it's worth it to try to implement a workaround?
I don't think I had to change anything else really. Does default branch use any fancy blending / clamp modes incompatible with the above?