This commit was manufactured by cvs2svn to create tag 'leocad-0-74'.

This commit is contained in:
nobody
2005-06-17 23:31:02 +00:00
parent a10bbea364
commit d226bc171b
6 changed files with 0 additions and 496 deletions
-1
View File
@@ -1 +0,0 @@
*.d
-73
View File
@@ -1,73 +0,0 @@
//
// BeOS OpenGL functions
//
#include <stdio.h>
#include <be/kernel/image.h>
#include "opengl.h"
static image_id gl_image;
// =============================================================================
// Function pointers
// =============================================================================
// Global functions
void* Sys_GLGetProc (const char *symbol)
{
void *func;
if (get_image_symbol (gl_image, symbol, B_SYMBOL_TYPE_TEXT, &func) == B_OK)
return func;
printf ("Error loading OpenGL function %s.\n", symbol);
return NULL;
}
void* Sys_GLGetExtension (const char *symbol)
{
/*
if (pfnglXGetProcAddressARB == NULL)
return NULL;
else
return pfnglXGetProcAddressARB ((GLubyte*)symbol);
*/
return NULL;
}
bool Sys_GLOpenLibrary (const char* libname)
{
if (libname)
{
gl_image = load_add_on (libname);
if (gl_image <= 0)
printf ("Error loading OpenGL library %s\n", libname);
}
if (gl_image <= 0)
{
libname = "/beos/beos/system/lib/libGL.so";
gl_image = load_add_on (libname);
if (gl_image <= 0)
printf ("Error loading OpenGL library %s\n", libname);
}
if (gl_image <= 0)
return false;
// pfnglXChooseVisual = (PFNGLXCHOOSEVISUAL) Sys_GLGetProc ("glXChooseVisual");
return true;
}
void Sys_GLCloseLibrary ()
{
if (gl_image <= 0)
{
unload_add_on (gl_image);
gl_image = (image_id)NULL;
}
// pfnglXChooseVisual = NULL;
}
-5
View File
@@ -1,5 +0,0 @@
#ifndef _BEOS_GL_H_
#define _BEOS_GL_H_
#endif // _BEOS_GL_H_
-142
View File
@@ -1,142 +0,0 @@
//
// LeoCAD for BeOS
//
#include <stdlib.h>
#include <be/kernel/OS.h>
#include "opengl.h"
#include "project.h"
#include "globals.h"
// Flag to tell whether or not the Be application is active or not
int BeAppActive = 0;
static thread_id AppThread = 0;
static int32 RunThread (void *data)
{
SDL_RunThread (data);
return 0;
}
// Initialize the Be Application, if it's not already started
int InitBeApp ()
{
// Create the BApplication that handles appserver interaction
if (BeAppActive <= 0)
{
// Create the thread and go!
AppThread = spawn_thread (RunThread, "LeoCAD", B_NORMAL_PRIORITY, NULL);
if ((AppThread == B_NO_MORE_THREADS) ||
(AppThread == B_NO_MEMORY))
{
printf ("Not enough resources to create thread\n");
return -1;
}
resume_thread (AppThread);
do
{
snooze (10);
} while ((be_app == NULL) || be_app->IsLaunching ());
// Mark the application active
BeAppActive = 0;
}
// Increment the application reference count
BeAppActive++;
// The app is running, and we're ready to go
return 0;
}
// Quit the Be Application, if there's nothing left to do
void QuitBeApp ()
{
// Decrement the application reference count
BeAppActive--;
// If the reference count reached zero, clean up the app
if (BeAppActive == 0)
{
if (AppThread != 0)
{
if (be_app != NULL)
{
// Not tested
be_app->PostMessage(B_QUIT_REQUESTED);
}
status_t the_status;
wait_for_thread (AppThread, &the_status);
AppThread = 0;
}
// be_app should now be NULL since be_app has quit
}
}
int main (int argc, char** argv)
{
char* libgl = NULL;
int i, j, k;
// Parse and remove system arguments
for (i = 1; i < argc; i++)
{
char* param = argv[i];
if (param[0] == '-' && param[1] == '-')
{
param += 2;
if ((strcmp (param, "libgl") == 0) && (i != argc))
{
libgl = argv[i+1];
argv[i] = argv[i+1] = NULL;
i++;
}
}
}
for (i = 1; i < argc; i++)
{
for (k = i; k < argc; k++)
if (argv[k] != NULL)
break;
if (k > i)
{
k -= i;
for (j = i + k; j < argc; j++)
argv[j-k] = argv[j];
argc -= k;
}
}
if (!GL_Initialize (libgl))
return 1;
project = new Project();
char* path;
path = getenv("LEOCAD_LIB");
if (path == NULL)
path = "/boot/home/leocad/";
if (project->Initialize(argc, argv, path) == false)
{
delete project;
GL_Shutdown ();
return 1;
}
delete project;
GL_Shutdown ();
return 0;
}
-6
View File
@@ -1,6 +0,0 @@
SRC += beos/beos_gl.cpp beos/main.cpp beos/system.cpp
CFLAGS += -Ibeos/jpeglib
CXXFLAGS += -Ibeos/jpeglib
LIBS += -Lbeos/jpeglib
-269
View File
@@ -1,269 +0,0 @@
/*
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include "opengl.h"
#include "gdkgl.h"
#include "gtkglarea.h"
#include "gtkmisc.h"
#include "project.h"
#include "system.h"
#include "main.h"
#include "toolbar.h"
#include "dialogs.h"
#include "globals.h"
*/
#include "file.h"
#include "camera.h"
#include "defines.h"
// =============================================================================
// Cursor functions
/*
void Sys_BeginWait ()
{
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (g_pParentWnd->m_pWidget->window, cursor);
gdk_cursor_destroy (cursor);
}
void Sys_EndWait ()
{
GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR);
gdk_window_set_cursor (g_pParentWnd->m_pWidget->window, cursor);
gdk_cursor_destroy (cursor);
}
void Sys_GetCursorPos (int *x, int *y)
{
gdk_window_get_pointer (NULL, x, y, NULL);
}
void Sys_SetCursorPos (int x, int y)
{
XWarpPointer (GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0, 0, 0, 0, x, y);
}
*/
// =============================================================================
// Message Boxes
int Sys_MessageBox (const char* text, const char* caption, int type)
{
return 0;
}
// =============================================================================
// Memory rendering
typedef struct
{
int width, height;
} LC_RENDER;
void* Sys_StartMemoryRender(int width, int height)
{
return NULL;
}
void Sys_FinishMemoryRender(void* param)
{
}
// Profile functions
bool Sys_ProfileSaveInt (const char *section, const char *key, int value)
{
return false;
}
bool Sys_ProfileSaveString (const char *section, const char *key, const char *value)
{
return false;
}
int Sys_ProfileLoadInt (const char *section, const char *key, int default_value)
{
return default_value;
}
char* Sys_ProfileLoadString (const char *section, const char *key, const char *default_value)
{
static char tmp[1024];
strcpy (tmp, default_value);
return tmp;
}
// String
char* strupr(char* string)
{
char *cp;
for (cp=string; *cp; ++cp)
{
if ('a' <= *cp && *cp <= 'z')
*cp += 'A' - 'a';
}
return string;
}
char* strlwr(char* string)
{
char *cp;
for (cp = string; *cp; ++cp)
{
if ('A' <= *cp && *cp <= 'Z')
*cp += 'a' - 'A';
}
return string;
}
void SystemPumpMessages()
{
}
long SystemGetTicks()
{
return 0;//GetTickCount();
}
// User Interface
void SystemUpdateViewport(int new_vp, int old_vp)
{
}
void SystemUpdateAction(int new_action, int old_action)
{
}
void SystemSetGroup(int new_group)
{
}
void SystemUpdateColorList(int new_color)
{
}
void SystemUpdateRenderingMode(bool bBackground, bool bFast)
{
}
void SystemUpdateUndoRedo(char* undo, char* redo)
{
}
void SystemUpdateSnap(const unsigned long snap)
{
}
void SystemUpdateCurrentCamera(Camera* pOld, Camera* pNew, Camera* pCamera)
{
}
void SystemUpdateCameraMenu(Camera* pCamera)
{
}
void SystemUpdateTime(bool bAnimation, int nTime, int nTotal)
{
}
void SystemUpdateAnimation(bool bAnimation, bool bAddKeys)
{
}
void SystemUpdateMoveSnap(unsigned short move_snap)
{
}
void SystemUpdateSelected(unsigned long flags)
{
}
void SystemUpdateRecentMenu(char names[4][LC_MAXPATH])
{
}
void SystemUpdatePaste(bool enable)
{
}
void SystemUpdatePlay(bool play, bool stop)
{
}
void SystemUpdateFocus(void* object, unsigned char type)
{
}
void SystemInit()
{
}
void SystemFinish()
{
}
int SystemDoMessageBox(char* prompt, int mode)
{
return 0;
}
bool SystemDoDialog(int mode, void* param)
{
return false;
}
void SystemDoPopupMenu(int nMenu, int x, int y)
{
}
void SystemDoWaitCursor(int code)
{
}
void SystemExportClipboard(File* clip)
{
}
File* SystemImportClipboard()
{
return NULL;
}
void SystemSetWindowCaption(char* caption)
{
}
void SystemRedrawView()
{
}
void SystemPieceComboAdd(char* name)
{
}
void SystemCaptureMouse()
{
}
void SystemReleaseMouse()
{
}
void SystemSwapBuffers()
{
}