mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
BeefySysLib point/rect updates, async pipe fixes
This commit is contained in:
parent
81a9478e77
commit
fe1aa3c26e
32 changed files with 282 additions and 120 deletions
|
@ -737,9 +737,9 @@ void GLRenderDevice::PhysSetRenderState(RenderState* renderState)
|
|||
if (renderState->mClipped)
|
||||
{
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glScissor((GLsizei)renderState->mClipRect.mX,
|
||||
mPhysRenderWindow->mHeight - (GLsizei)renderState->mClipRect.mY - (GLsizei)renderState->mClipRect.mHeight,
|
||||
(GLsizei)renderState->mClipRect.mWidth, (GLsizei)renderState->mClipRect.mHeight);
|
||||
glScissor((GLsizei)renderState->mClipRect.x,
|
||||
mPhysRenderWindow->mHeight - (GLsizei)renderState->mClipRect.y - (GLsizei)renderState->mClipRect.height,
|
||||
(GLsizei)renderState->mClipRect.width, (GLsizei)renderState->mClipRect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -762,11 +762,11 @@ void DXDrawBatch::Render(RenderDevice* renderDevice, RenderWindow* renderWindow)
|
|||
return;
|
||||
|
||||
if ((mRenderState->mClipped) &&
|
||||
((mRenderState->mClipRect.mWidth == 0) || (mRenderState->mClipRect.mHeight == 0)))
|
||||
((mRenderState->mClipRect.width == 0) || (mRenderState->mClipRect.height == 0)))
|
||||
return;
|
||||
|
||||
if (mRenderState->mClipped)
|
||||
BF_ASSERT((mRenderState->mClipRect.mWidth > 0) && (mRenderState->mClipRect.mHeight > 0));
|
||||
BF_ASSERT((mRenderState->mClipRect.width > 0) && (mRenderState->mClipRect.height > 0));
|
||||
|
||||
DXRenderDevice* aRenderDevice = (DXRenderDevice*)renderDevice;
|
||||
/*if ((mDrawLayer->mRenderWindow != NULL) && (aRenderDevice->mPhysRenderWindow != mDrawLayer->mRenderWindow))
|
||||
|
@ -931,10 +931,10 @@ void DXRenderDevice::PhysSetRenderState(RenderState* renderState)
|
|||
if (renderState->mClipped)
|
||||
{
|
||||
D3D11_RECT rects[1];
|
||||
rects[0].left = (int)renderState->mClipRect.mX;
|
||||
rects[0].right = (int) (renderState->mClipRect.mX + renderState->mClipRect.mWidth);
|
||||
rects[0].top = (int) renderState->mClipRect.mY;
|
||||
rects[0].bottom = (int) (renderState->mClipRect.mY + renderState->mClipRect.mHeight);
|
||||
rects[0].left = (int)renderState->mClipRect.x;
|
||||
rects[0].right = (int) (renderState->mClipRect.x + renderState->mClipRect.width);
|
||||
rects[0].top = (int) renderState->mClipRect.y;
|
||||
rects[0].bottom = (int) (renderState->mClipRect.y + renderState->mClipRect.height);
|
||||
mD3DDeviceContext->RSSetScissorRects(1, rects);
|
||||
}
|
||||
setRasterizerState = true;
|
||||
|
@ -1383,9 +1383,9 @@ void DXRenderState::SetTexWrap(bool wrap)
|
|||
InvalidateRasterizerState();
|
||||
}
|
||||
|
||||
void DXRenderState::SetClipRect(const Rect& rect)
|
||||
void DXRenderState::SetClipRect(const RectF& rect)
|
||||
{
|
||||
BF_ASSERT((rect.mWidth >= 0) && (rect.mHeight >= 0));
|
||||
BF_ASSERT((rect.width >= 0) && (rect.height >= 0));
|
||||
mClipRect = rect;
|
||||
InvalidateRasterizerState();
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ public:
|
|||
|
||||
virtual void SetClipped(bool clipped);
|
||||
virtual void SetTexWrap(bool clipped);
|
||||
virtual void SetClipRect(const Rect& rect);
|
||||
virtual void SetClipRect(const RectF& rect);
|
||||
virtual void SetWriteDepthBuffer(bool writeDepthBuffer);
|
||||
virtual void SetDepthFunc(DepthFunc depthFunc);
|
||||
};
|
||||
|
|
|
@ -3016,6 +3016,9 @@ BFP_EXPORT BfpFile* BFP_CALLTYPE BfpFile_Create(const char* path, BfpFileCreateK
|
|||
if ((createFlags & BfpFileCreateFlag_NoBuffering) != 0)
|
||||
desiredAccess |= FILE_FLAG_NO_BUFFERING;
|
||||
|
||||
if ((createFlags & BfpFileCreateFlag_AllowTimeouts) != 0)
|
||||
attributes |= FILE_FLAG_OVERLAPPED;
|
||||
|
||||
HANDLE handle = ::CreateFileW(wPath.c_str(), desiredAccess, shareMode, NULL, creationDisposition, attributes, NULL);
|
||||
if (handle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
@ -3043,6 +3046,13 @@ BFP_EXPORT BfpFile* BFP_CALLTYPE BfpFile_Create(const char* path, BfpFileCreateK
|
|||
|
||||
BfpFile* bfpFile = new BfpFile();
|
||||
bfpFile->mHandle = handle;
|
||||
|
||||
if ((createFlags & BfpFileCreateFlag_AllowTimeouts) != 0)
|
||||
bfpFile->mAsyncData = new BfpAsyncData();
|
||||
|
||||
if ((createFlags & BfpFileCreateFlag_Pipe) != 0)
|
||||
bfpFile->mIsPipe = true;
|
||||
|
||||
return bfpFile;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue