• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GL4类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: setupRenderModelForTrackedDevice

import com.jogamp.opengl.GL4; //导入依赖的package包/类
/**
 * Create/destroy GL a Render Model for a single tracked device.
 *
 * @param gl4
 * @param trackedDeviceIndex
 * @param hmd
 */
public void setupRenderModelForTrackedDevice(GL4 gl4, int trackedDeviceIndex, IVRSystem hmd) {

    if (trackedDeviceIndex >= VR.k_unMaxTrackedDeviceCount) {
        return;
    }
    // try to find a model we've already set up
    String renderModelName = getTrackedDeviceString(hmd, trackedDeviceIndex,
            VR.ETrackedDeviceProperty.Prop_RenderModelName_String);

    Model model = findOrLoad(gl4, renderModelName);

    if (model == null) {
        String trackingSystemName = getTrackedDeviceString(hmd, trackedDeviceIndex,
                VR.ETrackedDeviceProperty.Prop_TrackingSystemName_String);
        System.err.println("Unable to load render model for tracked device " + trackedDeviceIndex + "("
                + trackingSystemName + "." + renderModelName + ")");
    } else {
        trackedDeviceToRenderModel[trackedDeviceIndex] = model;
        showTrackedDevice[trackedDeviceIndex] = true;
    }
}
 
开发者ID:java-opengl-labs,项目名称:jogl-hello-vr,代码行数:29,代码来源:ModelsRender.java


示例17: initVertexArray

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

        gl4.glGenVertexArrays(1, vertexArrayName);
        gl4.glBindVertexArray(vertexArrayName.get(0));
        {
            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX));
            gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0);
            gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION);

            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.INSTANCE));
            gl4.glVertexAttribIPointer(Semantic.Attr.DRAW_ID, 1, GL_INT, 0, 0);
            gl4.glVertexAttribDivisor(Semantic.Attr.DRAW_ID, 1);
            gl4.glEnableVertexAttribArray(Semantic.Attr.DRAW_ID);

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

        return true;
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:21,代码来源:Gl_410_buffer_uniform_array.java


示例18: renderFBO

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

        gl4.glEnable(GL_DEPTH_TEST);

        gl4.glBindProgramPipeline(pipelineName.get(Program.THROUGH));
        gl4.glBindBufferRange(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM), 0,
                uniformBlockSize);

        gl4.glViewport(0, 0, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y);

        gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
        float[] depth = {1.0f};
        gl4.glClearBufferfv(GL_DEPTH, 0, depth, 0);
        gl4.glClearBufferfv(GL_COLOR, 0, new float[]{1.0f, 0.5f, 0.0f, 1.0f}, 0);

        textureName.position(Texture.DIFFUSE);
        gl4.glBindTextures(0, 1, textureName);
        textureName.rewind();
        gl4.glBindVertexArray(vertexArrayName.get(0));

        gl4.glDrawArraysInstanced(GL_TRIANGLES, 0, vertexCount, 5);

        gl4.glDisable(GL_DEPTH_TEST);
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:25,代码来源:Gl_450_fbo_multisample_explicit.java


示例19: end

import com.jogamp.opengl.GL4; //导入依赖的package包/类
@Override
protected boolean end(GL gl) {

    GL4 gl4 = (GL4) gl;

    gl4.glDeleteVertexArrays(VertexArray.MAX, vertexArrayName);
    gl4.glDeleteBuffers(Buffer.MAX, bufferName);
    gl4.glDeleteProgram(transformProgramName);
    gl4.glDeleteProgram(feedbackProgramName);
    gl4.glDeleteTransformFeedbacks(1, feedbackName);

    BufferUtils.destroyDirectBuffer(vertexArrayName);
    BufferUtils.destroyDirectBuffer(bufferName);
    BufferUtils.destroyDirectBuffer(feedbackName);

    return checkError(gl4, "end");
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:18,代码来源:Gl_400_transform_feedback_object.java


示例20: initVertexArray

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

        boolean validated = true;

        gl4.glGenVertexArrays(1, vertexArrayName);
        gl4.glBindVertexArray(vertexArrayName.get(0));
        {
            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.POSITION));
            gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0);
            gl4.glVertexAttribDivisor(Semantic.Attr.POSITION, 0);
            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.COLOR));
            gl4.glVertexAttribPointer(Semantic.Attr.COLOR, 4, GL_FLOAT, false, 0, 0);
            gl4.glVertexAttribDivisor(Semantic.Attr.COLOR, 1);

            gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION);
            gl4.glEnableVertexAttribArray(Semantic.Attr.COLOR);
        }
        gl4.glBindVertexArray(0);

        return validated;
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:22,代码来源:Gl_420_draw_base_instance.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IDEInternalWorkbenchImages类代码示例发布时间:2022-05-23
下一篇:
Java XMLObject类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap