summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boring_parts.cc22
-rw-r--r--src/boring_parts.h11
-rwxr-xr-xsrc/compil.sh8
-rw-r--r--src/gpudataviz.cc2
4 files changed, 36 insertions, 7 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*/
diff --git a/src/boring_parts.h b/src/boring_parts.h
index 4060f67..54fd7b3 100644
--- a/src/boring_parts.h
+++ b/src/boring_parts.h
@@ -1,6 +1,13 @@
#include <iostream>
-// TODO : only need OpenGL things, not GTK ones for now
-#include "gtk_includes.h"
+
+#include <gtkmm.h> /* Must included before X11/Xlib.h */
+//#include <GL/glew.h> /* Seems included by GL/glxew.h */
+#include <GL/glxew.h> /* For GLXContext, must appear before gl.h, includes X11/Xlib.h */
+#include <gtkglmm.h> /* Includes a GL/gl.h (the right one ??) */
+
+//#include <GL/gl.h>
+//#include <GL/glu.h>
+//#include <CL/cl_gl.h>
int initLibs();
diff --git a/src/compil.sh b/src/compil.sh
index bc21245..10cd630 100755
--- a/src/compil.sh
+++ b/src/compil.sh
@@ -10,11 +10,11 @@ AMDAPP_PATH="/opt/AMDAPP"
DEFINES=""
INCLUDES=""
-LIBS=""
+LIBS="-lglew"
# OpenCL
if [ -d "$AMDAPP_PATH/include" ]
-then DEFINES="-DHAS_OPENCL"
+then DEFINES="$DEFINES -DHAS_OPENCL"
INCLUDES="$INCLUDES -I $AMDAPP_PATH/include"
LIBS="$LIBS -lOpenCL"
else echo "WARNING : invalid AMDAPP_PATH : '$AMDAPP_PATH'"
@@ -32,8 +32,8 @@ fi
#set +x
function build_cxx() {
- echo "$PS4$CXX \$INCLUDES -o $BUILD_PATH/$1 -c $2"
- $CXX $INCLUDES -o $BUILD_PATH/$1 -c $2
+ echo "$PS4$CXX \$DEFINES \$INCLUDES -o $BUILD_PATH/$1 -c $2"
+ $CXX $DEFINES $INCLUDES -o $BUILD_PATH/$1 -c $2
}
function link_cxx() {
diff --git a/src/gpudataviz.cc b/src/gpudataviz.cc
index 954ef5e..e6e4ca5 100644
--- a/src/gpudataviz.cc
+++ b/src/gpudataviz.cc
@@ -2,6 +2,8 @@
#include "gpudataviz.h"
#include "boring_parts.h"
+
+//#include "gtk_includes.h"
#include "gtk_win_main.h"
#include "my_gtk_gl_scene_widget.h"