MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / drawTexture

Method drawTexture

src/ui/View.cpp:143–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void View::drawTexture(uint8_t id, int x, int y, int width, int height, int surfaceWidth, int surfaceHeight,
144 bgfx::TextureHandle texture, bgfx::ProgramHandle program, bgfx::UniformHandle texUniform)
145{
146 if (bgfx::isValid(texture))
147 {
148 //extern bgfx::ProgramHandle imguiGetImageProgram(uint8_t _mip);
149 //bgfx::ProgramHandle program = imguiGetImageProgram(0);
150
151 //imguiBeginArea("Picking Render Target:", x, y, width, height);
152 //imguiImage(texture, 0, width, height);
153
154 float ortho[16];
155 bx::mtxOrtho(ortho, 0.0f, (float)surfaceWidth, (float)surfaceHeight, 0.0f, 0.0f, 1000.0f, 0.0f, bgfx::getCaps()->homogeneousDepth);
156 bgfx::setViewTransform(id, NULL, ortho);
157 bgfx::setViewRect(id, 0, 0, surfaceWidth, surfaceHeight);
158
159 if (ViewUtil::screenQuad(x, y, width, height))
160 {
161 bgfx::setTexture(0, texUniform, texture);
162 bgfx::setState(BGFX_STATE_RGB_WRITE | BGFX_STATE_ALPHA_WRITE | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA));
163
164 //bgfx::setScissor(uint16_t(std::max(0, x)), uint16_t(std::max(0, y)), width, height
165 //);
166
167 //setCurrentScissor();
168 bgfx::submit(id, program);
169 }
170 }
171
172 //imguiEndArea();
173}
174
175Math::float2 View::getAbsoluteTranslation()
176{

Callers

nothing calls this directly

Calls 1

screenQuadFunction · 0.85

Tested by

no test coverage detected