From a662129a86855e082d8515d318c6a19ef54b4e13 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 13 Jan 2013 14:58:25 +0000 Subject: Debut d'integration OpenCL / GL mais il manque une lib a linker... quelque part dans /opt/AMDAPP ??? git-svn-id: file:///var/svn/2013-gpudataviz/trunk@6 371a6b4a-a258-45f8-9dcc-bdd82ce0ac9d --- src/boring_parts.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/boring_parts.cc') diff --git a/src/boring_parts.cc b/src/boring_parts.cc index 3973c23..54c6863 100644 --- a/src/boring_parts.cc +++ b/src/boring_parts.cc @@ -1,5 +1,10 @@ #include "boring_parts.h" + + +// TODO : only need OpenGL things, not GTK ones for now +//#include "gtk_includes.h" + #define RETURN_IF_FAIL(expr) do { \ int res=(expr); \ if ( res != 0 ) return res; \ @@ -17,7 +22,6 @@ int initLibs() { - // FIXME : unused #ifdef HAS_OPENCL RETURN_IF_FAIL( initOpenCL() ); #endif /*HAS_OPENCL*/ @@ -99,6 +103,22 @@ int initOpenCL() { delete [] devices; delete [] platforms; +/* + if (!clGetGLContextInfoKHR) + { + clGetGLContextInfoKHR = (clGetGLContextInfoKHR_fn) clGetExtensionFunctionAddressForPlatform(platform, "clGetGLContextInfoKHR"); + if (!clGetGLContextInfoKHR) + { + std::cout << "Failed to query proc address for clGetGLContextInfoKHR"; + } + } +*/ + GLXContext gGlCtx = glXGetCurrentContext(); + std::cout << "gGlCtx == " << gGlCtx << std::endl; + cl_context_properties cpsGL[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)platform, + CL_GLX_DISPLAY_KHR, (intptr_t) glXGetCurrentDisplay(), + CL_GL_CONTEXT_KHR, (intptr_t) gGlCtx, 0 + }; return 0; } #endif /*HAS_OPENCL*/ -- cgit v1.2.3