MCPcopy Create free account
hub / github.com/defold/defold / GetRenderCameraEffectiveAspectRatio

Function GetRenderCameraEffectiveAspectRatio

engine/render/src/render/camera.cpp:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 }
92
93 float GetRenderCameraEffectiveAspectRatio(HRenderContext render_context, HRenderCamera camera)
94 {
95 RenderCamera* c = render_context->m_RenderCameras.Get(camera);
96
97 if (c->m_Data.m_AutoAspectRatio)
98 {
99 dmGraphics::HContext graphics_context = GetGraphicsContext(render_context);
100 float width = (float) dmGraphics::GetWindowWidth(graphics_context);
101 float height = (float) dmGraphics::GetWindowHeight(graphics_context);
102 return width / height;
103 }
104 else
105 {
106 return c->m_Data.m_AspectRatio;
107 }
108 }
109
110 float GetRenderCameraOrthographicAutoZoom(HRenderContext render_context, HRenderCamera camera)
111 {

Callers 3

TEST_FFunction · 0.85
CompCameraGetPropertyFunction · 0.85

Calls 4

GetGraphicsContextFunction · 0.85
GetWindowWidthFunction · 0.50
GetWindowHeightFunction · 0.50
GetMethod · 0.45

Tested by 1

TEST_FFunction · 0.68