From 8995370304e358d894cbaaa21d40fa94bc286a8d Mon Sep 17 00:00:00 2001 From: Mikio Takeuchi Date: Sun, 3 Aug 2014 15:47:47 +0000 Subject: [PATCH] add comments to existing problems with raytracer example. update build.sh for mac. git-svn-id: svn://svn.code.sf.net/p/x10/code/trunk@28025 a326200e-df2c-42e0-81fa-597e909af41d --- x10.gl/build.sh | 8 +++++++- x10.gl/src-x10/x10/gl/GL.x10 | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/x10.gl/build.sh b/x10.gl/build.sh index 26c1239142..29f31d1283 100755 --- a/x10.gl/build.sh +++ b/x10.gl/build.sh @@ -2,6 +2,12 @@ (cd src-x10; find . -name '*.x10' -print0 | xargs -0 jar cf ../x10_gl.jar) -../x10.dist/bin/x10c++ -O -NO_CHECKS -STATIC_CHECKS -buildx10lib . src-x10/x10/gl/GL.x10 -o x10_gl -d include -cxx-postarg -lGL -cxx-postarg -lglut -cxx-postarg -lGLEW +if [[ `uname` = Darwin* ]]; then +GLLIBS="-cxx-postarg -framework -cxx-postarg OpenGL -cxx-postarg -framework -cxx-postarg GLUT" +else +GLLIBS="-cxx-postarg -lGL -cxx-postarg -lglut" +fi + +../x10.dist/bin/x10c++ -O -NO_CHECKS -STATIC_CHECKS -buildx10lib . src-x10/x10/gl/GL.x10 -o x10_gl -d include ${GLLIBS} -cxx-postarg -lGLEW (cd include; find . -name '*.cc' -print0 | xargs -0 rm) diff --git a/x10.gl/src-x10/x10/gl/GL.x10 b/x10.gl/src-x10/x10/gl/GL.x10 index a3606db3d1..6503927a02 100644 --- a/x10.gl/src-x10/x10/gl/GL.x10 +++ b/x10.gl/src-x10/x10/gl/GL.x10 @@ -214,12 +214,14 @@ public final class GL { @Native("c++", "::glTexParameteri(#target, #value, #data)") public static def glTexParameteri (target:Int, value:Int, data:Int) : void { } // this the version associated with GL.GL_PIXEL_UNPACK_BUFFER +// FIXME raytracer#GLFrontend.x10 needs this // @Native("c++", "::glTexSubImage2D(#target, #level, #xOffset, #yOffset, #width, #height, #format, #typ, #bufferOffset)") // public static def glTexSubImage2D (target:Int, level:Int, xOffset:Int, yOffset:Int, width:Int, height:Int, format:Int, typ:Int, bufferOffset:Int) : void { } @Native("c++", "::glTexImage2D(#target, #level, #xOff, #yOff, #w, #h, #border, #fmt, x10aux::lookup_or_null(#data, #dataOffset))") public static def glTexImage2D[T] (target:Int, level:Int, xOff:Int, yOff:Int, w:Int, h:Int, border:Int, fmt:Int, data:Rail[T], dataOffset:Int) : void { } public static def glMapBuffer[T] (target:Int, value:Int, len:Int) : Rail[T] { @Native("c++", "TPMGL(T) *tmp = (TPMGL(T)*)::glMapBuffer(target, value);") { } +// FIXME raytracer#GLFrontend.x10 needs this @Native("c++", "return typename x10::lang::Rail::Rail(tmp, tmp, len);") { } return Zero.get[Rail[T]](); }