iOS/buildlibs/armv7/allegro-4.4.2/addons/allegrogl/src/videovtb.c
/* BITMAP *allegro_gl_create_video_bitmap(int w, int h) */
/** create_video_bitmap() overload.
  * This function will create a video bitmap using texture memory.
  * Video bitmaps do not currently share space with the frame buffer (screen).
  * Video bitmaps are lost when switching screen modes.
  */
BITMAP *allegro_gl_create_video_bitmap(int w, int h)
create_video_bitmap() overload.
This function will create a video bitmap using texture memory.
Video bitmaps do not currently share space with the frame buffer (screen).
Video bitmaps are lost when switching screen modes.
BITMAP * allegro_gl_create_video_bitmap ( int w int h ) create_video_bitmap () overload . This function will create a video bitmap using texture memory . Video bitmaps do not currently share space with the frame buffer ( screen ) . Video bitmaps are lost when switching screen modes .
BITMAP *allegro_gl_create_video_bitmap(int w, int h) {
	GFX_VTABLE *vtable;
	BITMAP *bitmap;
	bitmap = malloc(sizeof(BITMAP) + sizeof(char *));
	if (!bitmap)
		return NULL;
	bitmap->dat = NULL;
	bitmap->w = bitmap->cr = w;
	bitmap->h = bitmap->cb = h;
	bitmap->clip = TRUE;
	bitmap->cl = bitmap->ct = 0;
	bitmap->write_bank = bitmap->read_bank = NULL;
	bitmap->id = BMP_ID_VIDEO | video_bitmap_count;
	bitmap->extra = NULL;
	bitmap->x_ofs = 0;
	bitmap->y_ofs = 0;
	bitmap->seg = _default_ds();
	bitmap->line[0] = NULL;
	bitmap->vtable = NULL;
	if (!allegro_gl_make_video_bitmap(bitmap)) {
		return NULL;
	}
	video_bitmap_count++;
	vtable = malloc(sizeof(struct GFX_VTABLE));
	*vtable = allegro_gl_video_vtable;
	if (__allegro_gl_video_bitmap_bpp == -1) {
		vtable->color_depth = bitmap_color_depth(screen);
	}
	else {
		vtable->color_depth = __allegro_gl_video_bitmap_bpp;
	}
	switch (vtable->color_depth) {
		case 8:
			vtable->mask_color = MASK_COLOR_8;
		break;
		case 15:
			vtable->mask_color = MASK_COLOR_15;
		break;
		case 16:
			vtable->mask_color = MASK_COLOR_16;
		break;
		case 24:
			vtable->mask_color = MASK_COLOR_24;
		break;
		case 32:
			vtable->mask_color = MASK_COLOR_32;
		break;
	}
	bitmap->vtable = vtable;
	return bitmap;
}
BITMAP * allegro_gl_create_video_bitmap ( int w , int h ) { GFX_VTABLE * vtable ; BITMAP * bitmap ; bitmap = malloc ( sizeof ( BITMAP ) + sizeof ( char * ) ) ; if ( ! bitmap ) return NULL ; bitmap -> dat = NULL ; bitmap -> w = bitmap -> cr = w ; bitmap -> h = bitmap -> cb = h ; bitmap -> clip = TRUE ; bitmap -> cl = bitmap -> ct = 0 ; bitmap -> write_bank = bitmap -> read_bank = NULL ; bitmap -> id = BMP_ID_VIDEO | video_bitmap_count ; bitmap -> extra = NULL ; bitmap -> x_ofs = 0 ; bitmap -> y_ofs = 0 ; bitmap -> seg = _default_ds ( ) ; bitmap -> line [ 0 ] = NULL ; bitmap -> vtable = NULL ; if ( ! allegro_gl_make_video_bitmap ( bitmap ) ) { return NULL ; } video_bitmap_count ++ ; vtable = malloc ( sizeof ( struct GFX_VTABLE ) ) ; * vtable = allegro_gl_video_vtable ; if ( __allegro_gl_video_bitmap_bpp == -1 ) { vtable -> color_depth = bitmap_color_depth ( screen ) ; } else { vtable -> color_depth = __allegro_gl_video_bitmap_bpp ; } switch ( vtable -> color_depth ) { case 8 : vtable -> mask_color = MASK_COLOR_8 ; break ; case 15 : vtable -> mask_color = MASK_COLOR_15 ; break ; case 16 : vtable -> mask_color = MASK_COLOR_16 ; break ; case 24 : vtable -> mask_color = MASK_COLOR_24 ; break ; case 32 : vtable -> mask_color = MASK_COLOR_32 ; break ; } bitmap -> vtable = vtable ; return bitmap ; }
BITMAP *allegro_gl_create_video_bitmap(int w, int h)
create_video_bitmap() overload.
BITMAP * allegro_gl_create_video_bitmap ( int w int h ) create_video_bitmap () overload .
/* We should keep tracks of allocated bitmaps for the ref counter */ /* XXX <rohannessian> We ought to leave the Allegro values intact
	 * Avoids bad interaction with correct Allegro programs.
	 */