--
You received this message because you are subscribed to the Google Groups "angleproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angleproject...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If ANGLE supported the EGL_KHR_surfaceless_context
and
GL_OES_surfaceless_context
extensions then you could simply pass EGL_NO_SURFACE to
eglMakeCurrent() as the read and draw surfaces. Absent that you
have to create a throwaway surface, typically a 1x1 pbuffer
surface, that you pass as the surface arguments to
eglMakeCurrent(). The extensions were created to support exactly
the use case you have.
Any chance of ANGLE supporting these?
I am in fact rendering it an off-screen FBO. I read that FBOs are preferable to pbuffers.On the other hand, if I understand correctly, FBOs have nothing to do directly with the EGL, whereas your suggestion is an EGL function.
Correct but you have to use EGL to create the GL context and to make that context current so making a pbuffer is only a little extra, though annoying, work.
I'm currently prototyping and experimenting with ANGLE on Windows with C/C++, but ultimately, targeting iOS and Android (preferably still using C/C++).
Android also uses EGL and recent versions may support the above
extensions. So your EGL work will not be wasted.
iOS does not use EGL. It also does not have surfaces. It uses only FBO's. To get your rendering displayed on the screen a special renderbuffer must be attached to the FBO. I do not think it is necessary to create one of these special renderbuffers in order to make a context current.
Will using eglCreatePbufferSurface avoid the need for an OS related window?
Yes.
Regards
-Mark
NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.
If ANGLE supported the EGL_KHR_surfaceless_context and GL_OES_surfaceless_context extensions then you could simply pass EGL_NO_SURFACE to eglMakeCurrent() as the read and draw surfaces. Absent that you have to create a throwaway surface, typically a 1x1 pbuffer surface, that you pass as the surface arguments to eglMakeCurrent(). The extensions were created to support exactly the use case you have.Any chance of ANGLE supporting these?
Hi Mark,
Thanks for the suggestions. I just stated re-learning OpenGL (ES + shaders) after more than 15 years away from graphics.Do you happen to have an example that shows what you are suggesting?
You previously wrote
While this works fine, I still have to open a window even though nothing is displayed in it.
So presumably you are using eglCreateWindowSurface to create that
window. Just use eglCreatePbufferSurface instead. For attrib_list
you'll want
EGLint attrib_list[] = {EGL _HEIGHT, 1, EGL_WIDTH, 1, 0};
While this works fine, I still have to open a window even though nothing is displayed in it.So presumably you are using eglCreateWindowSurface to create that window. Just use eglCreatePbufferSurface instead. For attrib_list you'll want
EGLint attrib_list[] = {EGL _HEIGHT, 1, EGL_WIDTH, 1, 0};
Hi Mark,
My code is based on the sample code which uses the EGLWindow held as a unique_ptr by the SampleApplication class.The point of use is in EGLWindow::initializeGL(const OSWindow *osWindow).The method initializeGL() does quite a lot of stuff before the call to eglCreateWindowSurface(), so I don't really know what to do if I don't have an osWindow. What do I keep what do I toss, how do I initialize other things?
How would I modify EGLWindow::initializeGL() to do windowless rendering, say when osWindow is nullptr (or via a new initializeGL() that does not accept an osWindow ptr at all?
Sorry for the delay. I was on vacation.
osWindow is only needed for getting the EGLDisplay to pass to
eglInitialize, which is an EGL extension, and for creating a
window surface. In theory the eglGetPlatformDisplayEXT stuff
should not be needed and you should be able to start your
initialization code with
if (!eglInitialize(EGL_DEFAULT_DISPLAY, &majorVersion,
&minorVersion)) {
...
Whether the theory holds true for ANGLE's EGL I do not know.
You can then replace
const EGLint surfaceAttributes[] = { EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_TRUE, // Why does ANGLE's sample require an NVIDIA extension? EGL_NONE, EGL_NONE, }; mSurface = eglCreateWindowSurface(mDisplay, mConfig, osWindow->getNativeWindow(), surfaceAttributes);
with
const EGLint pbufferAttributes[] = { EGL _HEIGHT, 1, EGL_WIDTH, 1, EGL_NONE, }; mSurface = eglCreatePbufferSurface(mDisplay, mconfig, pbufferAttributes);
Depending on what else your application is doing, it may or may
not need an OS window. That is a separate issue from windowless
rendering. E.g, you'll need one if you want handle mouse or touch
input or need to display something other than text.
Sorry for the delay. I was on vacation.
osWindow is only needed for getting the EGLDisplay to pass to eglInitialize, which is an EGL extension, and for creating a window surface. In theory the eglGetPlatformDisplayEXT stuff should not be needed and you should be able to start your initialization code with
if (!eglInitialize(EGL_DEFAULT_DISPLAY, &majorVersion, &minorVersion)) {
...
Whether the theory holds true for ANGLE's EGL I do not know.
if (dpy == EGL_NO_DISPLAY)
{
return egl::error(EGL_BAD_DISPLAY, EGL_FALSE);
}
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
bool EGLWindow::initializeGL(){mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);if (mDisplay == EGL_NO_DISPLAY){destroyGL();return false;}EGLint majorVersion, minorVersion;if (!eglInitialize(mDisplay, &majorVersion, &minorVersion)){destroyGL();return false;}eglBindAPI(EGL_OPENGL_ES_API);if (eglGetError() != EGL_SUCCESS){destroyGL();return false;}const EGLint configAttributes[] ={EGL_RED_SIZE, 8,EGL_GREEN_SIZE, 8,EGL_BLUE_SIZE, 8,EGL_ALPHA_SIZE, 8,EGL_DEPTH_SIZE, 24,EGL_STENCIL_SIZE, 8,EGL_SAMPLE_BUFFERS, EGL_DONT_CARE,EGL_NONE};EGLint configCount;if (!eglChooseConfig(mDisplay, configAttributes, &mConfig, 1, &configCount) || (configCount != 1)){destroyGL();return false;}const EGLint pbufferAttributes[] ={EGL_HEIGHT, 1,EGL_WIDTH, 1,EGL_NONE,};mSurface = eglCreatePbufferSurface(mDisplay, mConfig, pbufferAttributes);if (mSurface == EGL_NO_SURFACE){eglGetError(); // Clear error and try againmSurface = eglCreateWindowSurface(mDisplay, mConfig, NULL, NULL);}if (eglGetError() != EGL_SUCCESS){destroyGL();return false;}EGLint contextAttibutes[] ={EGL_CONTEXT_CLIENT_VERSION, mClientVersion,EGL_NONE};mContext = eglCreateContext(mDisplay, mConfig, NULL, contextAttibutes);if (eglGetError() != EGL_SUCCESS){destroyGL();return false;}eglMakeCurrent(mDisplay, mSurface, mSurface, mContext);if (eglGetError() != EGL_SUCCESS){destroyGL();return false;}// Turn off vsynceglSwapInterval(mDisplay, 0);return true;}
--
You received this message because you are subscribed to a topic in the Google Groups "angleproject" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angleproject/VsiiLl9vuD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angleproject...@googlegroups.com.