Package panamagl.platform.windows
Class FBO_windows
java.lang.Object
panamagl.offscreen.AFBO
panamagl.platform.windows.FBO_windows
- All Implemented Interfaces:
panamagl.offscreen.FBO
public class FBO_windows
extends panamagl.offscreen.AFBO
implements panamagl.offscreen.FBO
A frame buffer object, or
FBO_windows, can render OpenGL into an offscreen buffer that can later
be converted to an Image.
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)
Hint : to debug this class, invoke a program using it with flag -Dpanamagl.offscreen.FBO
NB : the implementation intentionnaly uses linux extension loader because
the windows one could not be found in the generated bindings.- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected intprotected ArenaMemory arena to load OpenGL extension.protected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected MemorySegmentprotected intFields 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) Allocate memory segments required to perform offscreen rendering using the frame buffer object, unless resource have already been prepared.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 -
arrayExport
protected boolean arrayExport -
classArena
Memory arena to load OpenGL extension. Will live until this class dies. -
glGenFramebuffers
-
glBindFramebuffer
-
glFramebufferTexture2D
-
glGenRenderbuffers
-
glBindRenderbuffer
-
glRenderbufferStorage
-
glFramebufferRenderbuffer
-
glCheckFramebufferStatus
-
glDeleteRenderbuffers
-
glDeleteFramebuffers
-
-
Constructor Details
-
FBO_windows
public FBO_windows() -
FBO_windows
public FBO_windows(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) Allocate memory segments required to perform offscreen rendering using the frame buffer object, unless resource have already been prepared. All memory segments are freed by callingrelease(GL).- 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()
-