MCPcopy Create free account
hub / github.com/baldurk/renderdoc / GetPickedLocation

Method GetPickedLocation

qrenderdoc/Windows/TextureViewer.cpp:3925–3947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3923}
3924
3925rdcpair<int32_t, int32_t> TextureViewer::GetPickedLocation()
3926{
3927 TextureDescription *texptr = GetCurrentTexture();
3928
3929 if(texptr)
3930 {
3931 QPoint p = m_PickedPoint;
3932
3933 p.setX(MipCoordFromBase(p.x(), texptr->width));
3934 p.setY(MipCoordFromBase(p.y(), texptr->height));
3935
3936 uint32_t mipHeight = qMax(1U, texptr->height >> (int)m_TexDisplay.subresource.mip);
3937
3938 if(ShouldFlipForGL())
3939 p.setY((int)(mipHeight - 1) - p.y());
3940 if(m_TexDisplay.flipY)
3941 p.setY((int)(mipHeight - 1) - p.y());
3942
3943 return {p.x(), p.y()};
3944 }
3945
3946 return {-1, -1};
3947}
3948
3949void TextureViewer::ShowGotoPopup()
3950{

Callers

nothing calls this directly

Calls 5

MipCoordFromBaseFunction · 0.85
setXMethod · 0.45
xMethod · 0.45
setYMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected