annotate Platforms/Wasm/WasmViewport.cpp @ 894:f557b18d287f

wasm: error log if canvas GL context can't be created
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 16 Jul 2019 10:51:03 +0200
parents 4f2416d519b4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
1 #include "WasmViewport.h"
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
2
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
3 #include <vector>
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
4 #include <memory>
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
5
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 242
diff changeset
6 std::vector<std::shared_ptr<Deprecated::WidgetViewport>> wasmViewports;
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
7
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 242
diff changeset
8 void AttachWidgetToWasmViewport(const char* htmlCanvasId, Deprecated::IWidget* centralWidget) {
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 242
diff changeset
9 std::shared_ptr<Deprecated::WidgetViewport> viewport(CreateWasmViewportFromCpp(htmlCanvasId));
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
10 viewport->SetCentralWidget(centralWidget);
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
11
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents:
diff changeset
12 wasmViewports.push_back(viewport);
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 242
diff changeset
13 }