YAGL_LOG_WARN("NOT IMPLEMENTED!!!"); \
return true
+/*
+ * We can't include GLES2/gl2ext.h here
+ */
+#define GL_HALF_FLOAT_OES 0x8D61
+
+static GLenum yagl_get_actual_type(GLenum type)
+{
+ switch (type) {
+ case GL_HALF_FLOAT_OES:
+ return GL_HALF_FLOAT;
+ default:
+ return type;
+ }
+}
+
static GLint yagl_get_stride(struct yagl_gles_context *ctx,
GLuint alignment_type,
GLsizei width,
if (!ctx->pack_depth_stencil) {
return GL_INVALID_ENUM;
}
+ if ((type == GL_FLOAT) || (type == GL_HALF_FLOAT_OES)) {
+ return GL_INVALID_OPERATION;
+ }
num_components = 1;
break;
case GL_DEPTH_COMPONENT:
- if (type != GL_UNSIGNED_SHORT && type != GL_UNSIGNED_INT) {
+ if ((type != GL_UNSIGNED_SHORT) && (type != GL_UNSIGNED_INT)) {
return GL_INVALID_OPERATION;
}
num_components = 1;
}
bpp = num_components * 4;
break;
+ case GL_FLOAT:
+ bpp = num_components * 4;
+ break;
+ case GL_HALF_FLOAT_OES:
+ bpp = num_components * 2;
+ break;
default:
return GL_INVALID_ENUM;
}
yagl_object_name current_pbo = 0;
GLvoid *pixels = NULL;
GLsizei stride = 0;
+ GLenum actual_type = yagl_get_actual_type(type);
YAGL_GET_CTX(glReadPixels);
width,
height,
format,
- type,
+ actual_type,
pixels);
if (current_pbo != 0) {
bool res = true;
GLvoid *pixels = NULL;
GLsizei stride = 0;
+ GLenum actual_type = yagl_get_actual_type(type);
YAGL_GET_CTX(glTexImage2D);
height,
border,
format,
- type,
+ actual_type,
pixels);
out:
bool res = true;
GLvoid *pixels = NULL;
GLsizei stride = 0;
+ GLenum actual_type = yagl_get_actual_type(type);
YAGL_GET_CTX(glTexSubImage2D);
width,
height,
format,
- type,
+ actual_type,
pixels);
if (format == GL_ALPHA) {