Package com.googlecode.gwtgl.binding

Examples of com.googlecode.gwtgl.binding.WebGLShader


  /**
   * Creates the ShaderProgram used by the example to render.
   */
  private void initShaders() {
    // Create the Shaders
    WebGLShader fragmentShader = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Resources.INSTANCE.fragmentShader().getText());
    log("Created fragment shader");
   
    WebGLShader vertexShader = getShader(WebGLRenderingContext.VERTEX_SHADER, Resources.INSTANCE.vertexShader().getText());
    log("Created vertex shader");
    if (vertexShader == null || fragmentShader == null) {
      log("Shader error");
      throw new RuntimeException("shader error");
    }
View Full Code Here


   * @param source
   *            the source of the shader
   * @return the created Shader instance.
   */
  private WebGLShader getShader(int type, String source) {
    WebGLShader shader = glContext.createShader(type);
    glContext.shaderSource(shader, source);
    glContext.compileShader(shader);
    checkErrors();

    // check if the Shader is successfully compiled
View Full Code Here

  /**
   * Creates the ShaderProgram used by the example to render.
   */
  private void createShaderProgram() {
    // Create the Shaders
    WebGLShader fragmentShader = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Shaders.INSTANCE.fragmentShader().getText());
    log("Created fragment shader");
   
    WebGLShader vertexShader = getShader(WebGLRenderingContext.VERTEX_SHADER, Shaders.INSTANCE.vertexShader().getText());
    log("Created vertex shader");
    if (vertexShader == null || fragmentShader == null) {
      log("Shader error");
      throw new RuntimeException("shader error");
    }
View Full Code Here

   * @param source
   *            the source of the shader
   * @return the created Shader instance.
   */
  private WebGLShader getShader(int type, String source) {
    WebGLShader shader = glContext.createShader(type);

    glContext.shaderSource(shader, source);
    glContext.compileShader(shader);

    // check if the Shader is successfully compiled
View Full Code Here

  /**
   * Creates the ShaderProgram used by the example to render.
   */
  private void createShaderProgram() {
    // Create the Shaders
    WebGLShader fragmentShader = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Shaders.INSTANCE.fragmentShader().getText());
    log("Created fragment shader");
   
    WebGLShader vertexShader = getShader(WebGLRenderingContext.VERTEX_SHADER, Shaders.INSTANCE.vertexShader().getText());
    log("Created vertex shader");
    if (vertexShader == null || fragmentShader == null) {
      log("Shader error");
      throw new RuntimeException("shader error");
    }
View Full Code Here

   * @param source
   *            the source of the shader
   * @return the created Shader instance.
   */
  private WebGLShader getShader(int type, String source) {
    WebGLShader shader = glContext.createShader(type);

    glContext.shaderSource(shader, source);
    glContext.compileShader(shader);

    // check if the Shader is successfully compiled
View Full Code Here

  /**
   * Creates the ShaderProgram used by the example to render.
   */
  private void initShaders() {
    WebGLShader vertexShader = getShader(WebGLRenderingContext.VERTEX_SHADER,
        Resources.INSTANCE.vertexShader().getText());
    WebGLShader fragmentShader = getShader(WebGLRenderingContext.FRAGMENT_SHADER,
        Resources.INSTANCE.fragmentShader().getText());
    // Create the program object
    shaderProgram = glContext.createProgram();
    glContext.attachShader(shaderProgram, vertexShader);
    glContext.attachShader(shaderProgram, fragmentShader);
View Full Code Here

   * @param source
   *            the source of the shader
   * @return the created Shader instance.
   */
  WebGLShader getShader(int shaderType, String source) {
    WebGLShader shader = glContext.createShader(shaderType);
    glContext.shaderSource(shader, source);
    glContext.compileShader(shader);

    // check if the Shader is successfully compiled
    if (!glContext.getShaderParameterb(shader, WebGLRenderingContext.COMPILE_STATUS)) {
View Full Code Here

    mGlContext.clear(WebGLRenderingContext.COLOR_BUFFER_BIT);
  }

  public void initShaders()
  {
    WebGLShader fragmentShaderSolid = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Shaders.INSTANCE.fragmentShaderSolid().getText());
    WebGLShader fragmentShaderTex = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Shaders.INSTANCE.fragmentShaderTex().getText());
    WebGLShader fragmentShaderSprite = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Shaders.INSTANCE.fragmentShaderSprite().getText());
    WebGLShader fragmentShaderAtlas = getShader(WebGLRenderingContext.FRAGMENT_SHADER, Shaders.INSTANCE.fragmentShaderAtlas().getText());
    WebGLShader vertexShader = getShader(WebGLRenderingContext.VERTEX_SHADER, Shaders.INSTANCE.vertexShader().getText());

    WebGLProgram program = mGlContext.createProgram();
    mGlContext.attachShader(program, vertexShader);
    mGlContext.attachShader(program, fragmentShaderSolid);
    mGlContext.linkProgram(program);
View Full Code Here

    }
  }

  private WebGLShader getShader(int type, String source)
  {
    WebGLShader shader = mGlContext.createShader(type);

    mGlContext.shaderSource(shader, source);
    mGlContext.compileShader(shader);

    if (!mGlContext.getShaderParameterb(shader, WebGLRenderingContext.COMPILE_STATUS))
View Full Code Here

TOP

Related Classes of com.googlecode.gwtgl.binding.WebGLShader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.