MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / init

Method init

Source/Node/VGNode.cpp:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30bool VGNode::init() {
31 if (!Node::init()) return false;
32 NVGcontext* context = nvgCreate(_edgeAA, 0);
33 NVGLUframebuffer* framebuffer = nvgluCreateFramebuffer(context,
34 s_cast<int>(_frameWidth * _frameScale),
35 s_cast<int>(_frameHeight * _frameScale), 0);
36 bgfx::TextureInfo info;
37 bgfx::calcTextureSize(info,
38 s_cast<uint16_t>(_frameWidth * _frameScale),
39 s_cast<uint16_t>(_frameHeight * _frameScale),
40 0, false, false, 1, bgfx::TextureFormat::RGBA8);
41 uint64_t flags = BGFX_TEXTURE_RT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP;
42 _surface = Sprite::create(VGTexture::create(context, framebuffer, info, flags));
43 _surface->addTo(this);
44 return true;
45}
46
47void VGNode::cleanup() {
48 if (_flags.isOff(Node::Cleanup)) {

Callers

nothing calls this directly

Calls 6

nvgCreateFunction · 0.85
nvgluCreateFramebufferFunction · 0.85
calcTextureSizeFunction · 0.85
addToMethod · 0.80
initFunction · 0.50
createFunction · 0.50

Tested by

no test coverage detected