/** * Creates an OpenGL texture object associated with the given OpenGL * texture target. The texture has * no initial data. This is used, for example, to construct cube * maps out of multiple TextureData objects. * * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D, * GL.GL_TEXTURE_RECTANGLE_ARB */ public static Texture newTexture(final int target) { return new Texture(target); }
/** * Creates an OpenGL texture object associated with the given OpenGL * texture target. The texture has * no initial data. This is used, for example, to construct cube * maps out of multiple TextureData objects. * * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D, * GL.GL_TEXTURE_RECTANGLE_ARB */ public static Texture newTexture(final int target) { return new Texture(target); }
/** * Creates an OpenGL texture object from the specified TextureData * using the given OpenGL context. * * @param data the texture data to turn into an OpenGL texture * @throws GLException if no OpenGL context is current or if an * OpenGL error occurred * @throws IllegalArgumentException if the passed TextureData was null */ public static Texture newTexture(final GL gl, final TextureData data) throws GLException, IllegalArgumentException { if (data == null) { throw new IllegalArgumentException("Null TextureData"); } return new Texture(gl, data); }
/** * Creates an OpenGL texture object from the specified TextureData * using the given OpenGL context. * * @param data the texture data to turn into an OpenGL texture * @throws GLException if no OpenGL context is current or if an * OpenGL error occurred * @throws IllegalArgumentException if the passed TextureData was null */ public static Texture newTexture(final GL gl, final TextureData data) throws GLException, IllegalArgumentException { if (data == null) { throw new IllegalArgumentException("Null TextureData"); } return new Texture(gl, data); }
public GLReadBufferUtil(final GLPixelBufferProvider pixelBufferProvider, final boolean alpha, final boolean write2Texture) { this.pixelBufferProvider = pixelBufferProvider; this.readTexture = write2Texture ? new Texture(GL.GL_TEXTURE_2D) : null ; this.psm = new GLPixelStorageModes(); this.hasAlpha = alpha; // preset }
public GLReadBufferUtil(final GLPixelBufferProvider pixelBufferProvider, final boolean alpha, final boolean write2Texture) { this.pixelBufferProvider = pixelBufferProvider; this.componentCount = alpha ? 4 : 3 ; this.alignment = alpha ? 4 : 1 ; this.readTexture = write2Texture ? new Texture(GL.GL_TEXTURE_2D) : null ; this.psm = new GLPixelStorageModes(); }
public GLReadBufferUtil(final GLPixelBufferProvider pixelBufferProvider, final boolean alpha, final boolean write2Texture) { this.pixelBufferProvider = pixelBufferProvider; this.readTexture = write2Texture ? new Texture(GL.GL_TEXTURE_2D) : null ; this.psm = new GLPixelStorageModes(); this.hasAlpha = alpha; // preset }
public CursorLabelPainter( ) { this.xOffset_PX = 6; this.yOffset_PX = 6; this.offsetBySelectionSize = true; this.clampToScreenEdges = true; this.dirty = true; this.content = null; this.label = new JLabel( ) { @Override protected void paintComponent( Graphics g ) { g.setColor( getBackground( ) ); g.fillRect( 0, 0, getWidth( ), getHeight( ) ); super.paintComponent( g ); } }; this.texture = new Texture( GL_TEXTURE_2D ); this.texCoords = new GLEditableBuffer( GL_STATIC_DRAW, 8 * SIZEOF_FLOAT ); this.vertCoords = new GLEditableBuffer( GL_STATIC_DRAW, 8 * SIZEOF_FLOAT ); this.prog = new CursorLabelProgram( ); // Default to something visible, in case setLaf fails for some reason this.label.setFont( new Font( MONOSPACED, PLAIN, 12 ) ); this.label.setBackground( BLACK ); this.label.setForeground( WHITE ); this.label.setBorder( createEmptyBorder( 2, 5, 3, 5 ) ); }
public final void addFrame(final GL gl, final Class<?> context, final String imageResourcePath, final String imageSuffix) throws IOException { final URLConnection urlConn = IOUtil.getResource(imageResourcePath, context.getClassLoader(), context); if(null != urlConn) { final TextureData texData = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, imageSuffix); final Texture tex = new Texture(getTextureTarget()); tex.updateImage(gl, texData); addFrame(gl, tex); } } public final int getFrameCount() { return frames.size(); }
public final void addFrame(final GL gl, final Class<?> context, final String imageResourcePath, final String imageSuffix) throws IOException { final URLConnection urlConn = IOUtil.getResource(context, imageResourcePath); if(null != urlConn) { final TextureData texData = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, imageSuffix); final Texture tex = new Texture(getTextureTarget()); tex.updateImage(gl, texData); addFrame(gl, tex); } } public final int getFrameCount() { return frames.size(); }
gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]); return new Texture(texName, textureTarget, tWidth, tHeight, width, height, !isInGLOrientation);
gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]); return new Texture(texName, textureTarget, tWidth, tHeight, width, height, !isInGLOrientation);