Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Drawing Operations Not Working

This thread is locked; no one can reply to it. rss feed Print
Drawing Operations Not Working
AlejandroRM
Member #21,513
October 2021

Hello! I'm a Allegro newbie and not enough experienced C++ programmer having a problem. I want to develop a spaceships videogame but when I try to do things like loading images outside the main.cpp, everything "works" but when I try to draw them, nothing happens or the program crashes and exits with code 1.

DanielH
Member #934
January 2001
avatar

1st rule is to post some code. There are numerous reasons this could happen.

Chris Katko
Member #1,881
January 2002
avatar

I'd bet you:

1) you're not loading files after setting up allegro and creating a display.

or

2) you're not checking if bitmaps are NULL after al_load_bitmap which means it's likely failing because you have the path wrong.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Poured gasoline on engine. Still not working. Gonna have a cigarette.

Checklist :
1) Do you know what 'extern' keyword does?

2) Are you making copies (shallow) copies of objects?

3) What do you mean not working. Not compiling? Not linking? Not running?

4) Have you checked return values of functions that could fail?

5) As they said, did you create your bitmaps after calling al_init?

6) What was the return value of al_load_bitmap?

Go to: