support for many unimplemented gles functions

Added support for many unimplement OGL ES functions and fixed some bugs
related to handling 0/null values for some resources