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