MrGobliN Posted April 23, 2012 at 09:36 PM Report #450997 Posted April 23, 2012 at 09:36 PM Bom Dia/Noite Pessoal. 😄 Depois de ficar maravilhado com o jogo do seuqram, fui ver as vídeo aulas dele (já tinha algumas noções de c++), e testei este código mas da me um erro e não percebo pk? diz que a variável não foi declarada [Ajuda Pff] Código: #include<allegro.h> int main() { allegro_init(); install_keyboard(); set_color_depth(32); set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0,0); allegro_message("Bem-Vindo ao Programa"); while(!Key[KEY_ESC]){ rect(screen,0,200,1000,200,makecol(210,341,98)); circle(screen,200,100,50,makecol(200,23,100)); } } END_OF_MAIN();
HappyHippyHippo Posted April 23, 2012 at 09:39 PM Report #450998 Posted April 23, 2012 at 09:39 PM é por essas e por outras que não gosto do allegro .... A única variável que encontro no código é a Key IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
bsccara Posted April 23, 2012 at 11:24 PM Report #451029 Posted April 23, 2012 at 11:24 PM Se consultares a documentação (http://alleg.sourceforge.net/stabledocs/en/alleg013.html#rect) verás que nas linhas 'rect(screen...' e 'circle(screen...' o parâmetro 'screen' refere-se ao que deveria ser um ponteiro para um BITMAP, que não é criado.
seuqram Posted April 24, 2012 at 10:05 PM Report #451253 Posted April 24, 2012 at 10:05 PM não, tas errado! :nono1: o ponteiro screen é automaticamente criado por allegro_init(); o erro está no Key, terás de metelo para key (k minusculo) while(!Key[KEY_ESC]) -> while(!key[KEY_ESC]) espero ter ajudado 😉
bsccara Posted April 25, 2012 at 12:01 AM Report #451280 Posted April 25, 2012 at 12:01 AM não, tas errado! :nono1: o ponteiro screen é automaticamente criado por allegro_init(); Não vou insistir, muito, porque tens feito umas coisas com a biblioteca e eu limito-me a ler a documentação (v 4.4.0) mas a mesma diz : Macro which initialises the Allegro library. This is the same thing as calling install_allegro(SYSTEM_AUTODETECT, &errno, atexit). e int install_allegro(int system_id, int *errno_ptr, int (*atexit_ptr)()); Não vejo onde é declarada alguma variável daquele tipo, mas enfim...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now