Questions tagged [glreadpixels]

glReadPixels is an OpenGL API function to read pixels data from source framebuffer to destination memory buffer. When FBO is supported, the source could be FBO; when PBO is supported, the destination could be PBO.

200 questions
3
votes
1 answer

Drawing an OpenGL scene to C# bitmap; off-screen gets clipped

I draw a complex 2D scene to an OpenGL window. I would like the user to be able to take a screenshot of the scene and save it as a JPG. However, I would like them to be able to specify that the scene can be drawn bigger than their screen (which will…
XenoScholar
  • 187
  • 3
  • 10
3
votes
1 answer

OpenGL - Create video output file

I want to be able to use OpenGL to create a video output file instead of the usual display on screen output. I am thinking by not using glutPostRedisplay() or (SFML version, which is something like this:) window.Display(), and somehow using…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
3
votes
0 answers

iOS: render to and read from depthbuffer for offscreen processing

Problem My main goal is to get model coordinates for touches on the device, so to check what you've touched. Im working with a large model and have to draw many things, that also have to be touchable. To achieve this I know two possible ways: On one…
patte
  • 191
  • 3
  • 5
2
votes
0 answers

glReadPixels() in lwjgl makes prog crash

In a kind of light video game developped in Java using lwjgl I use glReadPixels() in order to get the object the user is aiming with the mouse (all the objects are associated with one color). It works fine on my Windows but the program crashes…
Aishuu
  • 21
  • 2
2
votes
4 answers

How can I save OpenGL draw with OpenGL?

I draw a screen with OpenGL commands. And I must save this screen to .bmp or .png format. But I can't do it. I am using glReadpixels but I can't do continue. How can I save this drawing in c++ with OpenGL?
golazo
  • 317
  • 5
  • 15
2
votes
1 answer

iOS 5 sms notification causes glreadpixels to crash

Our app uses glreadpixels to capture screen on every frame. On iOS 5 devices, when you receive a text message (or any other notification, I assume), the app crashes on the glreadpixels call. The crash only happens on iOS 5 with the new style of…
Tim Shi
  • 83
  • 6
2
votes
1 answer

android support better method than glreadpixels?

I'm making android game.(using andengine) I need to record game play screen . This is not for making promotion video, It is for game players to review their game play. My app should record video by itself. So I can't solve this problem using…
keonhong
  • 51
  • 1
  • 7
2
votes
1 answer

glReadPixel returns zeros and error 1282 (Android)

Here is my picking code public static void pick(GL11 gl){ int[] viewport = new int[4]; ByteBuffer pixel = ByteBuffer.allocateDirect(3).order(ByteOrder.nativeOrder()); mColourR = BaseObject.getColourR(); mColourG =…
Jack
  • 2,625
  • 5
  • 33
  • 56
2
votes
1 answer

Android OpenGL ES 2.0 -- glReadPixels() and glTexImage2D() drawing a black texture?

I'm working on some Android code for caching and redrawing a framebuffer object's color buffer between the loss and recreation of EGL contexts. Development is primarily happening on a Xoom tablet running Honeycomb. Anyway, what I'm trying to do…
2
votes
0 answers

OPENGL ES on iOS, glreadpixel doesn't work with BGRA format

On iOS device (I tried ipad1 and ipad2) glreadpixel works for the RGBA pixel format, but for BGRA pixel format it does not work. In the code below I use GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES to get the native pixel format, which is GL_BGRA_EXT,…
Tim
  • 21
  • 2
2
votes
2 answers

how to use glreadpixels with android -- usually get zeros

I'm trying to detect the opengl object under the cursor... I have read it referred to as picking. Here is my code: public int makeBuffer(GL10 gl, int x, int y) { ByteBuffer PixelBuffer = ByteBuffer.allocateDirect(4); …
D Liebman
  • 337
  • 1
  • 8
  • 17
2
votes
1 answer

OpenGL DSA equivalent for glReadPixels

I'm trying to retrieve a Pixel-value from a Renderbuffer attached to an unbound Framebuffer. Since I'm trying to avoid changing global state when reading said value I'm unable to use glReadPixels([...]) which would normally be used to read Pixels…
2
votes
2 answers

Problem reading data by glreadpixel() while using depth buffer and anti-aliasing technique

I want to capture the screen of my game using glreadpixel(). it works fine over simulator also on 2g iphone with ios version 3.1.1 . but on ipad with ios version 4.2.1 it doesnt . i came to know the issue regarding this. for ios version 4.0 above on…
Tornado
  • 1,069
  • 12
  • 28
2
votes
1 answer

OES_depth_texture and glReadPixels

The open gl es 2.0 extension, OES_depth_texture, enables writing of depth information to frame buffer with an attached texture. However, the spec not describe the usage of glReadPixels with such an extension. As far as I can tell glReadPixels will…
2
votes
2 answers

pass data between shader programs

Ok I'm going to keep this as simple as possible. I want to pass data between shader programs. I'm using readPixels currently to do that but I feel it may be slowing operations down and I'm exploring faster options. what my program does: program1…