So my code relying on glDrawPixels breaks when using GLFW. What is the best alternative? I'm basically wanting to read the framebuffer, make some changes to it, then write back to the framebuffer.
glDrawPixels alternative
Once you read it to uchar buffer you could glTexSubImage2D it
https://sites.google.com/site/customprog/
pcmaster said:
Can you do your changes in a shader instead? ?
Probably the idea is to prototype shaders with comfort of CPU and C++? And then port to shader when done?
… wonderful idea i've never had! :D
I'm halfway there LOL. I have it reading the framebuffer to a vector<GLubyte>, now I just have to do the opposite – i'm assuming that this will take a fullscreen quad to do the job.
There are different ways, depending on what you're up to, from directly writing to it or a renderbuffer over blitting to atomic operations. The documentation has all the details.
taby said:
So my code relying on glDrawPixels breaks when using GLFW. What is the best alternative? I'm basically wanting to read the framebuffer, make some changes to it, then write back to the framebuffer.
What exactly are you trying to do? Reading back anything from the GPU, changing it, then using it in the same frame is generally terrible for performance. Using shaders sounds like a much better way.
I'm reading the framebuffer, altering it using OpenCV, then trying to write it back to the framebuffer.
I've tried glFramebufferTexture2D. Am I close?