Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/canvas/test/webgl-mochitest/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  test_noprog_draw.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/dom/canvas/test/webgl-mochitest/test_noprog_draw.html


<!DOCTYPE HTML>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>WebGL test: Drawing with a null program</title>

<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="driver-info.js"></script>
<script src="webgl-util.js"></script>


<script id="vs" type="x-shader/x-vertex">

void main(void) {
  gl_PointSize = 16.0;
  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}

</script>
<script id="fs" type="x-shader/x-fragment">

precision mediump float;

void main(void) {
  gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
}

</script>
<body>
<canvas id="c" width="64" height="64"></canvas>
<script>

// Give ourselves a scope to return early from:
(function() {
  var gl = c.getContext('webgl');
  if (!gl) {
    todo(false, 'WebGL is unavailable.');
    return;
  }

  gl.disable(gl.DEPTH_TEST);

  var prog   = WebGLUtil.createProgramByIds(gl, 'vs', 'fs');
  if (!prog) {
    ok(false, 'Program linking should succeed.');
    return;
  }

  function checkGLError(func, info, refValue) {
    if (!refValue)
      refValue = 0;

    var error = gl.getError();
    func(error == refValue,
         '[' + info + '] gl.getError should be 0x' + refValue.toString(16) +
                                        ', was 0x' + error.toString(16) + '.');
  }

  // Start drawing
  checkGLError(ok, 'after setup');

  gl.useProgram(prog);
  gl.drawArrays(gl.POINTS, 0, 1);
  checkGLError(ok, 'after non-null-program DrawArrays');

  gl.useProgram(null);
  gl.drawArrays(gl.POINTS, 0, 1);
  checkGLError(ok, 'after null-program DrawArrays', gl.INVALID_OPERATION);

  ok(true, 'Test complete.');
})();

</script>


Messung V0.5 in Prozent
C=95 H=92 G=93

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.