egl/egltest/endpointtestsuite/automated/inc/eglendpointwrap.h
changeset 98 bf7481649c98
child 136 62bb7c97884c
equal deleted inserted replaced
85:cdf2f6e5c390 98:bf7481649c98
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 
       
    13 
       
    14 /**
       
    15  @file
       
    16  @test
       
    17  @internalComponent - Internal Symbian test code
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __EGLENDPOINTWRAP_H__
       
    22 #define __EGLENDPOINTWRAP_H__
       
    23 
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <EGL/egl.h>
       
    27 #include <EGL/eglext.h>
       
    28 
       
    29 
       
    30 //generic function pointer
       
    31 typedef void (*TAnyFuncPtr)(...);
       
    32 
       
    33 
       
    34 /*
       
    35  * TEglEndpointWrap is a simple class that presents all of the EGL endpoint
       
    36  * extension functions without the user needing to perform an eglGetProcAddress()
       
    37  * to obtain the function pointer. Each endpoint member function takes the same
       
    38  * arguments as the EGL functions and returns the same types. After before first
       
    39  * use, you should check the Error() function to ensure that all function pointers
       
    40  * were resolved. Trying to use one of the endpoint functions in the event of a
       
    41  * construction error will result in a panic.
       
    42  */
       
    43 class TEglEndpointWrap : public CBase
       
    44     {
       
    45 public:
       
    46     TEglEndpointWrap();
       
    47     TInt Error() const;
       
    48 
       
    49     //endpoint functions
       
    50     EGLEndpointNOK CreateEndpoint(EGLDisplay dpy, EGLenum type, EGLenum source_type, EGLEndpointSourceNOK source, const EGLint *attrib_list) const;
       
    51     EGLBoolean DestroyEndpoint(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
       
    52     EGLint GetEndpointAttrib(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib) const;
       
    53     EGLBoolean SetEndpointAttrib(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib, EGLint value) const;
       
    54     EGLBoolean EndpointBeginStreaming(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
       
    55     EGLBoolean EndpointEndStreaming(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
       
    56     EGLImageKHR AcquireImage(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
       
    57     EGLBoolean ReleaseImage(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLImageKHR image, EGLenum api) const;
       
    58     EGLint GetEndpointDirtyArea(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint* rects, EGLint start_rect, EGLint max_rects, EGLBoolean collapse) const;
       
    59     EGLBoolean EndpointRequestNotification(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLTRequestStatusNOK sync) const;
       
    60     EGLBoolean EndpointCancelNotification(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
       
    61     EGLBoolean DestroyImage(EGLDisplay dpy, EGLImageKHR image) const;
       
    62 
       
    63 private:
       
    64     TAnyFuncPtr ProcAddressL(const char* aProcName) const;
       
    65 
       
    66 private:
       
    67     TInt iError;
       
    68 
       
    69     //enpoint function pointers
       
    70     PFNEGLCREATEENDPOINTNOKPROC ipfnEglCreateEndpointNOK;
       
    71     PFNEGLDESTROYENDPOINTNOKPROC ipfnEglDestroyEndpointNOK;
       
    72     PFNEGLGETENDPOINTATTRIBNOKPROC ipfnEglGetEndpointAttribNOK;
       
    73     PFNEGLSETENDPOINTATTRIBNOKPROC ipfnEglSetEndpointAttribNOK;
       
    74     PFNEGLENDPOINTBEGINSTREAMINGNOKPROC ipfnEglEndpointBeginStreamingNOK;
       
    75     PFNEGLENDPOINTENDSTREAMINGNOKPROC ipfnEglEndpointEndStreamingNOK;
       
    76     PFNEGLACQUIREIMAGENOKPROC ipfnEglAcquireImageNOK;
       
    77     PFNEGLRELEASEIMAGENOKPROC ipfnEglReleaseImageNOK;
       
    78     PFNEGLGETENDPOINTDIRTYAREANOKPROC ipfnEglGetEndpointDirtyAreaNOK;
       
    79     PFNEGLENDPOINTREQUESTNOTIFICATIONNOKPROC ipfnEglEndpointRequestNotificationNOK;
       
    80     PFNEGLENDPOINTCANCELNOTIFICATIONNOKPROC ipfnEglEndpointCancelNotificationNOK;
       
    81     PFNEGLDESTROYIMAGEKHRPROC ipfnEglDestroyImageKHR;
       
    82     };
       
    83 
       
    84 
       
    85 #endif