iOS/buildlibs/armv7/allegro-4.4.2/addons/allegrogl/src/glvtable.c
/* allegro_gl_drawing_mode (GFX_DRIVER vtable entry):
 * Sets the drawing mode. Same implementation to all GFX vtables.
 */
allegro_gl_drawing_mode (GFX_DRIVER vtable entry):
Sets the drawing mode. Same implementation to all GFX vtables.
allegro_gl_drawing_mode ( GFX_DRIVER vtable entry ) : Sets the drawing mode . Same implementation to all GFX vtables .
void allegro_gl_drawing_mode(void) {
	if (__agl_drawing_mode == _drawing_mode)
		return;
	switch (__agl_drawing_mode) {
		case DRAW_MODE_TRANS:
			glDisable(GL_BLEND);
		break;
		case DRAW_MODE_XOR:
			glDisable(GL_COLOR_LOGIC_OP);
		break;
		case DRAW_MODE_COPY_PATTERN:
			glDisable(GL_TEXTURE_2D);
			glBindTexture(GL_TEXTURE_2D, 0);
			if (__agl_owning_drawing_pattern_tex && __agl_drawing_pattern_tex)
				glDeleteTextures(1, &__agl_drawing_pattern_tex);
			__agl_drawing_pattern_tex = 0;
			__agl_drawing_pattern_bmp = 0;
		break;
	}
	__agl_drawing_mode = _drawing_mode;
	switch (_drawing_mode) {
		case DRAW_MODE_TRANS:
			glEnable(GL_BLEND);
		break;
		case DRAW_MODE_XOR:
			glEnable(GL_COLOR_LOGIC_OP);
			glLogicOp(GL_XOR);
		break;
		case DRAW_MODE_COPY_PATTERN:
			if (is_memory_bitmap(_drawing_pattern)) {
				__agl_drawing_pattern_tex =
									allegro_gl_make_texture(_drawing_pattern);
				__agl_drawing_pattern_bmp = _drawing_pattern;
				__agl_owning_drawing_pattern_tex = TRUE;
			}
			else if (is_video_bitmap(_drawing_pattern)) {
				AGL_VIDEO_BITMAP *bmp = _drawing_pattern->extra;
				__agl_drawing_pattern_tex = bmp->tex;
				__agl_drawing_pattern_bmp = bmp->memory_copy;
				__agl_owning_drawing_pattern_tex = FALSE;
			}
			glEnable(GL_TEXTURE_2D);
			glBindTexture(GL_TEXTURE_2D, __agl_drawing_pattern_tex);
			break;
	}
}
void allegro_gl_drawing_mode ( void ) { if ( __agl_drawing_mode == _drawing_mode ) return ; switch ( __agl_drawing_mode ) { case DRAW_MODE_TRANS : glDisable ( GL_BLEND ) ; break ; case DRAW_MODE_XOR : glDisable ( GL_COLOR_LOGIC_OP ) ; break ; case DRAW_MODE_COPY_PATTERN : glDisable ( GL_TEXTURE_2D ) ; glBindTexture ( GL_TEXTURE_2D , 0 ) ; if ( __agl_owning_drawing_pattern_tex && __agl_drawing_pattern_tex ) glDeleteTextures ( 1 , & __agl_drawing_pattern_tex ) ; __agl_drawing_pattern_tex = 0 ; __agl_drawing_pattern_bmp = 0 ; break ; } __agl_drawing_mode = _drawing_mode ; switch ( _drawing_mode ) { case DRAW_MODE_TRANS : glEnable ( GL_BLEND ) ; break ; case DRAW_MODE_XOR : glEnable ( GL_COLOR_LOGIC_OP ) ; glLogicOp ( GL_XOR ) ; break ; case DRAW_MODE_COPY_PATTERN : if ( is_memory_bitmap ( _drawing_pattern ) ) { __agl_drawing_pattern_tex = allegro_gl_make_texture ( _drawing_pattern ) ; __agl_drawing_pattern_bmp = _drawing_pattern ; __agl_owning_drawing_pattern_tex = TRUE ; } else if ( is_video_bitmap ( _drawing_pattern ) ) { AGL_VIDEO_BITMAP * bmp = _drawing_pattern -> extra ; __agl_drawing_pattern_tex = bmp -> tex ; __agl_drawing_pattern_bmp = bmp -> memory_copy ; __agl_owning_drawing_pattern_tex = FALSE ; } glEnable ( GL_TEXTURE_2D ) ; glBindTexture ( GL_TEXTURE_2D , __agl_drawing_pattern_tex ) ; break ; } }
allegro_gl_drawing_mode (GFX_DRIVER vtable entry):
 Sets the drawing mode.
allegro_gl_drawing_mode ( GFX_DRIVER vtable entry ) : Sets the drawing mode .