List of usage examples for com.google.gwt.webgl.client WebGLUtil createShaderProgram
public static WebGLProgram createShaderProgram(WebGLRenderingContext gl, String vertexSource, String fragmentSource)
From source file:playn.html.HtmlGLShader.java
License:Apache License
protected HtmlGLShader(HtmlGLContext ctx, String fragmentShader) { this.ctx = ctx; this.gl = ctx.gl; // Compile the shader. program = WebGLUtil.createShaderProgram(gl, VERTEX_SHADER, fragmentShader); // glGet*() calls are slow; determine locations once. uScreenSizeLoc = gl.getUniformLocation(program, "u_ScreenSize"); aMatrix = gl.getAttribLocation(program, "a_Matrix"); aTranslation = gl.getAttribLocation(program, "a_Translation"); aPosition = gl.getAttribLocation(program, "a_Position"); aTexture = gl.getAttribLocation(program, "a_Texture"); // Create the vertex and index buffers. vertexBuffer = gl.createBuffer();// ww w .ja v a2s . c o m elementBuffer = gl.createBuffer(); }