* reverted temporary GHOST_DEBUG define

* also removed it from haiku1-config.py CPPDEFINES
  (it's place is in user-config.py if present)
* removed unneeded code (already commented) for spawning of
  the BApplication Run()ing thread
This commit is contained in:
Michael Weirauch
2009-09-21 18:29:53 +00:00
parent d8d6074ea4
commit 65cc9ec243

View File

@@ -70,12 +70,14 @@ Index: intern/ghost/intern/GHOST_SystemHaiku.cpp
===================================================================
--- intern/ghost/intern/GHOST_SystemHaiku.cpp (revision 0)
+++ intern/ghost/intern/GHOST_SystemHaiku.cpp (revision 0)
@@ -0,0 +1,129 @@
@@ -0,0 +1,114 @@
+#include "GHOST_Debug.h"
+#include "GHOST_SystemHaiku.h"
+#include "GHOST_WindowHaiku.h"
+#include "GHOST_WindowManager.h"
+
+#include <stdio.h>
+
+GHOST_SystemHaiku::GHOST_SystemHaiku()
+ : fDisplayManager(NULL),
+ fApplication(NULL)
@@ -88,28 +90,11 @@ Index: intern/ghost/intern/GHOST_SystemHaiku.cpp
+ GHOST_PRINT("GHOST_SystemHaiku::init()\n");
+
+ if (GHOST_kSuccess != GHOST_System::init()) {
+ cout << "GHOST_SystemHaiku::init() : GHOST_System::init() failed!" << endl;
+ printf("GHOST_SystemHaiku::init() : GHOST_System::init() failed!\n");;
+ return GHOST_kFailure;
+ }
+
+ fApplication = new BApplication("application/x-vnd.GHOST.BApplication");
+
+// thread_id appThread = spawn_thread(GHOST_SystemHaiku::BApplicationThread,
+// "GHOST.BApplication", B_NORMAL_PRIORITY, 0);
+// if (appThread == B_NO_MORE_THREADS) {
+// GHOST_PRINT("GHOST_SystemHaiku::init() : Reached maximum number of threads!\n");
+// return GHOST_kFailure;
+// }
+// if (appThread == B_NO_MEMORY) {
+// GHOST_PRINT( "GHOST_SystemHaiku::init() : Not enough memory to allocate the resources for another thread.\n");
+// return GHOST_kFailure;
+// }
+
+ // TODO: It seems the application is not necessary to be Run()ed.
+ /* Resume the initially suspended thread. */
+// if (B_OK != resume_thread(appThread))
+// return GHOST_kFailure;
+
+ fApplication = new BApplication("application/x-vnd.GHOST-BApplication");
+ fDisplayManager = new GHOST_DisplayManagerHaiku();
+
+ return GHOST_kSuccess;
@@ -331,20 +316,6 @@ Index: intern/ghost/intern/GHOST_DisplayManagerHaiku.cpp
+ GHOST_PRINT("TODO GHOST_DisplayManagerHaiku::setCurrentDisplaySetting() : TODO\n");
+ return GHOST_kFailure;
+}
Index: intern/ghost/intern/GHOST_Debug.h
===================================================================
--- intern/ghost/intern/GHOST_Debug.h (revision 19951)
+++ intern/ghost/intern/GHOST_Debug.h (working copy)
@@ -31,6 +31,9 @@
* Macro's used in GHOST debug target.
*/
+// FIXME1
+#define GHOST_DEBUG
+
#ifndef _GHOST_DEBUG_H_
#define _GHOST_DEBUG_H_
Index: intern/ghost/intern/GHOST_WindowHaiku.h
===================================================================
--- intern/ghost/intern/GHOST_WindowHaiku.h (revision 0)
@@ -570,7 +541,7 @@ Index: intern/ghost/intern/GHOST_SystemHaiku.h
===================================================================
--- intern/ghost/intern/GHOST_SystemHaiku.h (revision 0)
+++ intern/ghost/intern/GHOST_SystemHaiku.h (revision 0)
@@ -0,0 +1,145 @@
@@ -0,0 +1,139 @@
+#ifndef _GHOST_SYSTEM_HAIKU_H_
+#define _GHOST_SYSTEM_HAIKU_H_
+
@@ -597,12 +568,6 @@ Index: intern/ghost/intern/GHOST_SystemHaiku.h
+ */
+ virtual GHOST_TSuccess init();
+
+ static int32 BApplicationThread(void* arg) {
+ // TODO investigate why the look is necessary here.
+ be_app->Lock();
+ return be_app->Run();
+ }
+
+ /**
+ * Shut the system down.
+ * @return Indication of success.
@@ -1409,96 +1374,11 @@ Index: source/blender/blenlib/intern/storage.c
if (statvfs(name, &disk)) return(-1);
#elif !defined(__FreeBSD__) && !defined(linux) && (defined (__sgi) || defined(__sparc) || defined(__sparc__))
/* WARNING - This may not be supported by geeneric unix os's - Campbell */
Index: extern/glew/src/glew.c
===================================================================
--- extern/glew/src/glew.c (revision 19951)
+++ extern/glew/src/glew.c (working copy)
@@ -32,7 +32,7 @@
#include <GL/glew.h>
#if defined(_WIN32)
# include <GL/wglew.h>
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
# include <GL/glxew.h>
#endif
@@ -86,7 +86,7 @@
}
#endif /* __APPLE__ */
-#if defined(__sgi) || defined (__sun)
+#if defined(__sgi) || defined (__sun) || defined(__HAIKU__)
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
@@ -107,7 +107,7 @@
else
return dlsym(h, (const char*)name);
}
-#endif /* __sgi || __sun */
+#endif /* __sgi || __sun || __HAIKU__ */
/*
* Define glewGetProcAddress.
@@ -118,7 +118,7 @@
# if defined(__APPLE__)
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
# else
-# if defined(__sgi) || defined(__sun)
+# if defined(__sgi) || defined(__sun) || defined(__HAIKU__)
# define glewGetProcAddress(name) dlGetProcAddress(name)
# else /* __linux */
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
@@ -6422,7 +6422,7 @@
return GLEW_OK;
}
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL;
@@ -7139,7 +7139,7 @@
return GLEW_OK;
}
-#endif /* !__APPLE__ || GLEW_APPLE_GLX */
+#endif /* (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__) */
/* ------------------------------------------------------------------------ */
@@ -7176,7 +7176,7 @@
#if defined(_WIN32)
extern GLenum wglewContextInit (void);
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
extern GLenum glxewContextInit (void);
#endif /* _WIN32 */
@@ -7186,7 +7186,7 @@
if ( (r = glewContextInit()) ) return r;
#if defined(_WIN32)
return wglewContextInit();
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
return glxewContextInit();
#else
return r;
@@ -9429,7 +9429,7 @@
return ret;
}
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
#if defined(GLEW_MX)
GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name)
Index: config/haiku1-config.py
===================================================================
--- config/haiku1-config.py (revision 0)
+++ config/haiku1-config.py (revision 0)
@@ -0,0 +1,194 @@
@@ -0,0 +1,191 @@
+import os
+import subprocess
+import sys
@@ -1685,11 +1565,93 @@ Index: config/haiku1-config.py
+#BF_PROFILE_FLAGS = ['-pg','-g']
+#BF_PROFILE = 'false'
+
+CPPDEFINES = 'GHOST_DEBUG'
+DEFINES = ['GHOST_DEBUG']
+
+BF_DEBUG = 'false'
+BF_DEBUG_FLAGS = '-g'
+
+BF_BUILDDIR = '../build-' + sys.platform
+BF_INSTALLDIR='../install-' + sys.platform
Index: extern/glew/src/glew.c
===================================================================
--- extern/glew/src/glew.c (revision 19951)
+++ extern/glew/src/glew.c (working copy)
@@ -32,7 +32,7 @@
#include <GL/glew.h>
#if defined(_WIN32)
# include <GL/wglew.h>
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
# include <GL/glxew.h>
#endif
@@ -86,7 +86,7 @@
}
#endif /* __APPLE__ */
-#if defined(__sgi) || defined (__sun)
+#if defined(__sgi) || defined (__sun) || defined(__HAIKU__)
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
@@ -107,7 +107,7 @@
else
return dlsym(h, (const char*)name);
}
-#endif /* __sgi || __sun */
+#endif /* __sgi || __sun || __HAIKU__ */
/*
* Define glewGetProcAddress.
@@ -118,7 +118,7 @@
# if defined(__APPLE__)
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
# else
-# if defined(__sgi) || defined(__sun)
+# if defined(__sgi) || defined(__sun) || defined(__HAIKU__)
# define glewGetProcAddress(name) dlGetProcAddress(name)
# else /* __linux */
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
@@ -6422,7 +6422,7 @@
return GLEW_OK;
}
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL;
@@ -7139,7 +7139,7 @@
return GLEW_OK;
}
-#endif /* !__APPLE__ || GLEW_APPLE_GLX */
+#endif /* (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__) */
/* ------------------------------------------------------------------------ */
@@ -7176,7 +7176,7 @@
#if defined(_WIN32)
extern GLenum wglewContextInit (void);
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
extern GLenum glxewContextInit (void);
#endif /* _WIN32 */
@@ -7186,7 +7186,7 @@
if ( (r = glewContextInit()) ) return r;
#if defined(_WIN32)
return wglewContextInit();
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
return glxewContextInit();
#else
return r;
@@ -9429,7 +9429,7 @@
return ret;
}
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
+#elif (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) && !defined(__HAIKU__)
#if defined(GLEW_MX)
GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name)