File: extension.xml

package info (click to toggle)
rust-khronos-api 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,704 kB
  • sloc: xml: 114,180; makefile: 4
file content (74 lines) | stat: -rw-r--r-- 2,335 bytes parent folder | download | duplicates (39)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<draft href="OES_fbo_render_mipmap/">
  <name>OES_fbo_render_mipmap</name>

  <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
  working group</a> (public_webgl 'at' khronos.org) </contact>

  <contributors>
    <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
    <contributor>Members of the WebGL working group</contributor>
  </contributors>

  <number>28</number>

  <depends>
    <api version="1.0"/>
    <core version="2.0" />
  </depends>

  <overview>
    <mirrors href="https://www.khronos.org/registry/gles/extensions/OES/OES_fbo_render_mipmap.txt"
             name="OES_fbo_render_mipmap">
    </mirrors>

    <features>
      <feature>
        Any level of a texture can be attached to a framebuffer object.
      </feature>
    </features>
  </overview>

  <idl xml:space="preserve">
[NoInterfaceObject]
interface OES_fbo_render_mipmap {
};
  </idl>

  <samplecode xml:space="preserve">
    <pre>
        var extension = gl.getExtension('OES_fbo_render_mipmap');
        if(extension !=== null){
            var texture = gl.createTexture();
            gl.bindTexture(gl.TEXTURE_2D, texture);
            var fbos = [];
            
            for(var level=0; level&lt;7; level++){
                var size = 128/Math.pow(2, level);
                gl.texImage2D(gl.TEXTURE_2D, level, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
                var fbo = gl.createFramebuffer();
                gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
                gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, level);
                fbos.push(fbo);
                
                var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
                console.assert(fboStatus == gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is not complete');
            }

            gl.bindTexture(gl.TEXTURE_2D, null);
            gl.bindFramebuffer(gl.FRAMEBUFFER, null);

            console.assert(gl.getError() == gl.NO_ERROR, 'A GL error occured');
        }
    </pre>
  </samplecode>

  <history>
    <revision date="2015/01/26">
      <change>Initial revision.</change>
    </revision>
    <revision date="2015/01/31">
      <change>Moved to draft.</change>
    </revision>
  </history>
</draft>