Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: trying to convert Spark to SFML 2  (Read 4424 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« on: September 19, 2011, 08:12:21 pm »
Im trying to compile spark using SFML 2, I think i have fixed most issues but I am stuck on this:

Quote

Error   1   error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class   C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs\SFML\SPK_SFMLSystem.h   63   1   SPARK Engine SFML LIB
Error   2   error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class   C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs\SFML\SPK_SFMLSystem.h   142   1   SPARK Engine SFML LIB
Error   3   error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class   C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs\SFML\SPK_SFMLSystem.h   63   1   SPARK Engine SFML DLL
Error   4   error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class   C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs\SFML\SPK_SFMLSystem.h   142   1   SPARK Engine SFML DLL



on this file
https://sparkengine.svn.sourceforge.net/svnroot/sparkengine/trunk/include/RenderingAPIs/SFML/SPK_SFMLSystem.h

Wasnt really sure if this is best here or in the Spark forum but I thought you would maybe know

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
trying to convert Spark to SFML 2
« Reply #1 on: September 19, 2011, 08:34:34 pm »
Look at the sf::Drawable class, find its virtual function(s), and see if they are correctly overriden in SFMLSystem.
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« Reply #2 on: September 19, 2011, 09:14:06 pm »
The only virtual functions that I can spot are the Destructor and the Render.
I added them to the file but nothing changed.

The problem seems to come from:
Code: [Select]
SPK_IMPLEMENT_REGISTERABLE(SFMLSystem)

and:

Code: [Select]
SFMLSystem* obj = new SFMLSystem(worldTransformed,renderTarget);

I know this isnt your problem to sort out but thanks for any help :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
trying to convert Spark to SFML 2
« Reply #3 on: September 19, 2011, 09:29:23 pm »
Can you show me what you added?
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« Reply #4 on: September 19, 2011, 09:36:08 pm »
Code: [Select]

virtual ~SFMLSystem() {}

and:

virtual private const void Render(sf::RenderTarget& target, sf::Renderer& renderer) { }

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
trying to convert Spark to SFML 2
« Reply #5 on: September 19, 2011, 09:56:49 pm »
This is not how the Render function is declared in the base class, look twice (the prototype must be the exact same) ;)

And you should look at the direct compiler output, not the formatted one. It hides the most important information: which function is not overriden, and what its prototype is.
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« Reply #6 on: September 19, 2011, 09:59:14 pm »
hmm

I tried it again doing a copy and paste of the prototype:

virtual void Render(sf::RenderTarget& target, sf::Renderer& renderer) const = 0;

but still the same

this is the full output

Quote
1>------ Build started: Project: SPARK Engine SFML LIB, Configuration: Release Win32 ------
2>------ Build started: Project: SPARK Engine SFML DLL, Configuration: Release Win32 ------
1>  SPK_SFML_All.cpp
2>  SPK_SFML_All.cpp
1>C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(63): error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class
1>          due to following members:
1>          'void SPK::SFML::SFMLSystem::Render(sf::RenderTarget &,sf::Renderer &) const' : is abstract
1>          C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(136) : see declaration of 'SPK::SFML::SFMLSystem::Render'
1>C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(145): error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class
1>          due to following members:
1>          'void SPK::SFML::SFMLSystem::Render(sf::RenderTarget &,sf::Renderer &) const' : is abstract
1>          C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(136) : see declaration of 'SPK::SFML::SFMLSystem::Render'
2>C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(63): error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class
2>          due to following members:
2>          'void SPK::SFML::SFMLSystem::Render(sf::RenderTarget &,sf::Renderer &) const' : is abstract
2>          C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(136) : see declaration of 'SPK::SFML::SFMLSystem::Render'
2>C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(145): error C2259: 'SPK::SFML::SFMLSystem' : cannot instantiate abstract class
2>          due to following members:
2>          'void SPK::SFML::SFMLSystem::Render(sf::RenderTarget &,sf::Renderer &) const' : is abstract
2>          C:\Documents and Settings\Richy\My Documents\spark\include\RenderingAPIs/SFML/SPK_SFMLSystem.h(136) : see declaration of 'SPK::SFML::SFMLSystem::Render'
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
trying to convert Spark to SFML 2
« Reply #7 on: September 19, 2011, 10:16:38 pm »
You must not keep the "= 0".
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« Reply #8 on: September 19, 2011, 11:23:46 pm »
I did that and the renderer compiled fine, but when i tried to use it in a project I got

1>------ Build started: Project: SPARK Tuto 2, Configuration: Release Win32 ------
1>SPARK_SFML.lib(SPK_SFML_All.obj) : error LNK2001: unresolved external symbol "private: virtual void __thiscall SPK::SFML::SFMLSystem::Render(class sf::RenderTarget &,class sf::Renderer &)const " (?Render@SFMLSystem@SFML@SPK@@EBEXAAVRenderTarget@sf@@AAVRenderer@5@@Z)
1>..\..\..\demos\bin\SPARK Tuto 2.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« Reply #9 on: September 19, 2011, 11:34:31 pm »
fixed it

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
trying to convert Spark to SFML 2
« Reply #10 on: September 19, 2011, 11:57:22 pm »
Well I tried but failed :/
The demo project just crashes and doesnt draw anything, so I guess I will just have to wait untill they make an official update.

Are there any particle systems as good as Spark but that work with SFML2?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
trying to convert Spark to SFML 2
« Reply #11 on: September 20, 2011, 07:47:13 am »
I think that Thor has one.

http://www.bromeon.ch/thor/
Laurent Gomila - SFML developer