screenprojection helper in device
This commit is contained in:
@@ -304,7 +304,7 @@ void wiFont::Draw(GRAPHICSTHREAD threadID, bool scissorTest){
|
||||
ConstantBuffer cb;
|
||||
cb.mTransform = XMMatrixTranspose(
|
||||
XMMatrixTranslation(newProps.posX, newProps.posY, 0)
|
||||
* XMMatrixOrthographicOffCenterLH(0, (float)device->GetScreenWidth(), (float)device->GetScreenHeight(), 0, -1, 1)
|
||||
* device->GetScreenProjection()
|
||||
);
|
||||
|
||||
device->UpdateBuffer(constantBuffer,&cb,threadID);
|
||||
|
||||
@@ -68,6 +68,11 @@ namespace wiGraphicsTypes
|
||||
};
|
||||
virtual bool CheckCapability(GRAPHICSDEVICE_CAPABILITY capability) = 0;
|
||||
|
||||
XMMATRIX GetScreenProjection()
|
||||
{
|
||||
return XMMatrixOrthographicOffCenterLH(0, (float)GetScreenWidth(), (float)GetScreenHeight(), 0, -1, 1);
|
||||
}
|
||||
|
||||
///////////////Thread-sensitive////////////////////////
|
||||
|
||||
virtual void BindViewports(UINT NumViewports, const ViewPort *pViewports, GRAPHICSTHREAD threadID = GRAPHICSTHREAD_IMMEDIATE) = 0;
|
||||
|
||||
@@ -280,7 +280,7 @@ void wiImage::Draw(Texture2D* texture, const wiImageEffects& effects,GRAPHICSTHR
|
||||
XMMatrixScaling(effects.scale.x*effects.siz.x, effects.scale.y*effects.siz.y, 1)
|
||||
* XMMatrixRotationZ(effects.rotation)
|
||||
* XMMatrixTranslation(effects.pos.x, effects.pos.y, 0)
|
||||
* XMMatrixOrthographicOffCenterLH(0, (float)device->GetScreenWidth(), (float)device->GetScreenHeight(), 0, -1, 1)
|
||||
* device->GetScreenProjection()
|
||||
);
|
||||
}
|
||||
else if(effects.typeFlag==WORLD){
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace wiVersion
|
||||
// minor features, major bug fixes
|
||||
const int minor = 8;
|
||||
// minor bug fixes, alterations, refactors
|
||||
const int revision = 48;
|
||||
const int revision = 49;
|
||||
|
||||
|
||||
long GetVersion()
|
||||
|
||||
@@ -1116,7 +1116,7 @@ void wiColorPicker::Render(wiGUI* gui)
|
||||
|
||||
}
|
||||
|
||||
XMMATRIX __cam = XMMatrixOrthographicOffCenterLH(0, (float)wiRenderer::GetDevice()->GetScreenWidth(), (float)wiRenderer::GetDevice()->GetScreenHeight(), 0, -1, 1);
|
||||
XMMATRIX __cam = wiRenderer::GetDevice()->GetScreenProjection();
|
||||
|
||||
wiRenderer::GetDevice()->BindConstantBufferVS(wiRenderer::constantBuffers[CBTYPE_MISC], CBSLOT_RENDERER_MISC, threadID);
|
||||
wiRenderer::GetDevice()->BindRasterizerState(wiRenderer::rasterizers[RSTYPE_DOUBLESIDED], threadID);
|
||||
|
||||
Reference in New Issue
Block a user