[AllegAVI] Uzywanie.
Ostatnio zmodyfikowano 2011-01-24 18:34
DejaVu |
» 2011-01-24 17:33:57 Czyli problem masz już rozwiązany? :) Klepnij ku pamięci jakimś sprawnym fragmentem kodu by zadowolić ewentualnych przyszłych odwiedzających ;p |
|
akwes Temat założony przez niniejszego użytkownika |
» 2011-01-24 18:34:37
#include <allegro.h> #include <winalleg.h> #include <allegavi.h>
void init(); void deinit() { clear_keybuf(); }
int main() { init(); BITMAP * buffer = create_system_bitmap( SCREEN_W, SCREEN_H ); AllegAVI film; film.Open( "film.avi" ); film.PlayStart_Direct(); while( !key[ KEY_ESC ] ) { if( !film.PlayStep( buffer, 0, - 20, true, false ) ) { film.PlayRestart(); film.PlayStep( buffer, 0, - 20, true, false ); } blit( buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H ); } film.PlayEnd(); film.Close(); destroy_bitmap( buffer ); return 0; } END_OF_MAIN()
void init() { int depth, res; allegro_init(); depth = desktop_color_depth(); if( depth == 0 ) depth = 32; set_color_depth( 32 ); res = set_gfx_mode( GFX_AUTODETECT_FULLSCREEN, 320, 240, 0, 0 ); if( res != 0 ) { allegro_message( allegro_error ); exit( - 1 ); } install_keyboard(); }
Taki sposób pozwala nam dodatkowo rysować co chcemy za filmem i przed filmem, odpowiednio edytując buffer, przed wyswietleniem klatki, lub po. Dziękuje za pomoc w rozwiązaniu problemu i pozdrawiam :D |
|
1 2 « 3 » |