Top Description Inners Fields Constructors Methods
org.lwjgl.test.opengl.sprites

public final Class SpriteShootoutCL

extends Object
Class Inheritance
Imports
org.lwjgl.BufferUtils, .LWJGLException, .PointerBuffer, .Sys, org.lwjgl.input.Keyboard, .Mouse, org.lwjgl.opencl.*, org.lwjgl.opencl.api.Filter, org.lwjgl.opengl.ContextCapabilities, .Display, .DisplayMode, .GLContext, java.awt.image.BufferedImage, .Raster, java.io.IOException, java.nio.ByteBuffer, .FloatBuffer, .IntBuffer, java.util.List, .Random, javax.imageio.ImageIO

Sprite rendering demo. In this version OpenCL is used for the animation computations. CL_KHR_gl_sharing is required for sharing the animation data with OpenGL for rendering.
Author
Spasi
Since
18/3/2011

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract class
private class

Field Summary

Modifier and TypeField and Description
private boolean
private static final int
private int
private int
private CLContext
private CLDevice
private CLMem
private boolean
private IntBuffer
private CLKernel
private PointerBuffer
private CLProgram
private CLCommandQueue
private boolean
private SpriteShootoutCL.SpriteRenderer
private boolean
private static final int
private static final int
private boolean
private int
private int
private int
private boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
private static int
createTexture(final String path)

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

private static byte
packUByte01(final float x)

private static ByteBuffer
private void
run()

private void
private static float
unpackUByte01(final byte x)

private void
updateBalls(final int count)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

animateback to summary
private boolean animate
ANIMATION_TICKSback to summary
private static final int ANIMATION_TICKS
ballCountback to summary
private int ballCount
ballSizeback to summary
private int ballSize
clContextback to summary
private CLContext clContext
clDeviceback to summary
private CLDevice clDevice
clTransformback to summary
private CLMem clTransform
colorMaskback to summary
private boolean colorMask
errorCodeback to summary
private IntBuffer errorCode
kernelback to summary
private CLKernel kernel
kernelGlobalWorkSizeback to summary
private PointerBuffer kernelGlobalWorkSize
programback to summary
private CLProgram program
queueback to summary
private CLCommandQueue queue
renderback to summary
private boolean render
rendererback to summary
private SpriteShootoutCL.SpriteRenderer renderer
runback to summary
private boolean run
SCREEN_HEIGHTback to summary
private static final int SCREEN_HEIGHT
SCREEN_WIDTHback to summary
private static final int SCREEN_WIDTH
smoothback to summary
private boolean smooth
texBigIDback to summary
private int texBigID
texIDback to summary
private int texID
texSmallIDback to summary
private int texSmallID
vsyncback to summary
private boolean vsync

Constructor Detail

SpriteShootoutCLback to summary
private SpriteShootoutCL()

Method Detail

checkCLErrorback to summary
private static void checkCLError(IntBuffer buffer)
createTextureback to summary
private static int createTexture(final String path) throws IOException
destroyback to summary
private void destroy()
handleInputback to summary
private void handleInput()
initCLback to summary
private void initCL() throws LWJGLException
initGLback to summary
private void initGL() throws LWJGLException
mainback to summary
public static void main(String[] args)
packUByte01back to summary
private static byte packUByte01(final float x)
readImageback to summary
private static ByteBuffer readImage(final BufferedImage img) throws IOException
runback to summary
private void run()
startback to summary
private void start() throws LWJGLException
unpackUByte01back to summary
private static float unpackUByte01(final byte x)
updateBallsback to summary
private void updateBalls(final int count)
org.lwjgl.test.opengl.sprites back to summary

private abstract Class SpriteShootoutCL.SpriteRenderer

extends Object
Class Inheritance
  • java.lang.Object
  • org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRenderer
Known Direct Subclasses
org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRendererDefault

Field Summary

Modifier and TypeField and Description
protected int
protected int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected void
createKernel(final String source)

protected void
createProgram(final int vshID)

protected abstract void
render(boolean render, boolean animate, int delta)

public void
updateBalls(final int count)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

animVBOback to summary
protected int animVBO
progIDback to summary
protected int progID

Constructor Detail

SpriteRendererback to summary
private SpriteRenderer()

Method Detail

createKernelback to summary
protected void createKernel(final String source)
createProgramback to summary
protected void createProgram(final int vshID)
renderback to summary
protected abstract void render(boolean render, boolean animate, int delta)
updateBallsback to summary
public void updateBalls(final int count)
updateBallSizeback to summary
public void updateBallSize()
org.lwjgl.test.opengl.sprites back to summary

private Class SpriteShootoutCL.SpriteRendererDefault

extends SpriteRenderer
Class Inheritance

Field Summary

Inherited from org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRenderer:
animVBOprogID

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
render(final boolean render, final boolean animate, final int delta)

Implements abstract org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRenderer.render.

public void
Inherited from org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRenderer:
createKernelcreateProgramupdateBallSize

Constructor Detail

SpriteRendererDefaultback to summary
pack-priv SpriteRendererDefault()

Method Detail

renderback to summary
public void render(final boolean render, final boolean animate, final int delta)

Implements abstract org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRenderer.render.

updateBallsback to summary
public void updateBalls(final int count)

Overrides org.lwjgl.test.opengl.sprites.SpriteShootoutCL.SpriteRenderer.updateBalls.