Hi all, I'm having a problem: al_draw_pixel is too slow . What I want to do is draw each pixel in the screen according to a number I decide.
For example, I fill a list of X elements (X is equal to the total amount of pixels in my screen) with some random numbers. Then, what I do is drawing each element on a pixel in a bitmap according to their number (for example, element 1 have a 144 number, so I'll put a pixel in position 1 with the color r,g,b = 144,144,144 ) and I will do that with all the elemts in my list. Finally, I draw that bitmap into my screen buffer.
The function I mentioned before is too slow to do it, it takes around 10 seconds in a 1920x1080 screen. I have tried to lock the bitmap for writeonly, but it's still incredible slow. I've been browsing around the internet and saw that you can use "direct adressing" to write directly in the bitmap and it's a fast method to do pixel by pixel operations, but I haven't been able to implement it in my Allegro 5 program . Can anybody please help me with this?
(I'm just an english student, so please forgive some grammar errors I could have )