当前位置: 首页>>代码示例>>Java>>正文


Java GL4类代码示例

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


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

示例1: isSinglePrecisionFloat

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a single-precision floating-point type (includes vectors and matrices).
 *
 * @return {@code true} if this is a single-precision floating-point type.
 */
public boolean isSinglePrecisionFloat() {
    switch (typeId) {
    case GL4.GL_FLOAT:        return true;
    case GL4.GL_FLOAT_VEC2:   return true;
    case GL4.GL_FLOAT_VEC3:   return true;
    case GL4.GL_FLOAT_VEC4:   return true;
    case GL4.GL_FLOAT_MAT2:   return true;
    case GL4.GL_FLOAT_MAT3:   return true;
    case GL4.GL_FLOAT_MAT4:   return true;
    case GL4.GL_FLOAT_MAT2x3: return true;
    case GL4.GL_FLOAT_MAT2x4: return true;
    case GL4.GL_FLOAT_MAT3x2: return true;
    case GL4.GL_FLOAT_MAT3x4: return true;
    case GL4.GL_FLOAT_MAT4x2: return true;
    case GL4.GL_FLOAT_MAT4x3: return true;

    default:                  return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:25,代码来源:DataType.java

示例2: isDoublePrecisionFloat

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a double-precision floating-point type (includes vectors and matrices).
 *
 * @return {@code true} if this is a double-precision floating-point type.
 */
public boolean isDoublePrecisionFloat() {
    switch (typeId) {
    case GL4.GL_DOUBLE:        return true;
    case GL4.GL_DOUBLE_VEC2:   return true;
    case GL4.GL_DOUBLE_VEC3:   return true;
    case GL4.GL_DOUBLE_VEC4:   return true;
    case GL4.GL_DOUBLE_MAT2:   return true;
    case GL4.GL_DOUBLE_MAT3:   return true;
    case GL4.GL_DOUBLE_MAT4:   return true;
    case GL4.GL_DOUBLE_MAT2x3: return true;
    case GL4.GL_DOUBLE_MAT2x4: return true;
    case GL4.GL_DOUBLE_MAT3x2: return true;
    case GL4.GL_DOUBLE_MAT3x4: return true;
    case GL4.GL_DOUBLE_MAT4x2: return true;
    case GL4.GL_DOUBLE_MAT4x3: return true;

    default:                   return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:25,代码来源:DataType.java

示例3: isFloatSampler

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a floating-point sampler type.
 *
 * @return {@code true} if this is a floating-point sampler type.
 */
public boolean isFloatSampler() {
    switch (typeId) {
    case GL4.GL_SAMPLER_1D:                   return true;
    case GL4.GL_SAMPLER_2D:                   return true;
    case GL4.GL_SAMPLER_3D:                   return true;
    case GL4.GL_SAMPLER_CUBE:                 return true;
    case GL4.GL_SAMPLER_CUBE_SHADOW:          return true;
    case GL4.GL_SAMPLER_1D_SHADOW:            return true;
    case GL4.GL_SAMPLER_2D_SHADOW:            return true;
    case GL4.GL_SAMPLER_1D_ARRAY:             return true;
    case GL4.GL_SAMPLER_2D_ARRAY:             return true;
    case GL4.GL_SAMPLER_1D_ARRAY_SHADOW:      return true;
    case GL4.GL_SAMPLER_2D_ARRAY_SHADOW:      return true;
    case GL4.GL_SAMPLER_2D_MULTISAMPLE:       return true;
    case GL4.GL_SAMPLER_2D_MULTISAMPLE_ARRAY: return true;
    case GL4.GL_SAMPLER_BUFFER:               return true;
    case GL4.GL_SAMPLER_2D_RECT:              return true;
    case GL4.GL_SAMPLER_2D_RECT_SHADOW:       return true;

    default:                                  return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:28,代码来源:DataType.java

示例4: isSignedIntegerSampler

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a signed integer sampler type.
 *
 * @return {@code true} if this is a signed integer sampler type.
 */
public boolean isSignedIntegerSampler() {
    switch (typeId) {
    case GL4.GL_INT_SAMPLER_1D:                   return true;
    case GL4.GL_INT_SAMPLER_2D:                   return true;
    case GL4.GL_INT_SAMPLER_3D:                   return true;
    case GL4.GL_INT_SAMPLER_CUBE:                 return true;
    case GL4.GL_INT_SAMPLER_1D_ARRAY:             return true;
    case GL4.GL_INT_SAMPLER_2D_ARRAY:             return true;
    case GL4.GL_INT_SAMPLER_2D_MULTISAMPLE:       return true;
    case GL4.GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: return true;
    case GL4.GL_INT_SAMPLER_BUFFER:               return true;
    case GL4.GL_INT_SAMPLER_2D_RECT:              return true;

    default:                                      return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:22,代码来源:DataType.java

示例5: isUnsignedIntegerSampler

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a unsigned integer sampler type.
 *
 * @return {@code true} if this is a unsigned integer sampler type.
 */
public boolean isUnsignedIntegerSampler() {
    switch (typeId) {
    case GL4.GL_UNSIGNED_INT_SAMPLER_1D:                   return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_2D:                   return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_3D:                   return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_CUBE:                 return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:             return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:             return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:       return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_BUFFER:               return true;
    case GL4.GL_UNSIGNED_INT_SAMPLER_2D_RECT:              return true;

    default:                                               return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:22,代码来源:DataType.java

示例6: isFloatImage

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a (single-precision) floating-point image type.
 *
 * @return {@code true} if this is a (single-precision) floating-point image type.
 */
public boolean isFloatImage() {
    switch (typeId) {
    case GL4.GL_IMAGE_1D:                   return true;
    case GL4.GL_IMAGE_2D:                   return true;
    case GL4.GL_IMAGE_3D:                   return true;
    case GL4.GL_IMAGE_2D_RECT:              return true;
    case GL4.GL_IMAGE_CUBE:                 return true;
    case GL4.GL_IMAGE_BUFFER:               return true;
    case GL4.GL_IMAGE_1D_ARRAY:             return true;
    case GL4.GL_IMAGE_2D_ARRAY:             return true;
    case GL4.GL_IMAGE_2D_MULTISAMPLE:       return true;
    case GL4.GL_IMAGE_2D_MULTISAMPLE_ARRAY: return true;

    default:                                return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:22,代码来源:DataType.java

示例7: isSignedIntegerImage

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a signed integer image type.
 *
 * @return {@code true} if this is a signed integer image type.
 */
public boolean isSignedIntegerImage() {
    switch (typeId) {
    case GL4.GL_INT_IMAGE_1D:                   return true;
    case GL4.GL_INT_IMAGE_2D:                   return true;
    case GL4.GL_INT_IMAGE_3D:                   return true;
    case GL4.GL_INT_IMAGE_2D_RECT:              return true;
    case GL4.GL_INT_IMAGE_CUBE:                 return true;
    case GL4.GL_INT_IMAGE_BUFFER:               return true;
    case GL4.GL_INT_IMAGE_1D_ARRAY:             return true;
    case GL4.GL_INT_IMAGE_2D_ARRAY:             return true;
    case GL4.GL_INT_IMAGE_2D_MULTISAMPLE:       return true;
    case GL4.GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY: return true;

    default: return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:22,代码来源:DataType.java

示例8: isUnsignedIntegerImage

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Tests if this is a unsigned integer image type.
 *
 * @return {@code true} if this is a unsigned integer image type.
 */
public boolean isUnsignedIntegerImage() {
    switch (typeId) {
    case GL4.GL_UNSIGNED_INT_IMAGE_1D:                   return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_2D:                   return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_3D:                   return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_2D_RECT:              return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_CUBE:                 return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_BUFFER:               return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_1D_ARRAY:             return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_2D_ARRAY:             return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE:       return true;
    case GL4.GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY: return true;

    default:                                             return false;
    }
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:22,代码来源:DataType.java

示例9: render

import com.jogamp.opengl.GL4; //导入依赖的package包/类
public void render(GL4 gl4, Application app) {

        gl4.glDisable(GL_DEPTH_TEST);
        gl4.glViewport(0, 0, app.windowSize.x, app.windowSize.y);

        gl4.glBindVertexArray(vertexArrayName.get(0));
        gl4.glUseProgram(program.name);

        for (int eye = 0; eye < VR.EVREye.Max; eye++) {

            gl4.glBindTexture(GL_TEXTURE_2D, app.eyeDesc[eye].textureName.get(FramebufferDesc.Target.RESOLVE));
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
            // left lens (first half of index array ), right lens (second half of index array )
            gl4.glDrawElements(GL_TRIANGLES, indexSize / 2, GL_UNSIGNED_SHORT,
                    eye == VR.EVREye.EYE_Left ? 0 : indexSize); // indexSize / 2 * Short.Bytes = indexSize
        }
        gl4.glBindVertexArray(0);
        gl4.glUseProgram(0);
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:23,代码来源:Distortion.java

示例10: initVertexArray

import com.jogamp.opengl.GL4; //导入依赖的package包/类
private void initVertexArray(GL4 gl4) {

        // create and bind a VAO to hold state for this model
        gl4.glGenVertexArrays(1, vertexArrayName);
        gl4.glBindVertexArray(vertexArrayName.get(0));

        gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX));

        // Identify the components in the vertex buffer
        gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION);
        gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 3, GL_FLOAT, false, RenderModel_Vertex_t.SIZE,
                RenderModel_Vertex_t.OFFSET_POSITION);
        gl4.glEnableVertexAttribArray(Semantic.Attr.NORMAL);
        gl4.glVertexAttribPointer(Semantic.Attr.NORMAL, 3, GL_FLOAT, false, RenderModel_Vertex_t.SIZE,
                RenderModel_Vertex_t.OFFSET_NORMAL);
        gl4.glEnableVertexAttribArray(Semantic.Attr.TEXT_COORD);
        gl4.glVertexAttribPointer(Semantic.Attr.TEXT_COORD, 2, GL_FLOAT, false, RenderModel_Vertex_t.SIZE,
                RenderModel_Vertex_t.OFFSET_TEXT_COORD);

        gl4.glBindBuffer(GL_ARRAY_BUFFER, 0);

        gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT));

        gl4.glBindVertexArray(0);
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:26,代码来源:Model.java

示例11: initVertexArray

import com.jogamp.opengl.GL4; //导入依赖的package包/类
private void initVertexArray(GL4 gl4) {

        gl4.glGenVertexArrays(1, vertexArrayName);
        gl4.glBindVertexArray(vertexArrayName.get(0));

        gl4.glBindBuffer(GL_ARRAY_BUFFER, vertexBufferName.get(0));

        int stride = 2 * 3 * Float.BYTES;
        int offset = 0;

        gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION);
        gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 3, GL_FLOAT, false, stride, offset);

        offset += Vec3.SIZE;
        gl4.glEnableVertexAttribArray(Semantic.Attr.COLOR);
        gl4.glVertexAttribPointer(Semantic.Attr.COLOR, 3, GL_FLOAT, false, stride, offset);

        gl4.glBindBuffer(GL_ARRAY_BUFFER, 0);
        gl4.glBindVertexArray(0);
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:21,代码来源:AxisLineControllers.java

示例12: setupStereoRenderTargets

import com.jogamp.opengl.GL4; //导入依赖的package包/类
private boolean setupStereoRenderTargets(GL4 gl4) {
    if (hmd == null) {
        return false;
    }
    IntBuffer width = GLBuffers.newDirectIntBuffer(1), height = GLBuffers.newDirectIntBuffer(1);

    hmd.GetRecommendedRenderTargetSize.apply(width, height);
    renderSize.set(width.get(0), height.get(0));

    IntStreamEx.range(VR.EVREye.Max).forEach(eye -> eyeDesc[eye] = new FramebufferDesc(gl4, renderSize));

    BufferUtils.destroyDirectBuffer(width);
    BufferUtils.destroyDirectBuffer(height);

    return true;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:17,代码来源:Application.java

示例13: dispose

import com.jogamp.opengl.GL4; //导入依赖的package包/类
@Override
public void dispose(GLAutoDrawable drawable) {

    if (hmd != null) {
        VR.VR_Shutdown();
        hmd = null;
    }

    GL4 gl4 = drawable.getGL().getGL4();

    modelsRender.dispose(gl4);
    scene.dispose(gl4);
    axisLineControllers.dispose(gl4);
    distortion.dispose(gl4);

    IntStreamEx.range(VR.EVREye.Max).forEach(eye -> eyeDesc[eye].dispose(gl4));

    BufferUtils.destroyDirectBuffer(clearColor);
    BufferUtils.destroyDirectBuffer(clearDepth);
    BufferUtils.destroyDirectBuffer(errorBuffer);
    BufferUtils.destroyDirectBuffer(matBuffer);

    System.exit(0);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:25,代码来源:Application.java

示例14: processVREvent

import com.jogamp.opengl.GL4; //导入依赖的package包/类
void processVREvent(GL4 gl4, VREvent_t event) {

        switch (event.eventType) {

            case VR.EVREventType.VREvent_TrackedDeviceActivated:
                //TODO | ask giuseppe for gl
                modelsRender.setupRenderModelForTrackedDevice(gl4, event.trackedDeviceIndex, hmd);
                System.out.println("Device %u attached. Setting up render model.\n" + event.trackedDeviceIndex);
                break;

            case VR.EVREventType.VREvent_TrackedDeviceDeactivated:
                System.out.println("Device %u detached.\n" + event.trackedDeviceIndex);
                break;

            case VR.EVREventType.VREvent_TrackedDeviceUpdated:
                System.out.println("Device %u updated.\n" + event.trackedDeviceIndex);
                break;
        }
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:20,代码来源:Application.java

示例15: setupRenderModels

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Create/destroy GL Render Models.
 *
 * @param gl4
 * @param hmd
 */
public void setupRenderModels(GL4 gl4, IVRSystem hmd) {

    IntStreamEx.range(trackedDeviceToRenderModel.length).forEach(i -> trackedDeviceToRenderModel[i] = null);

    if (hmd == null) {
        return;
    }

    for (int trackedDevice = VR.k_unTrackedDeviceIndex_Hmd + 1; trackedDevice < VR.k_unMaxTrackedDeviceCount;
            trackedDevice++) {

        if (hmd.IsTrackedDeviceConnected.apply(trackedDevice) == 0) {
            continue;
        }
        setupRenderModelForTrackedDevice(gl4, trackedDevice, hmd);
    }
}
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:24,代码来源:ModelsRender.java


注:本文中的com.jogamp.opengl.GL4类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。