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

Method init

3rdparty/bgfx/src/renderer_gl.cpp:2275–3235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2273 }
2274
2275 bool init(const Init& _init)
2276 {
2277 struct ErrorState
2278 {
2279 enum Enum
2280 {
2281 Default,
2282 };
2283 };
2284
2285 ErrorState::Enum errorState = ErrorState::Default;
2286
2287 initLazyEnabledVertexAttributes();
2288
2289 if (_init.debug
2290 || _init.profile)
2291 {
2292 m_renderdocdll = loadRenderDoc();
2293 }
2294
2295 m_fbh = BGFX_INVALID_HANDLE;
2296 bx::memSet(m_uniforms, 0, sizeof(m_uniforms) );
2297 bx::memSet(&m_resolution, 0, sizeof(m_resolution) );
2298
2299 setRenderContextSize(_init.resolution);
2300
2301 m_vendor = getGLString(GL_VENDOR);
2302 m_renderer = getGLString(GL_RENDERER);
2303 m_version = getGLString(GL_VERSION);
2304 m_glslVersion = getGLString(GL_SHADING_LANGUAGE_VERSION);
2305
2306 {
2307 if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) )
2308 {
2309 int32_t majorGlVersion = 0;
2310 int32_t minorGlVersion = 0;
2311 const char* version = m_version;
2312
2313 while (*version && !bx::isNumeric(*version) )
2314 {
2315 ++version;
2316 }
2317
2318 bx::fromString(&majorGlVersion, version);
2319 bx::fromString(&minorGlVersion, version + 2);
2320 int32_t glVersion = majorGlVersion*10 + minorGlVersion;
2321
2322 BX_TRACE("WebGL context version %d (%d.%d).", glVersion, majorGlVersion, minorGlVersion);
2323
2324 m_gles3 = glVersion >= 30;
2325 }
2326 else
2327 {
2328 m_gles3 = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30);
2329 }
2330 }
2331
2332 for (uint32_t ii = 0; ii < BX_COUNTOF(s_vendorIds); ++ii)

Callers

nothing calls this directly

Calls 15

loadRenderDocFunction · 0.85
memSetFunction · 0.85
getGLStringFunction · 0.85
isNumericFunction · 0.85
fromStringFunction · 0.85
strCmpFunction · 0.85
strLenFunction · 0.85
getGLStringHashFunction · 0.85
strFindFunction · 0.85
getGlErrorFunction · 0.85
setTextureFormatFunction · 0.85

Tested by

no test coverage detected