summaryrefslogtreecommitdiff
path: root/src/boring_parts.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/boring_parts.cc')
-rw-r--r--src/boring_parts.cc22
1 files changed, 21 insertions, 1 deletions
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*/