Exemplo n.º 1
0
bool CGLContextEGL::CreateSurface(wayland::surface_t const& surface, CSizeInt size)
{
  m_nativeWindow = wayland::egl_window_t(surface, size.Width(), size.Height());

  m_eglSurface = m_eglCreatePlatformWindowSurfaceEXT(m_eglDisplay,
                                                     m_eglConfig,
                                                     m_nativeWindow, nullptr);

  if (m_eglSurface == EGL_NO_SURFACE)
  {
    CEGLUtils::LogError("Failed to create EGL platform window surface");
    return false;
  }

  const EGLint context_atrribs[] = {
    EGL_CONTEXT_CLIENT_VERSION, 2,
    EGL_NONE
  };

  m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig,
                                  EGL_NO_CONTEXT, context_atrribs);

  if (m_eglContext == EGL_NO_CONTEXT)
  {
    CEGLUtils::LogError("Failed to create EGL context");
    return false;
  }

  if (eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext) != EGL_TRUE)
  {
    CEGLUtils::LogError("Failed to make context current");
    return false;
  }

  return true;
}
void CWinSystemWaylandEGLContextGLES::SetContextSize(CSizeInt size)
{
  CWinSystemWaylandEGLContext::SetContextSize(size);

  // Propagate changed dimensions to render system if necessary
  if (CRenderSystemGLES::m_width != size.Width() || CRenderSystemGLES::m_height != size.Height())
  {
    CLog::LogF(LOGDEBUG, "Resetting render system to %dx%d", size.Width(), size.Height());
    CRenderSystemGLES::ResetRenderSystem(size.Width(), size.Height());
  }
}
Exemplo n.º 3
0
void CGLContextEGL::Resize(CSizeInt size)
{
  m_nativeWindow.resize(size.Width(), size.Height(), 0, 0);
}