return &yagl_gles_context_get_active_texture_unit(ctx)->target_states[texture_target];
}
+void yagl_gles_context_active_texture_set_enabled(struct yagl_gles_context *ctx,
+ yagl_gles_texture_target texture_target, bool enabled)
+{
+ struct yagl_gles_texture_target_state *texture_target_state;
+
+ texture_target_state =
+ yagl_gles_context_get_active_texture_target_state(ctx,
+ texture_target);
+ texture_target_state->enabled = enabled;
+}
+
void yagl_gles_context_bind_texture(struct yagl_gles_context *ctx,
yagl_gles_texture_target texture_target,
struct yagl_gles_texture *texture,
*yagl_gles_context_get_active_texture_target_state(struct yagl_gles_context *ctx,
yagl_gles_texture_target texture_target);
+void yagl_gles_context_active_texture_set_enabled(struct yagl_gles_context *ctx,
+ yagl_gles_texture_target texture_target, bool enabled);
+
void yagl_gles_context_bind_texture(struct yagl_gles_context *ctx,
yagl_gles_texture_target texture_target,
struct yagl_gles_texture *texture,
/*
* For GLESv1 only. In GLESv2 2D texture and cubemap textures cannot be
- * enabled/disabled.
+ * enabled/disabled. Currently not used.
*/
bool enabled;
};
bool yagl_host_glDisable(GLenum cap)
{
- YAGL_GET_CTX(glEnable);
+ YAGL_GET_CTX(glDisable);
ctx->driver->Disable(cap);
+ if (cap == GL_TEXTURE_2D) {
+ yagl_gles_context_active_texture_set_enabled(ctx,
+ yagl_gles_texture_target_2d, false);
+ }
+
return true;
}
ctx->driver->Enable(cap);
+ if (cap == GL_TEXTURE_2D) {
+ yagl_gles_context_active_texture_set_enabled(ctx,
+ yagl_gles_texture_target_2d, true);
+ }
+
return true;
}