target buffer for glReadPixels
I started writing botting library in C# based on image recognition. Was using gdi32 functions bitblt and getpixel, but this way i'm unable to read games rendered with openGl or directX if they are not visible on desktop. I assume my options to do so is either using specific openGl and directX functions or dwm thumbnails.
I'm currently unable to figure out how to bind frame buffer for reading pixels in openGl game. Assuming i should use glBindBuffer how do i get glenum of current frame of specified client?
I have read Brandon's opengl plugin tutorial and as far as i understand i could write my own opengl plugin and inject it into target process (i think it is what fraps do) to obtain desirable bitmaps, although i'm worried about detection and this method seems fairly complicated.
Maybe i should rather focus on dwm thumbnails method, but i'm afraid it will be less flexible and use more resources?
Or is there other better ways for obtaining bitmaps or pixels from openGl rendered game?
All information on this topic is really appreciated.