Permalink
Browse files

Building on osx 10.6

  • Loading branch information...
1 parent 5a216bf commit 605a75cfc7ad17af85b8fda15f4399cb3aa08856 @tmpvar tmpvar committed Sep 26, 2011
Showing with 32 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +20 −0 src/arch_wrapper.h
  3. +2 −2 src/webgl.cc
  4. +9 −1 wscript
View
@@ -1,2 +1,3 @@
build
.lock-wscript
+npm-debug.log
View
@@ -0,0 +1,20 @@
+#ifndef _INCLIDE_ARCH_WRAPPER_
+#define _INCLUDE_ARCH_WRAPPER_
+ #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
+ #include <OpenGLES/ES2/gl.h>
+ #include <OpenGLES/ES2/glext.h>
+ typedef double GLclampd;
+ #else
+ #ifdef __APPLE__
+ #include <OpenGL/OpenGL.h>
+ #include <OpenGL/gl.h>
+ #define glClearDepthf glClearDepth
+ #else
+ #ifdef _WIN32
+ #include <windows.h>
+ #else
+ #include <GLES2/gl2.h>
+ #endif
+ #endif
+ #endif
+#endif
View
@@ -3,7 +3,7 @@
#include "v8_typed_array.h"
-#include <GLES2/gl2.h>
+#include "arch_wrapper.h"
using namespace v8;
@@ -708,7 +708,7 @@ init(Handle<Object> target)
target->Set(String::New("UNPACK_ALIGNMENT"), Number::New(GL_UNPACK_ALIGNMENT));
target->Set(String::New("RGBA"), Number::New(GL_RGBA));
-
+
v8_typed_array::AttachBindings(Context::GetCurrent()->Global());
View
10 wscript
@@ -1,4 +1,5 @@
from os import popen
+import sys
srcdir = '.'
blddir = 'build'
@@ -11,10 +12,17 @@ def configure(conf):
conf.check_tool('compiler_cxx')
conf.check_tool('node_addon')
+
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
obj.target = "node-webgl"
obj.cxxflags = ["-pthread", "-Wall"]
- obj.linkflags = ["-lGLESv2"]
+
+ if sys.platform.startswith('darwin'):
+ obj.uselib = ["GL", "GLU", "GLUT"]
+ obj.framework = ['OpenGL','GLUT','Cocoa']
+ else:
+ obj.linkflags = ["-lGLESv2"]
+
obj.source = ["src/webgl.cc", "src/v8_typed_array.cc"]
# obj.uselib = "SDL"

0 comments on commit 605a75c

Please sign in to comment.