OGLES 2 Native Android: eglCreateWindowSurface Arguments

I have a funny event with one application in development using OpenGL ES on native NDK C++ for Android. The program compiles and runs with no problem. However if I decide to make a unit test and debug the code, it complains with the following message:

Invalid arguments ' Candidates are: 
    void * eglCreateWindowSurface(void *, void *, unsigned long int, 
                                                         const int *) '

Which is related to the last line from the following code snapshot:

    EGLint lFormat, lNumConfigs, lErrorResult;
    EGLConfig lConfig;
    // Defines display requirements. 16bits mode here.
    const EGLint lAttributes[] = {
        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
        EGL_BLUE_SIZE, 5, EGL_GREEN_SIZE, 6, EGL_RED_SIZE, 5,
        EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
        EGL_NONE
    };
    // Retrieves a display connection and initializes it.
    packt_Log_debug("Connecting to the display.");
    mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    if (mDisplay == EGL_NO_DISPLAY) goto ERROR;
    if (!eglInitialize(mDisplay, NULL, NULL)) goto ERROR;
    // Selects the first OpenGL configuration found.
    packt_Log_debug("Selecting a display config.");
    if(!eglChooseConfig(mDisplay, lAttributes, &lConfig, 1,
        &lNumConfigs) || (lNumConfigs <= 0)) goto ERROR;
    // Reconfigures the Android window with the EGL format.
    packt_Log_debug("Configuring window format.");
    if (!eglGetConfigAttrib(mDisplay, lConfig,
        EGL_NATIVE_VISUAL_ID, &lFormat)) goto ERROR;
    ANativeWindow_setBuffersGeometry(mApplication->window, 0, 0, lFormat);
    // Creates the display surface.
    packt_Log_debug("Initializing the display.");
    mSurface = eglCreateWindowSurface(mDisplay, lConfig, mApplication->window, NULL);

I already looked on OGLES references, but all different things I tried did not work out yet.

Answers


Replacing 'mApplication->window' for 'EGLNativeWindowType window' solved the problem.


Need Your Help

kendo grid with foreign key without relations in database design

kendo-ui kendo-grid kendo-asp.net-mvc

I have a database without the relations between tables in SQL Server, but the data are relationated.

How to develop watch face with wearable app in android?

android android-wear watch-face-api

I am new in Android wearable app development and recently I came to know that Watch Face API is also now available for Android. So I want to develop wearable app of my mobile app and also I want to

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.