From 4afbe3f2eba9b28e2a92cc5bf7f04141317f55fe Mon Sep 17 00:00:00 2001 From: Mikhail Prokudin <39721766+mirexdoors@users.noreply.github.com> Date: Tue, 23 Mar 2021 02:16:03 +0700 Subject: add ru translation for webglcontextlost event page (#196) * add ru translation for webglcontextlost event page * fix review conversations * fix title translate * Update files/ru/web/api/htmlcanvaselement/webglcontextlost_event/index.html Co-authored-by: Alexander Myshov --- .../webglcontextlost_event/index.html | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/ru/web/api/htmlcanvaselement/webglcontextlost_event/index.html (limited to 'files/ru/web') diff --git a/files/ru/web/api/htmlcanvaselement/webglcontextlost_event/index.html b/files/ru/web/api/htmlcanvaselement/webglcontextlost_event/index.html new file mode 100644 index 0000000000..452acf5d7b --- /dev/null +++ b/files/ru/web/api/htmlcanvaselement/webglcontextlost_event/index.html @@ -0,0 +1,78 @@ +--- +title: 'HTMLCanvasElement: событие webglcontextlost' +slug: Web/API/HTMLCanvasElement/webglcontextlost_event +translation_of: Web/API/HTMLCanvasElement/webglcontextlost_event +tags: +- Event +- Reference +- WebGL +--- +
{{APIRef}}
+ +

Событие webglcontextlost WebGL API вызывается когда {{Glossary("User agent")}} + обнаруживает, что буфер, связанный с {{domxref("WebGLRenderingContext")}}, потерян.

+ + + + + + + + + + + + + + + + + + + + +
ВсплытиеДа
ОтменяемоеДа
Интерфейс{{domxref("WebGLContextEvent")}}
Свойство для обработки событияНет
+ +

Пример

+ +

Вы можете эмулировать webglcontextlost событие с помощью расширения {{domxref("WEBGL_lose_context")}}:

+ +
const canvas = document.getElementById('canvas');
+const gl = canvas.getContext('webgl');
+
+canvas.addEventListener('webglcontextlost', (event) => {
+  console.log(event);
+});
+
+gl.getExtension('WEBGL_lose_context').loseContext();
+
+// будет выведено "webglcontextlost".
+ +

Спецификация

+ + + + + + + + + + + + + + +
СпецификацияСтатусКомментарии
{{SpecName('WebGL', '#5.15.2', 'webglcontextlost')}}{{Spec2('WebGL')}}Изначальное определение.
+ +

Поддержка браузерами

+ +

{{Compat("api.HTMLCanvasElement.webglcontextlost_event")}}

+ +

Смотрите также

+ + -- cgit v1.2.3-54-g00ecf