From: Sven G. <sgo...@ja...> - 2000-08-31 20:29:13
|
No success ... This piece of code, should give us the function-pointer (funcPtr) ! Purpose: The function ptr is achieved dynamically out of the OpenGL implementation ... But: It does not work ... Ideas ? #include <CodeFragments.h> void * LIBAPIENTRY getGLProcAddressHelper(const char * func, int * method, int debug, int verbose ) { void * funcPtr=NULL; int lmethod; ... #ifdef __mac_os /* funcPtr = GetProcAddress(func); */ static char buffer[256]; Ptr glLibMainAddr; CFragConnectionID glLibConnectId; CFragSymbolClass glLibSymClass; GetSharedLibrary ("OpenGLLibrary", kCompiledCFragArch /*kPowerPCCFragArch */, kStubLibraryCFrag, &glLibConnectId, &glLibMainAddr, buffer); printf("GetSharedLibrary errMsg: %s\n", buffer); fflush(NULL); FindSymbol (glLibConnectId, func, &funcPtr, & glLibSymClass ); /* With this peace, or without, just getting NULL ! :-( if(glLibSymClass == kTVectorCFragSymbol) { printf("should be found: symbol class equals kTVectSymbol\n"); } else { printf("should be NOT found: symbol class NOT equals kTVectSymbol\n"); funcPtr = NULL; } */ fflush(NULL); CloseConnection(&glLibConnectId); lmethod=2; #endif -- mailto:sgo...@ja... www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/ voice : +49-521-2399440, +49-170-2115963; fax: +49-521-2399442 |
From: Sven G. <sgo...@ja...> - 2000-09-01 01:44:20
|
... still no success: GetSharedLibrary returns 0 -> OK ! FindSymbol returns -2802 -> cfragNoSymbolErr, symbol not found tried with GetSharedLibrary: OpenGLLibrary OpenGLEngine OpenGLRenderer OpenGLRendererATI here is the source: #ifdef macintosh #include <agl.h> #include <string.h> #include <CodeFragments.h> #include <Errors.h> #define fragNoErr 0 #endif ... #ifdef macintosh Str255 errName; Ptr glLibMainAddr = 0; CFragConnectionID glLibConnectId = 0; CFragSymbolClass glLibSymClass = 0; OSErr returnError=fragNoErr; static char buffer[256]; returnError = GetSharedLibrary("\pOpenGLRenderer", kPowerPCCFragArch, kReferenceCFrag, &glLibConnectId, &glLibMainAddr, errName); printf("GetSharedLibrary errMsg: %s\n", errName); fflush(NULL); if (returnError != fragNoErr) { printf ("GetSharedLibrary Err(%d): Ahhh! Didn't find LIBRARY !\n", returnError); fflush(NULL); } if (returnError == fragNoErr) { sprintf(buffer, "\p%s", func); returnError = FindSymbol (glLibConnectId, buffer, &funcPtr, & glLibSymClass ); if (returnError != fragNoErr) { printf ("GetSharedLibrary Err(%d): Ahhh! Didn't find SYMBOL: %s !\n", returnError, func); fflush(NULL); } returnError = fragNoErr; // fall back to ok mode ... } if (returnError == fragNoErr && glLibConnectId!=NULL) { returnError = CloseConnection(&glLibConnectId); if (returnError != fragNoErr) { printf ("GetSharedLibrary Err(%d): Ahhh! Didn't close LIBRARY !\n", returnError); fflush(NULL); } } lmethod=2; #endif -- mailto:sgo...@ja... www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/ voice : +49-521-2399440, +49-170-2115963; fax: +49-521-2399442 |
From: Sven G. <sgo...@ja...> - 2000-09-01 05:45:12
|
It works ! :-) Using the OpenGLLibrary ! I have to clean up things, then I really know in detail ... how it works :-)) E.g: - using c2pstrcpy (carbon stuff) for converting the c string to an pascal string !! - seeking all symbols out of the lib ... TODO: Now I have to check the Privilege mechanism to get prviliges for the security manager to install and ... Adding the new visual capabilities like accumulator bits, etc (new since version 2.3.1 ...) Later ... Sven -- mailto:sgo...@ja... www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/ voice : +49-521-2399440, +49-170-2115963; fax: +49-521-2399442 |
From: Jean-Yves B. <jea...@wa...> - 2000-09-01 08:22:13
|
Hello Swen, I am not sure I can help you in your Mac port but I try to compile the previous release of GL4 (2.3.1.0) made by gerard. To do this, I used MetroWerks Code warrior, and I rebuilt the extension. I made this to find a bug I noticed in July about reading the FRONT buffer that appears only on mac platform. In the package made by gerard, there where several Metrowerks projects: - one to build the extension, - one to build the zip file, - one to build some demos. If I can help more. Sven Goethel a *crit : > It works ! > > :-) > > Using the OpenGLLibrary ! > > I have to clean up things, then I really know > in detail ... how it works :-)) > > E.g: > - using c2pstrcpy (carbon stuff) > for converting the c string to an pascal string !! > > - seeking all symbols out of the lib ... > > TODO: > Now I have to check the Privilege mechanism > to get prviliges for the security manager to > install and ... > > Adding the new visual capabilities like > accumulator bits, etc (new since version 2.3.1 ...) > > Later ... > > Sven > -- > mailto:sgo...@ja... > www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/ > voice : +49-521-2399440, +49-170-2115963; fax: +49-521-2399442 > _______________________________________________ > gl4java-usergroup mailing list > gl4...@li... > http://lists.sourceforge.net/mailman/listinfo/gl4java-usergroup -- -------------------------------------- Jean-Yves BRUD POLYQUARK - Ingenierie & Creation 3D Palahou - 31330 LARRA France Tel: 05.62.79.03.33 Fax: 05.62.79.03.38 Mail: jea...@wa... -------------------------------------- |