Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 : #ifndef mozilla_dom_WebGLVertexArrayObject_h
7 : #define mozilla_dom_WebGLVertexArrayObject_h
8 :
9 : #include "WebGLVertexArrayGL.h"
10 :
11 : namespace mozilla {
12 : namespace dom {
13 :
14 : /**
15 : * This class implements the DOM bindings for WebGL 2 VAO.
16 : *
17 : * This exists to so the object returned from gl.createVertexArray()
18 : * is an instance of WebGLVertexArrayObject (to match the WebGL 2
19 : * spec.)
20 : */
21 : class WebGLVertexArrayObject final
22 : : public WebGLVertexArrayGL
23 : {
24 : public:
25 : static WebGLVertexArray* Create(WebGLContext* webgl);
26 :
27 : virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto) override;
28 :
29 : private:
30 0 : explicit WebGLVertexArrayObject(WebGLContext* webgl)
31 0 : : WebGLVertexArrayGL(webgl)
32 0 : { }
33 :
34 0 : ~WebGLVertexArrayObject() {
35 0 : DeleteOnce();
36 0 : }
37 : };
38 :
39 : } // namespace dom
40 : } // namespace mozilla
41 :
42 : #endif // !mozilla_dom_WebGLVertexArrayObject_h
|