Top Description Fields Constructors Methods
org.lwjgl.test.opencl.gl

public Class DemoFractal

extends Object
Class Inheritance
Imports
org.lwjgl.BufferUtils, .LWJGLException, .PointerBuffer, org.lwjgl.input.Keyboard, .Mouse, org.lwjgl.opencl.*, org.lwjgl.opencl.api.Filter, org.lwjgl.opengl.*, org.lwjgl.util.Color, .ReadableColor, java.io.*, java.net.URL, java.nio.ByteBuffer, .IntBuffer, java.util.HashSet, .List, .Set

Computes the Mandelbrot set with OpenCL using multiple GPUs and renders the result with OpenGL. A shared PBO is used as storage for the fractal image.
http://en.wikipedia.org/wiki/Mandelbrot_set

controls:
keys 1-9 control parallelism level
space enables/disables slice seperator
'd' toggles between 32/64bit floatingpoint precision
mouse/mousewheel to drag and zoom
'Home' to reset the viewport

Author
Michael Bien, Spasi

Field Summary

Modifier and TypeField and Description
private boolean
private CLContext
private CLEvent[]
private GLSync[]
private static final int
private CLMem[]
private int
private boolean
private boolean
private double
private double
private double
private double
private double
private double
private boolean
private int
private CLMem[]
private CLEvent
private IntBuffer
private GLSync
private int
private final PointerBuffer
private CLKernel[]
private static final int
private int
private double
private double
private double
private double
private int
private int
private Set<String>
private int
private CLProgram[]
private CLCommandQueue[]
private boolean
private boolean
private int
private final PointerBuffer
private boolean
private boolean
private boolean
private int
private int

Constructor Summary

AccessConstructor and Description
public
DemoFractal(final String[] args)

Method Summary

Modifier and TypeMethod and Description
private void
private void
compute(final boolean is64bit)

private void
public void
private String
private void
public void
init()

private void
initCL(Drawable drawable)

private static void
initColorMap(IntBuffer colorMap, int stepSize, ReadableColor... colors)

private void
private static void
initView(int width, int height)

private static boolean
public static void
main(String[] args)

private void
private void
run()

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buffersInitializedback to summary
private boolean buffersInitialized
clContextback to summary
private CLContext clContext
clEventsback to summary
private CLEvent[] clEvents
clSyncsback to summary
private GLSync[] clSyncs
COLOR_MAP_SIZEback to summary
private static final int COLOR_MAP_SIZE
colorMapback to summary
private CLMem[] colorMap
dlistback to summary
private int dlist
doublePrecisionback to summary
private boolean doublePrecision
draggingback to summary
private boolean dragging
dragMaxXback to summary
private double dragMaxX
dragMaxYback to summary
private double dragMaxY
dragMinXback to summary
private double dragMinX
dragMinYback to summary
private double dragMinY
dragXback to summary
private double dragX
dragYback to summary
private double dragY
drawSeparatorback to summary
private boolean drawSeparator
fshback to summary
private int fsh
glBuffersback to summary
private CLMem[] glBuffers
glEventback to summary
private CLEvent glEvent
glIDsback to summary
private IntBuffer glIDs
glSyncback to summary
private GLSync glSync
heightback to summary
private int height
kernel2DGlobalWorkSizeback to summary
private final PointerBuffer kernel2DGlobalWorkSize
kernelsback to summary
private CLKernel[] kernels
MAX_PARALLELISM_LEVELback to summary
private static final int MAX_PARALLELISM_LEVEL
maxIterationsback to summary
private int maxIterations
maxXback to summary
private double maxX
maxYback to summary
private double maxY
minXback to summary
private double minX
minYback to summary
private double minY
mouseXback to summary
private int mouseX
mouseYback to summary
private int mouseY
paramsback to summary
private Set<String> params
programback to summary
private int program
programsback to summary
private CLProgram[] programs
queuesback to summary
private CLCommandQueue[] queues
rebuildback to summary
private boolean rebuild
runback to summary
private boolean run
slicesback to summary
private int slices
syncBufferback to summary
private final PointerBuffer syncBuffer
syncCLtoGLback to summary
private boolean syncCLtoGL
syncGLtoCLback to summary
private boolean syncGLtoCL
useTexturesback to summary
private boolean useTextures
vshback to summary
private int vsh
widthback to summary
private int width

Constructor Detail

DemoFractalback to summary
public DemoFractal(final String[] args)

Method Detail

buildProgramsback to summary
private void buildPrograms()
computeback to summary
private void compute(final boolean is64bit)
createProgramsback to summary
private void createPrograms() throws IOException
displayback to summary
public void display()
getProgramSourceback to summary
private String getProgramSource(final String file) throws IOException
handleIOback to summary
private void handleIO()
initback to summary
public void init()
initCLback to summary
private void initCL(Drawable drawable) throws Exception
initColorMapback to summary
private static void initColorMap(IntBuffer colorMap, int stepSize, ReadableColor... colors)
initGLObjectsback to summary
private void initGLObjects()
initViewback to summary
private static void initView(int width, int height)
isDoubleFPAvailableback to summary
private static boolean isDoubleFPAvailable(CLDevice device)
mainback to summary
public static void main(String[] args)
renderback to summary
private void render()
runback to summary
private void run()
setKernelConstantsback to summary
private void setKernelConstants()