hostsupport/hostopengles11/inc/EGLInterface.h
branchbug235_bringup_0
changeset 53 c2ef9095503a
child 67 ca7e6949bf7a
equal deleted inserted replaced
52:39e5f73667ba 53:c2ef9095503a
       
     1 /* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2  *
       
     3  * Permission is hereby granted, free of charge, to any person obtaining a
       
     4  * copy of this software and /or associated documentation files
       
     5  * (the "Materials "), to deal in the Materials without restriction,
       
     6  * including without limitation the rights to use, copy, modify, merge,
       
     7  * publish, distribute, sublicense, and/or sell copies of the Materials,
       
     8  * and to permit persons to whom the Materials are furnished to do so,
       
     9  * subject to the following conditions:
       
    10  *
       
    11  * The above copyright notice and this permission notice shall be included
       
    12  * in all copies or substantial portions of the Materials.
       
    13  *
       
    14  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
    15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
    16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
       
    17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
       
    18  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
       
    19  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
       
    20  * THE USE OR OTHER DEALINGS IN THE MATERIALS.
       
    21  *
       
    22  * Initial Contributors:
       
    23  * Nokia Corporation - initial contribution.
       
    24  *
       
    25  * Contributors:
       
    26  *
       
    27  * Description:
       
    28  *
       
    29  */
       
    30 
       
    31 #ifndef _EGLINTERFACE_H_
       
    32 #define _EGLINTERFACE_H_
       
    33 
       
    34 #include "GLESInterface.h"
       
    35 #include "glesInternal.h"
       
    36 #include <set>
       
    37 
       
    38 extern "C"
       
    39 {
       
    40 GLES_API_CALL IEGLtoGLESInterface* getGLESInterface(void);
       
    41 
       
    42 void glesReleaseTexImage(void* surface, int name, int level);
       
    43 }
       
    44 
       
    45 class GLESContext;
       
    46 
       
    47 class EGLtoGLESInterface : public IEGLtoGLESInterface
       
    48 {
       
    49 public:
       
    50     EGLtoGLESInterface();
       
    51 
       
    52     void SetEGLInterface(IGLEStoEGLInterface* egl);
       
    53 	void* CreateContext(void* nativeContext);
       
    54 	bool ReleaseContext(void* context);
       
    55 	void* GetNativeContext(void* context);
       
    56 	fpGLProc GetGLProcAddress( const char *procname );
       
    57     int BindTexImage( void* surface, int level, bool generateMipmap, const SurfaceDescriptor* desc, void* buffer );
       
    58 	bool ReleaseTexImage( int name, int level );
       
    59     bool CopyBuffers( void* buf, const SurfaceDescriptor* desc );
       
    60     bool UpdateBuffers( void* buf, const SurfaceDescriptor* desc );
       
    61     void Flush();
       
    62     void Finish();
       
    63 
       
    64 	// Methods for local OpenGL ES -implementation. To be called only from OpenGL ES internals.
       
    65     static IGLEStoEGLInterface* GetEGLInterface();
       
    66 
       
    67 private:
       
    68     IGLEStoEGLInterface* m_egl;
       
    69 	std::set<GLESContext*> m_contexts;
       
    70 };
       
    71 
       
    72 #endif // _EGLINTERFACE_H_