PDA

View Full Version : Trying to Create an OpenGL ES Context on Windows (HELP)



areid0401
10-11-2017, 10:57 AM
I am currently working on a multi-platform rendering library (for desktops and mobile devices) that is intended to use OpenGL ES (3.0 if possible). This project is intended not to use wrappers like GLEW, GLFW, ANGLE, etc. but if they are required to solve this issue please let me know. I am including GLES3/gl3.h as my gl interface, but no external libraries are being linked. (If there is a GLES or gl3 library that I should be linking, I have not found them yet. Point me in the right direction!)

Right now, I am working on the Windows implementation and I am having issues trying to figure out if the context I created is an ES context.

I am using "wglCreateContextAttribsARB" to create the context, and this is the attribute list that I am sending to the call:

const int contextAttribList[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 2,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_ES2_PROFILE_BIT_EXT,
0,
};

I get no issues creating the context with these values, and I am able to do some basic color changing to the screen with simple gl calls. I am just uncertain if the context being created is an ES context. Once it is created, I try to make a call specific to OpenGL ES, and I get a linker error. (Presumably because I am not linking any libraries which means there are no implementations for the functions in the header files...as stated earlier, I have searched far and wide but have not come across any libs or .cpps for these GLES3 header files)

Also, immediately after creating the context, I do a check to see the profile of the context:

GLint profile = 0; glGetIntegerv(WGL_CONTEXT_PROFILE_MASK_ARB, &profile);

The output of this profile is 2. However, if I create the context using "WGL_CONTEXT_ES_PROFILE_BIT_EXT" as the context_profile_mask instead of "WGL_CONTEXT_ES2_PROFILE_BIT_EXT", the profile's output is still 2.

Upon research, I was under the impression that including the "WGL_CONTEXT_ES2_PROFILE_BIT_EXT" for the profile mask is what marks the context as an es context, but I am not sure if this is correct. That es2_profile_bit flag is the only part of my initialization that has any reference of "ES", everything else is basic gl/wgl calls. Also, I saw that there is an extension "WGL_EXT_create_context_es2_profile" which sounds like something I should be using, but I am not seeing how or where I should use it. Finally, I read that OpenGL ES is exposed differently depending on the graphics card on the machine. (I am currently using an Intel HD Graphics 4600)

If anyone has any advice please help!
Thank you.