openvg/openvgrefimplementation/sfopenvg/sfopenvg/riMiniEGL.h
branchEGL_MERGE
changeset 217 205d3af68142
parent 216 b87045f2f5d7
--- a/openvg/openvgrefimplementation/sfopenvg/sfopenvg/riMiniEGL.h	Thu Nov 18 23:28:27 2010 +0000
+++ b/openvg/openvgrefimplementation/sfopenvg/sfopenvg/riMiniEGL.h	Fri Nov 26 17:41:06 2010 +0000
@@ -77,7 +77,6 @@
 	ESurfaceTypePixmapSgImage = 3,
 	} TEglSurfaceType;
 
-#define KDefaultScreenNumber 0
 	
 class CEglContext;
 
@@ -126,6 +125,9 @@
 //	RMutex                             iContextMapLock;
     RHashMap<EGLContext, CEglContext*> iContextMap;
     };
+
+// prototype to help eglGetProcAddress() API 
+typedef void (*ProcPointer)(...);
 //==============================================================================================
 
 namespace OpenVGRI
@@ -276,6 +278,9 @@
     Drawable*       getDrawable() const        { return m_drawable; }
     bool            isLargestPbuffer() const   { return m_largestPbuffer; }
     int             getRenderBuffer() const    { return m_renderBuffer; }
+    
+    void 			Lock()						{iSurfaceLock.ReadLock();}
+    void 			Unlock()					{iSurfaceLock.Unlock();}
 
 private:
 	RIEGLSurface(const RIEGLSurface&);
@@ -286,6 +291,8 @@
 	bool			 m_largestPbuffer;
 	int				 m_renderBuffer;		//EGL_BACK_BUFFER or EGL_SINGLE_BUFFER
 	int				 m_referenceCount;
+	
+	RReadWriteLock	 iSurfaceLock; 			// protects the surface for multi-threaded clients
 };
 
 RIEGLSurface* CastToRIEGLSurface(EGLSurface aSurfaceId);
@@ -434,9 +441,11 @@
     TSurfaceInfo* EglInternalFunction_GetPlatformSurface( EGLDisplay display, EGLSurface surface );
     EGLBoolean EglInternalFunction_SurfaceResized(TSurfaceInfo&, int, int);
 private:
+    friend EGL* getEGL();
 	EGL(const EGL&);						// Not allowed.
 	const EGL& operator=(const EGL&);		// Not allowed.
-
+	void Create();
+	
 	Array<RIEGLThread*>		m_threads;			//threads that have called EGL
 	Array<RIEGLThread*>		m_currentThreads;	//threads that have a bound context
 	Array<RIEGLDisplay*>	m_displays;