Permalink
Browse files

updated for linux

  • Loading branch information...
1 parent c7caf3a commit d56173009a683a364283c44da0faffd76a21430d Mikael Bourges-Sevenier committed Mar 3, 2012
Showing with 12 additions and 11 deletions.
  1. +9 −6 src/glfw.cc
  2. +3 −5 wscript
View
@@ -4,26 +4,27 @@
//#include <OpenGL/gl3.h>
// OpenGL Graphics Includes
-#define GLEW_NO_GLU
+/*#define GLEW_NO_GLU
#include <GL/glew.h>
#ifdef UNIX
#include <GL/glxew.h>
#endif
#if defined (_WIN32)
#include <GL/wglew.h>
#endif
-
+*/
#if defined (__APPLE__) || defined(MACOSX)
#include <OpenGL/OpenGL.h>
+ #define GLFW_INCLUDE_GL3
+ #undef __gl_h_
#endif
-#define GLFW_INCLUDE_GL3
#define GLFW_NO_GLU
-#undef __gl_h_
#include <GL/glfw.h>
// Includes
#include <cstdio>
+#include <cstdlib>
using namespace v8;
using namespace node;
@@ -210,17 +211,19 @@ JS_METHOD(OpenWindow) {
if(!windowCreated) {
windowCreated=glfwOpenWindow(width,height,redbits,greenbits,bluebits,alphabits,depthbits,stencilbits,mode);
- glewInit();
+ /*glewInit();
if (glewIsSupported("GL_VERSION_2_1"))
cout<<"Ready for OpenGL 2.1"<<endl;
else {
cout<<"Warning: Detected that OpenGL 2.1 not supported"<<endl;
- }
+ }*/
}
else
glfwSetWindowSize(width,height);
+#if defined (__APPLE__) || defined(MACOSX)
cout<<"CGL current context: "<<hex<<CGLGetCurrentContext()<<dec<<endl;
+#endif
// Set callback functions
glfw_events=Persistent<Object>::New(args.This()->Get(JS_STR("events"))->ToObject());
View
@@ -22,19 +22,17 @@ def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool('node_addon')
conf.check(lib=['glfw'], uselib_store='GLFW')
- conf.check(lib=['GLEW'], libpath=['/opt/local/lib'], uselib_store='GLEW')
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.target = "node_glfw"
obj.source = bld.path.ant_glob('src/*.cc')
- obj.cxxflags = ["-g",'-I/opt/local/include']
- #obj.ldflags=['/usr/local/lib/libglfw.a']
- obj.uselib=['GLFW','GLEW']
+ obj.cxxflags = ["-g",'-I/opt/local/include','-fPIC']
+ obj.uselib=['GLFW']
if sys.platform.startswith('darwin'):
obj.framework=['OpenGL']
elif sys.platform.startswith('linux'):
- obj.ldflags = [ "-lglfw", "-lGL" ]
+ obj.ldflags = [ "-lglfw","-lGL" ]
def shutdown():
if Options.commands['clean']:

0 comments on commit d561730

Please sign in to comment.