MCPcopy Create free account
hub / github.com/Illation/ETEngine / Initialize

Method Initialize

Engine/source/EtRendering/GraphicsTypes/FrameBuffer.cpp:40–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void FrameBuffer::Initialize()
41{
42 I_GraphicsApiContext* const api = Viewport::GetCurrentApiContext();
43
44 //Load and compile Shaders
45 m_pShader = core::ResourceManager::Instance()->GetAssetData<ShaderData>(core::HashString(core::FileUtil::ExtractName(m_ShaderFile).c_str()));
46
47 //GetAccessTo shader attributes
48 api->SetShader(m_pShader.get());
49 AccessShaderAttributes();
50
51 //FrameBuffer
52 api->GenFramebuffers(1, &m_GlFrameBuffer);
53
54 GenerateFramebufferTextures();
55
56 ET_ASSERT(api->IsFramebufferComplete(), "Creating framebuffer failed!");
57
58 m_VPCallbackId = Viewport::GetCurrentViewport()->GetEventDispatcher().Register(render::E_ViewportEvent::VP_Resized, render::T_ViewportEventCallback(
59 [this](render::T_ViewportEventFlags const, render::ViewportEventData const* const) -> void
60 {
61 ResizeFramebufferTextures();
62 }));
63}
64
65void FrameBuffer::AccessShaderAttributes()
66{

Callers

nothing calls this directly

Calls 5

HashStringClass · 0.85
SetShaderMethod · 0.80
GenFramebuffersMethod · 0.80
IsFramebufferCompleteMethod · 0.80
RegisterMethod · 0.80

Tested by

no test coverage detected