Hi everyone, it's my first post here.
The code above is supposed to draw lines between points "i" and "j" described by coordinates stored in "float" type vectors, f.e. pX[1] and pY[1] are coordinates of "Point 2".
Problem is, lines are not drawn, and I don't know, why. As a part of crude debugging, notifications of supposed drawings are saved in .txt file in pattern shown below. In result, I get properly filled file:
which means numerical input is all right. I get no errors nor warnings. It's not the first time this function is acting weird - not drawing when code seems to be all-OK. There's an possibility that I'm missing something little yet essential about the usage of this function, but right now, I'm clueless.
Ideas, anyone?
Full listing of fuction using this code : http://pastebin.com/JvsGVrTM
Did you initialize primitives? Also try substituting al_map_rgb_f(1.0,0.0,0.0) for red.
@Arthur - I've changed the drawing colour with your suggestion and it works! 
"red" was defined like this
ALLEGRO_COLOR red = al_map_rgb(255,0,0);
outside the functions in the file (as a file-global variable) and it worked in other functions, yet it failed here.
Care to explain, what is the difference in this case?
I would be really helpful for me, just to avoid mistakes like this one in the future. This one gave a lot of stress.
You can't call functions such as al_map_rgb() outside of main() or another function, I'd guess it loaded "red" with the address of al_map_rgb(). Try to find out how to increase the error reporting of your compiler.
Good old DevC++ does not report this as an error. Well, I'll be wiser now.
Thanks a lot!
Good old DevC++
IIRC, DevC++ uses MinGW and the gcc compiler, right? You can turn up the errors and warnings with
-O2 -Wall -Wextra
in the compiler options (whereever those are).
You're right, I'll try it.
You can't call functions such as al_map_rgb() outside of main() or another function, I'd guess it loaded "red" with the address of al_map_rgb(). Try to find out how to increase the error reporting of your compiler.
Calling functions outside of main like that is valid in C++.
However, it is not normally valid to call allegro functions before you've called al_init or after al_uninstall_system has been called. Many also don't like it if there isn't a current display or target bitmap. It's something that is easy to trip up on when using C++ "as normal".