• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FBObject类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.jogamp.opengl.FBObject的典型用法代码示例。如果您正苦于以下问题:Java FBObject类的具体用法?Java FBObject怎么用?Java FBObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FBObject类属于com.jogamp.opengl包,在下文中一共展示了FBObject类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

点赞 2

import com.jogamp.opengl.FBObject; //导入依赖的package包/类
private void init(GL2 gl) {
    fbo = new FBObject();
    fbo.init(gl, w, h, 0);
    fboTex = fbo.attachTexture2D(gl, 0, true, GL2.GL_LINEAR, GL2.GL_LINEAR, GL2.GL_CLAMP_TO_EDGE, GL2.GL_CLAMP_TO_EDGE);

    fbo.attachRenderbuffer(gl, Type.DEPTH, FBObject.CHOSEN_BITS);
    fbo.reset(gl, fbo.getWidth(), fbo.getHeight(), GLInfo.GLSAMPLES);
    fbo.unbind(gl);
}
 

开发者ID:Helioviewer-Project,
项目名称:JHelioviewer-SWHV,
代码行数:10,
代码来源:GLGrab.java

示例2: drawShape

点赞 2

import com.jogamp.opengl.FBObject; //导入依赖的package包/类
@Override
public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
    if( null == fboGLAD ) {
        final ImageSequence imgSeq = (ImageSequence)texSeq;

        final GLContext ctx = gl.getContext();
        final GLDrawable drawable = ctx.getGLDrawable();
        final GLCapabilitiesImmutable reqCaps = drawable.getRequestedGLCapabilities();
        final GLCapabilities caps = (GLCapabilities) reqCaps.cloneMutable();
        caps.setFBO(true);
        caps.setDoubleBuffered(false);
        if( !useAlpha ) {
            caps.setAlphaBits(0);
        }
        final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());

        fboGLAD = (GLOffscreenAutoDrawable.FBO) factory.createOffscreenAutoDrawable(
                        drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(),
                        caps, null, fboWidth, fboHeight);
        fboWidth = 0;
        fboHeight = 0;
        fboGLAD.setSharedContext(ctx);
        fboGLAD.setTextureUnit(imgSeq.getTextureUnit());
        fboGLAD.addGLEventListener(glel);
        fboGLAD.display(); // 1st init!

        final FBObject.TextureAttachment texA01 = fboGLAD.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
        final Texture tex = new Texture(texA01.getName(), imgSeq.getTextureTarget(),
                                fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
                                false /* mustFlipVertically */);
        imgSeq.addFrame(gl, tex);
        markStateDirty();
    } else if( 0 != fboWidth*fboHeight ) {
        fboGLAD.setSurfaceSize(fboWidth, fboHeight);
        fboWidth = 0;
        fboHeight = 0;
        markStateDirty();
    } else if( animateGLEL ) {
        fboGLAD.display();
    }

    super.drawShape(gl, renderer, sampleCount);

    if( animateGLEL ) {
        markStateDirty(); // keep on going
    }
}
 

开发者ID:java-opengl-labs,
项目名称:jogl-samples,
代码行数:48,
代码来源:GLEventListenerButton.java

示例3: initializeGeometryData

点赞 2

import com.jogamp.opengl.FBObject; //导入依赖的package包/类
private void initializeGeometryData()
{
	//Create the framebuffer
	geometryFBO = new FBObject();
	geometryFBO.reset(gl, size.x, size.y);
	geometryFBO.attachTexture2D(gl, 0, true);
	geometryFBO.attachTexture2D(gl, 1, false);
	geometryFBO.attachTexture2D(gl, 2, true);
	geometryFBO.attachRenderbuffer(gl, FBObject.Attachment.Type.DEPTH, 6);
	
	//Specify all the render targets
	IntBuffer geometryRenderTargets = IntBuffer.wrap(new int[]{GL.GL_COLOR_ATTACHMENT0, GL.GL_COLOR_ATTACHMENT0+1, GL.GL_COLOR_ATTACHMENT0+2});
	gl.glDrawBuffers(3, geometryRenderTargets);
	geometryFBO.unbind(gl);
}
 

开发者ID:jacquesh,
项目名称:project-grige,
代码行数:16,
代码来源:Camera.java

示例4: initializeLightingData

点赞 2

import com.jogamp.opengl.FBObject; //导入依赖的package包/类
private void initializeLightingData()
{
	//Create the framebuffer
	lightingFBO = new FBObject();
	lightingFBO.reset(gl, size.x, size.y);
	lightingFBO.attachTexture2D(gl, 0, true);
	lightingFBO.attachRenderbuffer(gl, FBObject.Attachment.Type.DEPTH_STENCIL, 6);
	lightingFBO.unbind(gl);
}
 

开发者ID:jacquesh,
项目名称:project-grige,
代码行数:10,
代码来源:Camera.java

示例5: initializeInterfaceData

点赞 2

import com.jogamp.opengl.FBObject; //导入依赖的package包/类
private void initializeInterfaceData()
{
	//Create the framebuffer
	interfaceFBO = new FBObject();
	interfaceFBO.reset(gl, size.x, size.y);
	interfaceFBO.attachTexture2D(gl, 0, true);
	interfaceFBO.unbind(gl);
	
	//Initialize Text Rendering data
	textFonts = new HashMap<Font, TextRenderer>();
}
 

开发者ID:jacquesh,
项目名称:project-grige,
代码行数:12,
代码来源:Camera.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)