Update surfman to 0.2 and remove glutin

This commit is contained in:
Alan Jeffrey 2020-01-09 17:28:46 -06:00
parent 9dbc6554f0
commit 8bb1732258
94 changed files with 2265 additions and 1513 deletions

View file

@ -187,51 +187,3 @@ void OpenGLES::Reset() {
Cleanup();
Initialize();
}
EGLSurface OpenGLES::CreateSurface(SwapChainPanel const &panel, float dpi) {
EGLSurface surface = EGL_NO_SURFACE;
const EGLint surfaceAttributes[] = {EGL_NONE};
PropertySet surfaceCreationProperties;
surfaceCreationProperties.Insert(EGLNativeWindowTypeProperty, panel);
// How to set size and or scale:
// Insert(EGLRenderSurfaceSizeProperty),
// PropertyValue::CreateSize(*renderSurfaceSize));
surfaceCreationProperties.Insert(EGLRenderResolutionScaleProperty,
PropertyValue::CreateSingle(dpi));
EGLNativeWindowType win = static_cast<EGLNativeWindowType>(
winrt::get_abi(surfaceCreationProperties));
surface =
eglCreateWindowSurface(mEglDisplay, mEglConfig, win, surfaceAttributes);
if (surface == EGL_NO_SURFACE) {
throw winrt::hresult_error(E_FAIL, L"Failed to create EGL surface");
}
return surface;
}
void OpenGLES::GetSurfaceDimensions(const EGLSurface surface, EGLint *width,
EGLint *height) {
eglQuerySurface(mEglDisplay, surface, EGL_WIDTH, width);
eglQuerySurface(mEglDisplay, surface, EGL_HEIGHT, height);
}
void OpenGLES::DestroySurface(const EGLSurface surface) {
if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE) {
eglDestroySurface(mEglDisplay, surface);
}
}
void OpenGLES::MakeCurrent(const EGLSurface surface) {
if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE) {
throw winrt::hresult_error(E_FAIL, L"Failed to make EGLSurface current");
}
}
EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface) {
return (eglSwapBuffers(mEglDisplay, surface));
}