HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 OpenSceneGraph (OSG) and Spark

View previous topic View next topic Go down 
AuthorMessage
Xatpy



Messages : 2
Date d'inscription : 2014-05-13

PostSubject: OpenSceneGraph (OSG) and Spark   Tue May 13, 2014 6:56 am

Hi everyone,

I want to ask if somebody know how to compile and integrate OpenSceneGraph with Spark engine.

I tried using osgRecipes Spark integration ( https://github.com/xarray/osgRecipes/tree/master/integrations/osgspark ) , but I can't compile it. It has linking errors.

I don't know if I am using an incorrect library version. The related link of Spark in the wiki page of osgRecipes ( https://github.com/xarray/osgRecipes/wiki ) is not working: http://sark.developpez.com/

So, I downloaded the version 1.5.5 from http://sourceforge.net/projects/sparkengine/ but it is still not working.

In this link I posted the linked errors: https://github.com/xarray/osgRecipes/issues/11

Thanks!
Back to top Go down
View user profile
Darktib
Committer


Messages : 389
Date d'inscription : 2009-07-20
Localisation : A coté de Paris

PostSubject: Re: OpenSceneGraph (OSG) and Spark   Tue May 13, 2014 1:52 pm

You downloaded the 1.5.5 version which is old, the new one is the 2.0 which is still in "beta" (although the code is quite stable). This version is only available on svn (I will create a package when the 64bit portability will be done).

However, the integration with OpenSceneGraph you linked seems to use the 1.5.5, so it is likely that you have the correct version. Now, your errors:

Code:

--------- If I link with: SPARK_debug.lib and SPARK_GL_debug.lib:

LNK2001: "unsigned long const SPK::NO_ID" (?NO_ID@SPK@@3KB)
LNK2019: __imp__glTexImage2D@36 -- "protected: unsigned int __thiscall SparkDrawable::compileInternalTexture(class osg::Image *,unsigned int,unsigned int)const " (?compileInternalTexture@SparkDrawable@@IBEIPAVImage@osg@@II@Z)
LNK2019: __imp__glTexParameteri@12 -- "protected: unsigned int __thiscall SparkDrawable::compileInternalTexture(class osg::Image *,unsigned int,unsigned int)const " (?compileInternalTexture@SparkDrawable@@IBEIPAVImage@osg@@II@Z)
LNK2019: __imp__glBindTexture@8 -- "protected: unsigned int __thiscall SparkDrawable::compileInternalTexture(class osg::Image *,unsigned int,unsigned int)const " (?compileInternalTexture@SparkDrawable@@IBEIPAVImage@osg@@II@Z)
LNK2019: __imp__glGenTextures@8 -- "protected: unsigned int __thiscall SparkDrawable::compileInternalTexture(class osg::Image *,unsigned int,unsigned int)const " (?compileInternalTexture@SparkDrawable@@IBEIPAVImage@osg@@II@Z)

This is the right link order. However, all these functions are "SparkDrawable", which is the osg integration, not SPARK. You should verify how you link to this integration.

For the constant 'NO_ID', try adding the following definition to your project preprocessor options: SPK_IMPORT

_________________
Back to top Go down
View user profile
Xatpy



Messages : 2
Date d'inscription : 2014-05-13

PostSubject: Re: OpenSceneGraph (OSG) and Spark   Fri May 16, 2014 6:21 am

Thanks Darktib!!

I solved it!
I linked with last version in Spark SVN (https://svn.code.sf.net/p/sparkengine/code/), using SPARK Engine CORE DLL.lib and SPARK Engine GL DLL.lib.

The problem were in:

- osgspark.cpp (line 50) ===> //SPK::randomSeed = static_cast<unsigned int>( time(NULL) ); I had to comment this line.

- SparkDrawable.cpp ===> SPK::NO_ID not found. So, I replace SPK::NO_ID with 0 in:
### SparkDrawable.h (line 60) bool isValid() const { return getBaseSystemID()!=SPK::NO_ID && _protoSystem!=NULL; }
### SparkDrawable.cpp - Constructor (line 25) _baseSystemID(SPK::NO_ID)

Finally, I have Spark Engine working with OSG Smile
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: OpenSceneGraph (OSG) and Spark   Today at 3:42 am

Back to top Go down
 
OpenSceneGraph (OSG) and Spark
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Questions (en)-
Jump to: