Page 1 of 3

Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Mon Jul 25, 2016 07:30
by sh.song
Hi CEGUI Team! I use CEGUI very well. Thanks.
Can I ask about Epoxy and GL3 Renderer?
I need CEGUI OpenGLES2 Renderer, so I build Epoxy library, use Cmake, and build CEGUI, too.
But I think, CEGUI doesn't use GLES2 library;like libEGL, libGLES2.
Please watch this code.

void OpenGLInfo::initTypeAndVer()
{
#if defined CEGUI_USE_EPOXY
d_type = epoxy_is_desktop_gl() ? TYPE_DESKTOP : TYPE_ES;


This is GL.cpp, CEGUI::OpenInfo::initTypeAndVer function. If I use GLES2, d_type should be TYPE_ES right? But, My case, d_type is TYPE_DESKTOP.:cry: and throw error message;Failed to obtain desktop OpenGL version.

So I check everything, I use glfw3, and Epoxy. Epoxy use Powervr's EGL and GLES2.

Maybe Epoxy or GLFW3's problem..but I cannot solve.
Have you any idea? I'll wait reply. :P

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Mon Jul 25, 2016 10:42
by YaronCT
@sh.song: The official Epoxy is currently no longer mainteined. Plz use my fork of Epoxy (Use branch "master" - not a release) - it can be easily built as a static or shared library using cmake, including running tests, and doesn't depend on "eglplatform.h" or "khrplatform.h". Tell me if the problem persists. Also plz specify your platform and compiler.

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Tue Jul 26, 2016 01:01
by sh.song
I'm using Window 7, VS2013. Also, when I get solution file of Epoxy, My Cmake option is VS2013 32bit.
I'm already use your fork, but I'll try build epoxy with this option; "-DEPOXY_REBUILD_FROM_SPECS=ON" , "-DEPOXY_BUILD_STATIC=ON" , "-DEPOXY_BUILD_SHARED=OFF" ,"-DEPOXY_BUILD_TESTS=OFF", "-DEPOXY_MSVC_USE_RUNTIME_LIBRARY_DLL=OFF". Thanks!
And can i ask you;how to build glfw3 for use CEGUI? I apply this option when I build glfw3;"-DGLFW_USE_EGL=ON -DGLFW_CLIENT_LIBRARY=glesv2".
Is it right? anything I should other?

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Tue Jul 26, 2016 10:55
by YaronCT
@sh.song: Do u try to run the cegui sample framework, or another app?

When u create the cegui renderer, is the OpenGL ES context already created *and made the current context*?

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Wed Jul 27, 2016 01:47
by sh.song
Hi Yaron, Thanks for your kind.
I'm running CEGUI SampleFramework!
Unfortunately, when I build CEGUI SampleFramework, it has error;"Failed to obtain desktop OpenGL version."
And in Epoxy, EGLDisplay-EGLContext-EGLint all NULL! Problem is this function.
epoxy_egl_get_current_gl_context_api(void)
{
EGLDisplay eglDisplay = eglGetCurrentDisplay();
EGLContext eglContext = eglGetCurrentContext();
EGLint eglContextClientType = EGL_NONE;
return eglQueryContext(eglDisplay, eglContext, EGL_CONTEXT_CLIENT_TYPE,
&eglContextClientType) == EGL_TRUE
? (EGLenum)eglContextClientType
: EGL_NONE;
}

My think, I link glfw3 at CEGUI. So I use CEGuiGLFWSharedBase. and when CEGuiGLFWSharedBase class is initialized, that class use this function;initGLFW.
I debugging initGLFW, I find this function;glfwDefaultWindowHints(). Maybe this funtion is initialized glfw by opengl;like this.
void glfwDefaultWindowHints(void)
{
_GLFW_REQUIRE_INIT();

memset(&_glfw.hints, 0, sizeof(_glfw.hints));

// The default is OpenGL with minimum version 1.0
_glfw.hints.context.client = GLFW_OPENGL_API;
_glfw.hints.context.source = GLFW_NATIVE_CONTEXT_API;
_glfw.hints.context.major = 1;
_glfw.hints.context.minor = 0;


How are you thinking? anything I should do in Epoxy, GLFW3, and CEGUI?
Should I create EGL or GLES2 context?
I'll wait your apply, Thanks.

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Wed Jul 27, 2016 08:44
by YaronCT
@sh.song: Which GLFW version?

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Wed Jul 27, 2016 08:57
by sh.song
https://github.com/glfw/glfw
I use this;download master branch by zip file.

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Wed Jul 27, 2016 09:00
by YaronCT
@sh.song: exact version plz. Seems like things have changed between 3.1 and 3.2.

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Wed Jul 27, 2016 09:02
by sh.song
specific version is 3.2
The current version is 3.2, which was released on June 2, 2016 . See the version history for a list of changes. << right?

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Wed Jul 27, 2016 16:00
by YaronCT
@sh.song: Plz make sure u use the latest version of PowerVR SDK and Tools (currently 2016 R1.2). Plz tell me the full path where PowerVR SDK and Tools 2016 R1.2 is installed. Plz tell me the full value of the "PATH" environment variable just b4 u run the sample framework (e.g. run in a command prompt "echo %PATH%").

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Thu Jul 28, 2016 00:36
by sh.song
My PowerVR is 2016.R1.2 version. And I use PowerVR 32bit library.
SDK path : C:\Imagination\PowerVR_Graphics\PowerVR_SDK\SDK_2016_R1.2\Builds\Windows\x86_32\Lib
Tool path : C:\Imagination\PowerVR_Graphics\PowerVR_Tools\PVRVFrame\Library\Windows_x86_32
Path environment variable : C:\Imagination\PowerVR_Graphics\PowerVR_Tools\PVRVFrame\Library\Windows_x86_32;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common

Thanks for your kind

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Thu Jul 28, 2016 11:06
by YaronCT
@sh.song: I'm pretty clueless here, coz for me it works (on linux), and I don't have Windows to test on. R u able to run any program at all, that uses OpenGL ES? (without cegui). E.g. just a small test program that uses GLFW to initialize OpenGL ES and do nothing else.

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Thu Jul 28, 2016 11:34
by YaronCT
@sh.song: Also, plz make sure your video card driver is up to date.

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Thu Jul 28, 2016 15:13
by sh.song
I'm fine PowerVR OpenGLES2 sample running. It works success.
I cannot find GLFW Sample which use OpenGLES2, Is it build by cmake?

Re: Problem at CEGUI GL3(OpenGLES2) Renderer

Posted: Thu Jul 28, 2016 20:06
by YaronCT
@sh.song: Try this:

[main.cpp]

Code: Select all

#include <cassert>
#include <GLFW/glfw3.h>

int main (int argc, char *argv[]) {
    GLFWwindow* window = 0;
    bool bOk = glfwInit();
    assert(bOk);
    glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
    window = glfwCreateWindow(1024, 768, "My Window", 0, 0);
    assert(window);
    glfwMakeContextCurrent(window);
    glfwSwapInterval(1);
    do {
        glClearColor(0, 0, 1, 1);
        glClear(GL_COLOR_BUFFER_BIT);
        glfwSwapBuffers(window);
        glfwPollEvents();
      }
        while (    (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS)
               &&  (glfwWindowShouldClose(window) == 0));
    glfwTerminate();
    }


[CMakeLists.txt]

Code: Select all

cmake_minimum_required( VERSION 2.8.12 )
project( my-test )
find_package( GLFW )
find_package( OpenGL )
add_executable( my-test main.cpp )
target_include_directories( my-test PRIVATE ${GLFW_INCLUDE_DIR} )
target_link_libraries( my-test PRIVATE ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY})