All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jogamp.nativewindow.DelegatedUpstreamSurfaceHookMutableSize Maven / Gradle / Ivy

There is a newer version: 2.3.2
Show newest version
package com.jogamp.nativewindow;

import javax.media.nativewindow.ProxySurface;
import javax.media.nativewindow.UpstreamSurfaceHook;

public class DelegatedUpstreamSurfaceHookMutableSize extends UpstreamSurfaceHookMutableSize {
    final UpstreamSurfaceHook upstream;

    /**
     * @param upstream optional upstream UpstreamSurfaceHook used for {@link #create(ProxySurface)} and {@link #destroy(ProxySurface)}.
     * @param width initial width
     * @param height initial height
     */
    public DelegatedUpstreamSurfaceHookMutableSize(UpstreamSurfaceHook upstream, int width, int height) {
        super(width, height);
        this.upstream = upstream;
    }

    @Override
    public final void create(ProxySurface s) {
        if(null != upstream) {
            upstream.create(s);
        }
    }

    @Override
    public final void destroy(ProxySurface s) {
        if(null != upstream) {
            upstream.destroy(s);
        }
    }
    
    @Override
    public String toString() {
        return getClass().getSimpleName()+"[ "+ width + "x" + height + ", " + upstream + "]";        
    }
    
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy