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


Java GLES20.glDeleteProgram方法代码示例

本文整理汇总了Java中android.opengl.GLES20.glDeleteProgram方法的典型用法代码示例。如果您正苦于以下问题:Java GLES20.glDeleteProgram方法的具体用法?Java GLES20.glDeleteProgram怎么用?Java GLES20.glDeleteProgram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.opengl.GLES20的用法示例。


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

示例1: createProgram

import android.opengl.GLES20; //导入方法依赖的package包/类
public static int createProgram(String vertexSource, String fragmentSource) {
    int vs = loadShader(GLES20.GL_VERTEX_SHADER,   vertexSource);
    int fs = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
    int program = GLES20.glCreateProgram();
    GLES20.glAttachShader(program, vs);
    GLES20.glAttachShader(program, fs);
    GLES20.glLinkProgram(program);
    int[] linkStatus = new int[1];
    GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
    if (linkStatus[0] != GLES20.GL_TRUE) {
        Lg.e("Could not link program:");
        Lg.e( GLES20.glGetProgramInfoLog(program));
        GLES20.glDeleteProgram(program);
        program = 0;
    }
    return program;
}
 
开发者ID:wuyisheng,项目名称:libRtmp,代码行数:18,代码来源:AndroidUntil.java

示例2: updateProgram

import android.opengl.GLES20; //导入方法依赖的package包/类
static void updateProgram(int program, String vertexSource, String fragmentSource) {
    int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
    if (vertexShader == 0) {
        return;
    }
    int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
    if (pixelShader == 0) {
        return;
    }
    if (program != 0) {
        GLES20.glAttachShader(program, vertexShader);
        checkGlError("glAttachShader");
        GLES20.glAttachShader(program, pixelShader);
        checkGlError("glAttachShader");
        GLES20.glLinkProgram(program);
        int[] linkStatus = new int[1];
        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
        if (linkStatus[0] != GLES20.GL_TRUE) {
            String info = GLES20.glGetProgramInfoLog(program);
            GLES20.glDeleteProgram(program);
            throw new RuntimeException("Could not link program: " + info);
        }
    }
}
 
开发者ID:gplibs,项目名称:android-magic-surface-view,代码行数:25,代码来源:GLUtil.java

示例3: linkProgram

import android.opengl.GLES20; //导入方法依赖的package包/类
/**
 * Links a vertex shader and a fragment shader together into an OpenGL
 * program. Returns the OpenGL program object ID, or 0 if linking failed.
 */
public static int linkProgram(int vertexShaderId, int fragmentShaderId) {

    // Create a new program object.
    final int programObjectId = GLES20.glCreateProgram();

    if (programObjectId == 0) {
        return 0;
    }

    // Attach the vertex shader to the program.
    GLES20.glAttachShader(programObjectId, vertexShaderId);

    // Attach the fragment shader to the program.
    GLES20.glAttachShader(programObjectId, fragmentShaderId);

    // Link the two shaders together into a program.
    GLES20.glLinkProgram(programObjectId);

    // Get the link status.
    final int[] linkStatus = new int[1];
    GLES20.glGetProgramiv(programObjectId, GLES20.GL_LINK_STATUS,
            linkStatus, 0);


    // Verify the link status.
    if (linkStatus[0] == 0) {
        // If it failed, delete the program object.
        GLES20.glDeleteProgram(programObjectId);


        return 0;
    }

    // Return the program object ID.
    return programObjectId;
}
 
开发者ID:khoatd92,项目名称:sensor-graph-opengl-es-android,代码行数:41,代码来源:ShaderUtils.java

示例4: createProgram

import android.opengl.GLES20; //导入方法依赖的package包/类
private int createProgram(String vertexSource, String fragmentSource) {
    int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
    if (vertexShader == 0) {
        return 0;
    }
    int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
    if (pixelShader == 0) {
        return 0;
    }

    int program = GLES20.glCreateProgram();
    if (program != 0) {
        GLES20.glAttachShader(program, vertexShader);
        checkGlError("glAttachShader");
        GLES20.glAttachShader(program, pixelShader);
        checkGlError("glAttachShader");
        GLES20.glLinkProgram(program);
        int[] linkStatus = new int[1];
        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
        if (linkStatus[0] != GLES20.GL_TRUE) {
            Log.e(TAG, "Could not link program: ");
            Log.e(TAG, GLES20.glGetProgramInfoLog(program));
            GLES20.glDeleteProgram(program);
            program = 0;
        }
    }
    return program;
}
 
开发者ID:pavelsemak,项目名称:alpha-movie,代码行数:29,代码来源:VideoRenderer.java

示例5: changeFragmentShader

