Jump to content

Recommended Posts

Posted

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();
Posted

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 😉

Posted

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...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.