}
if (data_ && (size > 0)) {
- data = g_malloc(size);
+ data = yagl_gles_context_malloc(ctx, size);
if (!yagl_mem_get(ts,
data_,
size,
yagl_gles_buffer_set_data(buffer_obj, size, data, usage);
out:
- g_free(data);
yagl_gles_buffer_release(buffer_obj);
}
goto out;
}
- data = g_malloc(size);
+ data = yagl_gles_context_malloc(ctx, size);
if (!yagl_mem_get(ts,
data_,
size,
}
out:
- g_free(data);
yagl_gles_buffer_release(buffer_obj);
}
YAGL_GET_CTX(glCompressedTexImage2D);
if (data_ && (imageSize > 0)) {
- data = g_malloc(imageSize);
+ data = yagl_gles_context_malloc(ctx, imageSize);
if (!yagl_mem_get(ts,
data_,
imageSize,
data);
out:
- g_free(data);
+ (void)0;
}
void yagl_host_glCompressedTexSubImage2D(GLenum target,
YAGL_GET_CTX(glCompressedTexSubImage2D);
if (data_ && (imageSize > 0)) {
- data = g_malloc(imageSize);
+ data = yagl_gles_context_malloc(ctx, imageSize);
if (!yagl_mem_get(ts,
data_,
imageSize,
data);
out:
- g_free(data);
+ (void)0;
}
void yagl_host_glCopyTexImage2D(GLenum target,
goto out;
}
- buffer_names = g_malloc0(n * sizeof(*buffer_names));
+ buffer_names = yagl_gles_context_malloc0(ctx, n * sizeof(*buffer_names));
if (buffers_) {
if (!yagl_mem_get(ts,
}
out:
- g_free(buffer_names);
+ (void)0;
}
void yagl_host_glDeleteTextures(GLsizei n,
goto out;
}
- texture_names = g_malloc0(n * sizeof(*texture_names));
+ texture_names = yagl_gles_context_malloc0(ctx, n * sizeof(*texture_names));
if (textures_) {
if (!yagl_mem_get(ts,
}
out:
- g_free(texture_names);
+ (void)0;
}
void yagl_host_glDepthFunc(GLenum func)
}
if (indices_) {
- indices = g_malloc(index_size * count);
+ indices = yagl_gles_context_malloc0(ctx, index_size * count);
if (!yagl_mem_get(ts,
indices_,
index_size * count,
GL_ELEMENT_ARRAY_BUFFER,
old_buffer_name);
}
- g_free(indices);
}
void yagl_host_glEnable(GLenum cap)
goto out;
}
- params = g_malloc0(count * sizeof(*params));
+ params = yagl_gles_context_malloc0(ctx, count * sizeof(*params));
if (!ctx->get_booleanv(ctx, pname, params)) {
GLint param;
}
out:
- g_free(params);
+ (void)0;
}
void yagl_host_glGetBufferParameteriv(GLenum target,
goto out;
}
- params = g_malloc0(count * sizeof(*params));
+ params = yagl_gles_context_malloc0(ctx, count * sizeof(*params));
if (!ctx->get_floatv(ctx, pname, params)) {
GLint param;
}
out:
- g_free(params);
+ (void)0;
}
void yagl_host_glGetIntegerv(GLenum pname,
goto out;
}
- params = g_malloc0(count * sizeof(*params));
+ params = yagl_gles_context_malloc0(ctx, count * sizeof(*params));
if (!ctx->get_integerv(ctx, pname, params)) {
if (!yagl_get_integer(ctx, pname, params)) {
}
out:
- g_free(params);
+ (void)0;
}
void yagl_host_glGetTexParameterfv(GLenum target,
YAGL_SET_ERR(GL_INVALID_VALUE);
goto out;
}
- pixels = g_malloc(stride * height);
+ pixels = yagl_gles_context_malloc(ctx, stride * height);
if (!yagl_mem_get(ts,
pixels_,
stride * height,
pixels);
out:
- g_free(pixels);
+ (void)0;
}
void yagl_host_glTexParameterf(GLenum target,
YAGL_SET_ERR(GL_INVALID_VALUE);
goto out;
}
- pixels = g_malloc(stride * height);
+ pixels = yagl_gles_context_malloc(ctx, stride * height);
if (!yagl_mem_get(ts,
pixels_,
stride * height,
pixels);
out:
- g_free(pixels);
+ (void)0;
}
void yagl_host_glViewport(GLint x,
goto out;
}
- framebuffer_names = g_malloc0(n * sizeof(*framebuffer_names));
+ framebuffer_names = yagl_gles_context_malloc0(&ctx->base, n * sizeof(*framebuffer_names));
if (framebuffers_) {
if (!yagl_mem_get(gles2_api_ts->ts,
}
out:
- g_free(framebuffer_names);
+ (void)0;
}
void yagl_host_glDeleteProgram(GLuint program)
goto out;
}
- renderbuffer_names = g_malloc0(n * sizeof(*renderbuffer_names));
+ renderbuffer_names = yagl_gles_context_malloc0(&ctx->base, n * sizeof(*renderbuffer_names));
if (renderbuffers_) {
if (!yagl_mem_get(gles2_api_ts->ts,
}
out:
- g_free(renderbuffer_names);
+ (void)0;
}
void yagl_host_glDeleteShader(GLuint shader)
}
if (bufsize > 0) {
- name = g_malloc(bufsize);
+ name = yagl_gles_context_malloc(&ctx->base, bufsize);
}
yagl_gles2_program_get_active_attrib(program_obj,
}
out:
- g_free(name);
yagl_gles2_program_release(program_obj);
}
}
if (bufsize > 0) {
- name = g_malloc(bufsize);
+ name = yagl_gles_context_malloc(&ctx->base, bufsize);
}
yagl_gles2_program_get_active_uniform(program_obj,
}
out:
- g_free(name);
yagl_gles2_program_release(program_obj);
}
goto out;
}
- params = g_malloc0(count * sizeof(*params));
+ params = yagl_gles_context_malloc0(&ctx->base, count * sizeof(*params));
switch (pname) {
case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
}
out:
- g_free(params);
+ (void)0;
}
void yagl_host_glGetVertexAttribPointerv(GLuint index,
YAGL_GET_CTX(glUniform1fv);
if (v_) {
- v = g_malloc(count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
count * sizeof(*v),
ctx->driver_ps->Uniform1fv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform1i(GLint location,
YAGL_GET_CTX(glUniform1iv);
if (v_) {
- v = g_malloc(count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
count * sizeof(*v),
ctx->driver_ps->Uniform1iv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform2f(GLint location,
YAGL_GET_CTX(glUniform2fv);
if (v_) {
- v = g_malloc(2 * count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, 2 * count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
2 * count * sizeof(*v),
ctx->driver_ps->Uniform2fv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform2i(GLint location,
YAGL_GET_CTX(glUniform2iv);
if (v_) {
- v = g_malloc(2 * count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, 2 * count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
2 * count * sizeof(*v),
ctx->driver_ps->Uniform2iv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform3f(GLint location,
YAGL_GET_CTX(glUniform3fv);
if (v_) {
- v = g_malloc(3 * count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, 3 * count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
3 * count * sizeof(*v),
ctx->driver_ps->Uniform3fv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform3i(GLint location,
YAGL_GET_CTX(glUniform3iv);
if (v_) {
- v = g_malloc(3 * count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, 3 * count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
3 * count * sizeof(*v),
ctx->driver_ps->Uniform3iv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform4f(GLint location,
YAGL_GET_CTX(glUniform4fv);
if (v_) {
- v = g_malloc(4 * count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, 4 * count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
4 * count * sizeof(*v),
ctx->driver_ps->Uniform4fv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniform4i(GLint location,
YAGL_GET_CTX(glUniform4iv);
if (v_) {
- v = g_malloc(4 * count * sizeof(*v));
+ v = yagl_gles_context_malloc(&ctx->base, 4 * count * sizeof(*v));
if (!yagl_mem_get(gles2_api_ts->ts,
v_,
4 * count * sizeof(*v),
ctx->driver_ps->Uniform4iv(ctx->driver_ps, location, count, v);
out:
- g_free(v);
+ (void)0;
}
void yagl_host_glUniformMatrix2fv(GLint location,
YAGL_GET_CTX(glUniformMatrix2fv);
if (value_) {
- value = g_malloc(2 * 2 * count * sizeof(*value));
+ value = yagl_gles_context_malloc(&ctx->base, 2 * 2 * count * sizeof(*value));
if (!yagl_mem_get(gles2_api_ts->ts,
value_,
2 * 2 * count * sizeof(*value),
ctx->driver_ps->UniformMatrix2fv(ctx->driver_ps, location, count, transpose, value);
out:
- g_free(value);
+ (void)0;
}
void yagl_host_glUniformMatrix3fv(GLint location,
YAGL_GET_CTX(glUniformMatrix3fv);
if (value_) {
- value = g_malloc(3 * 3 * count * sizeof(*value));
+ value = yagl_gles_context_malloc(&ctx->base, 3 * 3 * count * sizeof(*value));
if (!yagl_mem_get(gles2_api_ts->ts,
value_,
3 * 3 * count * sizeof(*value),
ctx->driver_ps->UniformMatrix3fv(ctx->driver_ps, location, count, transpose, value);
out:
- g_free(value);
+ (void)0;
}
void yagl_host_glUniformMatrix4fv(GLint location,
YAGL_GET_CTX(glUniformMatrix4fv);
if (value_) {
- value = g_malloc(4 * 4 * count * sizeof(*value));
+ value = yagl_gles_context_malloc(&ctx->base, 4 * 4 * count * sizeof(*value));
if (!yagl_mem_get(gles2_api_ts->ts,
value_,
4 * 4 * count * sizeof(*value),
ctx->driver_ps->UniformMatrix4fv(ctx->driver_ps, location, count, transpose, value);
out:
- g_free(value);
+ (void)0;
}
void yagl_host_glUseProgram(GLuint program)