2014-06-06 03:38:27 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "WebGLVertexArrayGL.h"
|
|
|
|
|
|
|
|
#include "GLContext.h"
|
2014-11-14 07:03:50 +03:00
|
|
|
#include "WebGLContext.h"
|
2014-06-06 03:38:27 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-05-21 02:58:36 +03:00
|
|
|
WebGLVertexArrayGL::WebGLVertexArrayGL(WebGLContext* webgl)
|
2018-10-17 09:54:28 +03:00
|
|
|
: WebGLVertexArray(webgl,
|
|
|
|
[&]() {
|
|
|
|
GLuint ret = 0;
|
|
|
|
webgl->gl->fGenVertexArrays(1, &ret);
|
|
|
|
return ret;
|
|
|
|
}())
|
2015-05-21 02:58:36 +03:00
|
|
|
{ }
|
|
|
|
|
|
|
|
WebGLVertexArrayGL::~WebGLVertexArrayGL()
|
|
|
|
{
|
|
|
|
DeleteOnce();
|
|
|
|
}
|
|
|
|
|
2014-06-06 03:38:27 +04:00
|
|
|
void
|
|
|
|
WebGLVertexArrayGL::DeleteImpl()
|
|
|
|
{
|
|
|
|
mElementArrayBuffer = nullptr;
|
|
|
|
|
|
|
|
mContext->gl->fDeleteVertexArrays(1, &mGLName);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2018-10-17 09:54:28 +03:00
|
|
|
WebGLVertexArrayGL::BindVertexArray()
|
2014-06-06 03:38:27 +04:00
|
|
|
{
|
2014-06-11 04:23:50 +04:00
|
|
|
mContext->mBoundVertexArray = this;
|
2014-06-06 03:38:27 +04:00
|
|
|
mContext->gl->fBindVertexArray(mGLName);
|
2015-05-21 02:58:36 +03:00
|
|
|
}
|
|
|
|
|
2014-06-06 03:38:27 +04:00
|
|
|
} // namespace mozilla
|