I have a simple program on windows using visual studios 2008.
In my code i use gl functions i.e #include GLES2/gl2.h and also #include EGL/egl.h
In the code i use EGL for initialization for context. which is shown below.
It creates a window and CreateEGLContext.
I am not displaying my result on the screen. but storing in memory so i am not swapping display and surface buffer.
My issues you i want to remove egl.h from this code how is it possible.
Can anyone give me any idea. Thank you in advance
GLboolean CreateWindow1 ( ESContext *esContext, const char* title, GLint width, GLint height, GLuint flags )
{
GLuint attribList[] =
{
EGL_RED_SIZE, 5,
EGL_GREEN_SIZE, 6,
EGL_BLUE_SIZE, 5,
EGL_ALPHA_SIZE, (flags & ES_WINDOW_ALPHA) ? 8 : EGL_DONT_CARE,
EGL_DEPTH_SIZE, (flags & ES_WINDOW_DEPTH) ? 8 : EGL_DONT_CARE,
EGL_STENCIL_SIZE, (flags & ES_WINDOW_STENCIL) ? 8 : EGL_DONT_CARE,
EGL_SAMPLE_BUFFERS, (flags & ES_WINDOW_MULTISAMPLE) ? 1 : 0,
EGL_NONE
};
if ( esContext == NULL )
{
return GL_FALSE;
}
esContext->width = width;
esContext->height = height;
if ( !WinCreate ( esContext, title) )
{
return GL_FALSE;
}
if ( !CreateEGLContext ( esContext->hWnd, &esContext->eglDisplay, &esContext->eglContext, &esContext->eglSurface,
attribList) )
{
return GL_FALSE;
}
return GL_TRUE;
}
My answer is the solution i assume. or we can make our own framework if we want to or use any other framework 🙂
@Nicol Bolas: Thank you very much for your edits. I add OpenGL to my questions because someone doing OpenGL understand OpenGL ES as its a sub APL of OpenGL. I suggest you do better edits which would help. I lost ability to post question before of your multiple edits
EGL provides a “glue” layer between OpenGL ES 2.0 (and other Khronos graphics
APIs) and the native windowing system running on your computer, like the
X Window System common on GNU/Linux systems, Microsoft Windows, or
Mac OS X’s Quartz. Before EGL can determine what types of drawing surfaces,
or any other characteristics of the underlying system for that matter, it needs
to open a communications channel with the windowing system.
Because every windowing system has different semantics, EGL provides a
basic opaque type—the EGLDisplay—that encapsulates all of the system
dependencies for interfacing with the native windowing system. The first
operation that any application using EGL will need to do is create and initialize
a connection with the local EGL display.