MCPcopy Create free account
hub / github.com/crownengine/crown / SwapChainGL

Method SwapChainGL

3rdparty/bgfx/src/glcontext_html5.cpp:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 struct SwapChainGL
30 {
31 SwapChainGL(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE _context, const char* _canvas)
32 : m_context(_context)
33 {
34 size_t length = bx::strLen(_canvas) + 1;
35 m_canvas = (char*)bx::alloc(g_allocator, length);
36 bx::strCopy(m_canvas, length, _canvas);
37
38 makeCurrent();
39 GL_CHECK(glClearColor(0.0f, 0.0f, 0.0f, 0.0f) );
40 GL_CHECK(glClear(GL_COLOR_BUFFER_BIT) );
41 swapBuffers();
42 GL_CHECK(glClear(GL_COLOR_BUFFER_BIT) );
43 swapBuffers();
44 }
45
46 ~SwapChainGL()
47 {

Callers

nothing calls this directly

Calls 3

strLenFunction · 0.85
allocFunction · 0.85
strCopyFunction · 0.85

Tested by

no test coverage detected