import android.opengl.GLES20; //导入方法依赖的package包/类
public void changeFragmentShader(String fragmentShader) {
    GLES20.glDeleteProgram(mProgram);
    mProgram = createProgram(VERTEX_SHADER, fragmentShader);
    if (mProgram == 0) {
        throw new RuntimeException("failed creating program");
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:8,代码来源:TextureRenderer.java

示例6: destroy

import android.opengl.GLES20; //导入方法依赖的package包/类
public final void destroy()
{
    C();

    this.aU = false;
    GLES20.glDeleteProgram(this.aO);
    onDestroy();
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:9,代码来源:GPUImageFilter.java

示例7: createProgram

import android.opengl.GLES20; //导入方法依赖的package包/类
public static int createProgram(String vertexSource, String fragmentSource) {
    int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
    if (vertexShader == 0) {
        return 0;
    }
    int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
    if (pixelShader == 0) {
        return 0;
    }

    int program = GLES20.glCreateProgram();
    if (program != 0) {
        GLES20.glAttachShader(program, vertexShader);
        checkGlError("glAttachShader");
        GLES20.glAttachShader(program, pixelShader);
        checkGlError("glAttachShader");
        GLES20.glLinkProgram(program);
        int[] linkStatus = new int[1];
        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
        if (linkStatus[0] != GLES20.GL_TRUE) {
            Log.e(TAG, "Could not link program: ");
            Log.e(TAG, GLES20.glGetProgramInfoLog(program));
            GLES20.glDeleteProgram(program);
            program = 0;
        }
    }
    return program;
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:29,代码来源:ShaderUtils.java

示例8: loadShader

import android.opengl.GLES20; //导入方法依赖的package包/类
private static int loadShader(String vss, String fss) {
    Log.d("CameraGLRendererBase", "loadShader");
    int vshader = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER);
    GLES20.glShaderSource(vshader, vss);
    GLES20.glCompileShader(vshader);
    int[] status = new int[1];
    GLES20.glGetShaderiv(vshader, GLES20.GL_COMPILE_STATUS, status, 0);
    if (status[0] == 0) {
        Log.e("CameraGLRendererBase", "Could not compile vertex shader: "+GLES20.glGetShaderInfoLog(vshader));
        GLES20.glDeleteShader(vshader);
        vshader = 0;
        return 0;
    }

    int fshader = GLES20.glCreateShader(GLES20.GL_FRAGMENT_SHADER);
    GLES20.glShaderSource(fshader, fss);
    GLES20.glCompileShader(fshader);
    GLES20.glGetShaderiv(fshader, GLES20.GL_COMPILE_STATUS, status, 0);
    if (status[0] == 0) {
        Log.e("CameraGLRendererBase", "Could not compile fragment shader:"+GLES20.glGetShaderInfoLog(fshader));
        GLES20.glDeleteShader(vshader);
        GLES20.glDeleteShader(fshader);
        fshader = 0;
        return 0;
    }

    int program = GLES20.glCreateProgram();
    GLES20.glAttachShader(program, vshader);
    GLES20.glAttachShader(program, fshader);
    GLES20.glLinkProgram(program);
    GLES20.glDeleteShader(vshader);
    GLES20.glDeleteShader(fshader);
    GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, status, 0);
    if (status[0] == 0) {
        Log.e("CameraGLRendererBase", "Could not link shader program: "+GLES20.glGetProgramInfoLog(program));
        program = 0;
        return 0;
    }
    GLES20.glValidateProgram(program);
    GLES20.glGetProgramiv(program, GLES20.GL_VALIDATE_STATUS, status, 0);
    if (status[0] == 0)
    {
        Log.e("CameraGLRendererBase", "Shader program validation error: "+GLES20.glGetProgramInfoLog(program));
        GLES20.glDeleteProgram(program);
        program = 0;
        return 0;
    }

    Log.d("CameraGLRendererBase", "Shader program is built OK");

    return program;
}
 
开发者ID:vulovicv23,项目名称:opencv-documentscanner-android,代码行数:53,代码来源:CameraGLRendererBase.java

示例9: destroy

import android.opengl.GLES20; //导入方法依赖的package包/类
public final void destroy() {
    mIsInitialized = false;
    GLES20.glDeleteProgram(mGLProgId);
    onDestroy();
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:6,代码来源:GPUImageFilter.java

示例10: tearDown

import android.opengl.GLES20; //导入方法依赖的package包/类
public void tearDown() {
    GLES20.glDeleteProgram(mProgram);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:4,代码来源:TextureRenderer.java

示例11: deleteProgram

import android.opengl.GLES20; //导入方法依赖的package包/类
public void deleteProgram() {
    GLES20.glDeleteShader(mShaderVertex);
    GLES20.glDeleteShader(mShaderFragment);
    GLES20.glDeleteProgram(mProgram);
    mProgram = mShaderVertex = mShaderFragment = 0;
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:7,代码来源:Shader.java

示例12: release

import android.opengl.GLES20; //导入方法依赖的package包/类
/**
 * terminatinng, this should be called in GL context
 */
public void release() {
	if (hProgram >= 0)
		GLES20.glDeleteProgram(hProgram);
	hProgram = -1;
}
 
开发者ID:FacePlusPlus,项目名称:MegviiFacepp-Android-SDK,代码行数:9,代码来源:GLDrawer2D.java


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