An OpenGL Texture/Buffer/Object. This is like a texture (you can randomly read from it) but like a buffer (it can be really large).
| 14 | * An OpenGL Texture/Buffer/Object. This is like a texture (you can randomly read from it) but like a buffer (it can be really large). |
| 15 | */ |
| 16 | public class TextureBuffer extends BaseScene<TextureBuffer.State> implements Scene.Perform, OffersUniform<Integer> { |
| 17 | |
| 18 | static public class State extends BaseScene.Modifiable { |
| 19 | int textureName; |
| 20 | } |
| 21 | |
| 22 | SimpleArrayBuffer buffer; |
| 23 | TextureBufferSpecification specification; |
| 24 | |
| 25 | static public class TextureBufferSpecification { |
| 26 | int elements; |
| 27 | int dimension; |
| 28 | int type; |
| 29 | int unit; |
| 30 | FloatBuffer customStorage; |
| 31 | |
| 32 | static public TextureBufferSpecification float1(int unit, int width) { |
| 33 | TextureBufferSpecification s = new TextureBufferSpecification(); |
| 34 | s.elements = width; |
| 35 | s.dimension = 1; |
| 36 | s.type = GL30.GL_R32F; |
| 37 | s.customStorage = null; |
| 38 | s.unit = unit; |
| 39 | return s; |
| 40 | } |
| 41 | |
| 42 | static public TextureBufferSpecification float2(int unit, int width) { |
| 43 | TextureBufferSpecification s = new TextureBufferSpecification(); |
| 44 | s.elements = width; |
| 45 | s.dimension = 2; |
| 46 | s.type = GL30.GL_RG32F; |
| 47 | s.customStorage = null; |
| 48 | s.unit = unit; |
| 49 | return s; |
| 50 | } |
| 51 | |
| 52 | static public TextureBufferSpecification float3(int unit, int width) { |
| 53 | TextureBufferSpecification s = new TextureBufferSpecification(); |
| 54 | s.elements = width; |
| 55 | s.dimension = 3; |
| 56 | s.type = GL30.GL_RGB32F; |
| 57 | s.customStorage = null; |
| 58 | s.unit = unit; |
| 59 | return s; |
| 60 | } |
| 61 | |
| 62 | static public TextureBufferSpecification float4( int unit, int width) { |
| 63 | TextureBufferSpecification s = new TextureBufferSpecification(); |
| 64 | s.elements = width; |
| 65 | s.dimension = 4; |
| 66 | s.type = GL30.GL_RGBA32F; |
| 67 | s.customStorage = null; |
| 68 | s.unit = unit; |
| 69 | return s; |
| 70 | } |
| 71 | |
| 72 | static public TextureBufferSpecification float1(int unit, FloatBuffer storage) { |
| 73 | TextureBufferSpecification s = new TextureBufferSpecification(); |
nothing calls this directly
no outgoing calls
no test coverage detected