Package panamagl.platform.macos
Class FBO_macOS
java.lang.Object
panamagl.offscreen.AFBO
panamagl.platform.macos.FBO_macOS
- All Implemented Interfaces:
panamagl.offscreen.FBO
public class FBO_macOS
extends panamagl.offscreen.AFBO
implements panamagl.offscreen.FBO
A frame buffer object, or
FBO_macOS, can render OpenGL into an offscreen buffer that can later
be converted to a BufferedImage.
See : https://www.khronos.org/opengl/wiki/Framebuffer_Object
https://www.khronos.org/opengl/wiki/Common_Mistakes
https://www.khronos.org/opengl/wiki/Framebuffer_Object_Extension_Examples#Quick_example,_render_to_texture_(2D)
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_offscreen/opengl_offscreen.html
Hint : to debug this class, invoke a program using it with flag -Dopengl.fbo.FBO- Author:
- Martin Pernollet
-
Field Summary
FieldsFields inherited from class panamagl.offscreen.AFBO
auto, debug, format, frameBufferIds, height, idFrameBuffer, idRenderBuffer, idTexture, internalFormat, pixelBuffer, pixels, prepared, renderArena, renderBufferIds, textureBufferIds, textureType, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidinit()Initialize pointers to OpenGL extensions allowing to perform offscreen renderingvoidprepare(panamagl.opengl.GL gl) Prepare resources held by this FBO utility.readPixels(panamagl.opengl.GL gl) Return all pixels.voidrelease(panamagl.opengl.GL gl) Release resources held by this FBO utility.protected voidMethods inherited from class panamagl.offscreen.AFBO
diagnoseError, getHeight, getWidth, isPrepared, prepareRenderArena, releaseRenderArena, resizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface panamagl.offscreen.FBO
getHeight, getWidth, isPrepared, resize
-
Field Details
-
level
protected int level -
border
protected int border -
channels
protected int channels
-
-
Constructor Details
-
FBO_macOS
public FBO_macOS() -
FBO_macOS
public FBO_macOS(int width, int height)
-
-
Method Details
-
init
protected void init()Initialize pointers to OpenGL extensions allowing to perform offscreen rendering -
prepare
public void prepare(panamagl.opengl.GL gl) Prepare resources held by this FBO utility.- Specified by:
preparein interfacepanamagl.offscreen.FBO
-
release
public void release(panamagl.opengl.GL gl) Release resources held by this FBO utility.- Specified by:
releasein interfacepanamagl.offscreen.FBO
-
readPixels
Return all pixels. Their lifetime is bounded to theAFBO.renderArena.- Specified by:
readPixelsin interfacepanamagl.offscreen.FBO
-
unbindFramebuffer
protected void unbindFramebuffer()
-