Skip to content
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

Exception when creating surface with collapsed swapchainpanel and fixed scale #72

Closed
teshca opened this issue Jul 28, 2016 · 3 comments
Closed

Comments

@teshca
Copy link

teshca commented Jul 28, 2016

In demo app

  1. add visibility collapsed to xaml
    <SwapChainPanel x:Name="swapChainPanel" Visibility="Collapsed" >
  2. specify any scale in CreateRenderSurface
    float customResolutionScale = 1.0f;
    mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, nullptr, &customResolutionScale);

Run application after this two steps, you will get an exception "Can't create surface"

The problem is that in function

HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &windowSize, const RECT &clientRect)

we do not check size fo zero and get NaN in here

Size renderScale = {(float)windowSize.cx / (float)clientRect.right, (float)windowSize.cy / (float)clientRect.bottom};

@teshca
Copy link
Author

teshca commented Jul 28, 2016

This is only valid for surface creation. We also call this fuction when sizeChanged event fired but we never check if the result was a SUCCESS in that case

@austinkinross
Copy link
Member

Hi there, thanks for reporting this!

We've been snowed under with other work recently, but we will try to investigate this soon.

@austinkinross
Copy link
Member

Hi there, apologies for the delay here. If you are still having trouble with this then please consider contacting the master ANGLE mailing list: https://groups.google.com/forum/#!forum/angleproject

Thanks
Austin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants