[SDL] I don't know use a algorit for line
avcp-sdlmail at usa.net
Sun Nov 20 15:10:24 PST 2005
> I have a source code with an algorit for a line, but when
> a try use it the program say: Fatal signal: Segmentation Fault
> (SDL Parachute Deployed) always
Your code that draws the line states
However, the diblinea() algorithm draws a line to (x1,y1) inclusively, so it
tries to draw a pixel at (640,480) which is invalid. The actual screen
coordinates in your program range 0..639 for X and 0..479 for Y.
Thus you get a segfault when trying to access non-existent screen address
(beyond allocated range).
More information about the SDL