aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2014-10-01 22:33:01 -0500
committerTom Gall <tom.gall@linaro.org>2014-10-01 22:33:01 -0500
commitd45b8aa8494dbd8c697f9a8776ffb420d8d7e47a (patch)
tree281eb516fdecbc9ae871cb9e8289261e5b000034
parentf54d80b7b733e5f6ff7bc912231b8ecdd164752e (diff)
Add call path an init path through EGL all the way down to OESGLESinitfb
which sets up the frag and vertex shaders which is part of the surface we are going to ultimately draw the texture. The texture of course is what the OpenVG calls will be drawing to (eventually).
-rw-r--r--ri/include/EGL/egl.h1
-rw-r--r--ri/src/linux/esUtil.c6
-rw-r--r--ri/src/linux/esUtil.h1
-rw-r--r--ri/src/linux/riEGLOS.cpp6
-rw-r--r--ri/src/riMiniEGL.cpp6
-rw-r--r--samples/triangle/main.c2
6 files changed, 19 insertions, 3 deletions
diff --git a/ri/include/EGL/egl.h b/ri/include/EGL/egl.h
index 99ea342..8c72a20 100644
--- a/ri/include/EGL/egl.h
+++ b/ri/include/EGL/egl.h
@@ -262,6 +262,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attr
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
EGLint attribute, EGLint *value);
+EGLAPI void eglOpenVGInit(EGLSurface *surface);
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
EGLNativeWindowType win,
const EGLint *attrib_list);
diff --git a/ri/src/linux/esUtil.c b/ri/src/linux/esUtil.c
index 8773678..54be0c3 100644
--- a/ri/src/linux/esUtil.c
+++ b/ri/src/linux/esUtil.c
@@ -280,6 +280,12 @@ GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, const char* title, G
return GL_TRUE;
}
+GLboolean ESUTIL_API esOpenVGInit ( ESContext *esContext )
+{
+ eglOpenVGInit( &esContext->eglSurface );
+
+ return GL_TRUE;
+}
///
// esMainLoop()
diff --git a/ri/src/linux/esUtil.h b/ri/src/linux/esUtil.h
index b675e36..cfd50b7 100644
--- a/ri/src/linux/esUtil.h
+++ b/ri/src/linux/esUtil.h
@@ -120,6 +120,7 @@ void ESUTIL_API esInitContext ( ESContext *esContext );
/// \return GL_TRUE if window creation is succesful, GL_FALSE otherwise
GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, const char *title, GLint width, GLint height, GLuint flags );
+GLboolean ESUTIL_API esOpenVGInit ( ESContext *esContext );
//
/// \brief Start the main loop for the OpenGL ES application
/// \param esContext Application context
diff --git a/ri/src/linux/riEGLOS.cpp b/ri/src/linux/riEGLOS.cpp
index 1b46c6b..302006c 100644
--- a/ri/src/linux/riEGLOS.cpp
+++ b/ri/src/linux/riEGLOS.cpp
@@ -494,7 +494,7 @@ void OSBlitToWindow(void* context, const Drawable* drawable)
f = VG_sARGB_8888;
vgReadPixels(ctx->tmp, w*sizeof(unsigned int), f, 0, 0, w, h);
-
+/*
glGenTextures(1, &videoFrameTexture);
glBindTexture(GL_TEXTURE_2D, videoFrameTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -504,7 +504,7 @@ void OSBlitToWindow(void* context, const Drawable* drawable)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
+*/
/* glViewport(0, 0, w, h);
@@ -540,7 +540,7 @@ void OSBlitToWindow(void* context, const Drawable* drawable)
// if(isBigEndian())
// f = VG_sRGBX_8888;
- vgReadPixels(ctx->tmp, w*sizeof(unsigned int), f, 0, 0, w, h);
+// vgReadPixels(ctx->tmp, w*sizeof(unsigned int), f, 0, 0, w, h);
// glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ctx->tmp);
}
diff --git a/ri/src/riMiniEGL.cpp b/ri/src/riMiniEGL.cpp
index 3d662f6..c0a6191 100644
--- a/ri/src/riMiniEGL.cpp
+++ b/ri/src/riMiniEGL.cpp
@@ -1309,6 +1309,12 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute
EGL_RETURN(EGL_SUCCESS, EGL_TRUE);
}
+void eglOpenVGInit(EGLSurface *surface) {
+ RIEGLSurface* s = (RIEGLSurface *)s;
+
+ OSGLESinit(s->getOSWindowContext());
+}
+
/*-------------------------------------------------------------------*//*!
* \brief
* \param
diff --git a/samples/triangle/main.c b/samples/triangle/main.c
index e228607..432ae2c 100644
--- a/samples/triangle/main.c
+++ b/samples/triangle/main.c
@@ -281,6 +281,8 @@ int main ( int argc, char *argv[] )
esCreateWindow ( &esContext, "Hello Triangle", 640, 480, ES_WINDOW_RGB );
+ esOpenVGInit( &esContext);
+
// if ( !Init ( &esContext ) )
// return 0;