I want to read pixels of a bitmap in Allegro 5 and feed these on to a neural network for an AI playing a 2D game. The problem is that the method used must be fast and I couldn't find a method that is fast enough. I'm using a higher resolution bitmap working at 2.6 fps and a lower resolution bitmap at 12 fps.
I tried the function 'al_get_pixel' but this is way too slow. It would be even faster when I would write the frames to the hard disk and then read all the pixels seperately from disk. Of course I don't want to do this. I want to access the bitmap in the memory directly. Could it be that other functions only work in older versions of Allegro? I looked for 'line[y][x]' but this variable or function cannot be found in the Allegro unit (for Pascal). See code: bmp^.line[y][x] := color; I hope to find something similar to this code