From: Í¢¿¡ Ñ. <yan...@ho...> - 2005-08-11 08:10:57
|
I write a SPU called warpvertexspu to warp the image by a Cg program. In the warpvertexspu.h, I include the cg.h and cgGL.h and in warpvertexspu_init.c and warpvertexspu.c I call cg and cgGL functions. But after I compile the source by adding -lCgGL and -lCg to the LDFLAGS variable in the makefile, when I use the warpvertexspu.so , It says "DLL could find/open the warpvertexspu.so". But if I comment the cg and cgGL functions in the warpvertexspu.c and keep the cg functions in the warpvertexspu_init.c, after compile the SPU can work well. the warpvertexspu.c: #include <stdio.h> #include "cr_spu.h" #include "warpvertexspu.h" static void WARPVERTEXSPU_APIENTRY warpvertexBegin(GLenum mode) { if(WarpParam!=NULL) cgGLSetMatrixParameterfc(WarpParam,WarpM); if(ModelViewProjParam!=NULL) cgGLSetStateMatrixParameter(ModelViewProjParam, CG_GL_MODELVIEW_PROJECTION_MATRIX, CG_GL_MATRIX_IDENTITY); cgGLEnableProfile(profile); warpvertex_spu.super.Begin(mode); } static void WARPVERTEXSPU_APIENTRY warpvertexEnd(void) { warpvertex_spu.super.End(); cgGLDisableProfile(profile); } SPUNamedFunctionTable _cr_warpvertex_table[] = { { "Begin", (SPUGenericFunction)warpvertexBegin }, { "End", (SPUGenericFunction)warpvertexEnd }, { NULL, NULL } }; I don't know why calling cg functions in the warpvertexspu_int.c can work well but calling in the warpvertexspu.c cannot work. Maybe there is something wrong with the makefile.could you give me some help? Thanks very much! Sincerely yours Yang Tingjun _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ |