-
-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D3D11: _create2DTex() with mSurface. #3273
base: master
Are you sure you want to change the base?
Conversation
@@ -232,46 +232,106 @@ namespace Ogre | |||
inline bool IsPowerOfTwo(unsigned int n) { return ((n&(n-1))==0); } | |||
//--------------------------------------------------------------------- | |||
void D3D11Texture::_create2DTex() | |||
{ | |||
if (NULL != mSurface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of if else around everything I suggest you do:
if(mSurface)
{
_createShared2DTex();
return;
}
@@ -625,4 +687,6 @@ namespace Ogre | |||
{ | |||
rebind(static_cast<D3D11HardwarePixelBuffer*>(mBuffer)); | |||
} | |||
} | |||
//--------------------------------------------------------------------- | |||
void D3D11RenderTexture::doFlush() { mDevice.Flush(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you remove this for now. It should be part of RenderSystem as it not only affects this single texture.
Also see my comment on the forums. Maybe we do not need this at all.
hr = pUnk->QueryInterface(__uuidof(IDXGIResource), (void**)&pDXGIResource); | ||
if (FAILED(hr)) | ||
{ | ||
throw std::runtime_error("Failed to query IDXGIResource interface from the provided object."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the OGRE_EXCEPT_EX
macro instead of throwing directly
Created a variable called mSurface that can be used to create a texture from an already existing surface. Inside the _create2DTex() function, there is an if statement to check whether this variable exists or not. If it exists, it will be manipulated to be used as an Ogre texture.