HomeHome  SearchSearch  RegisterRegister  Log inLog in  


 SPARK & SFML no Window?

Go down 

Messages : 11
Date d'inscription : 2011-10-12

SPARK & SFML no Window? Empty
PostSubject: SPARK & SFML no Window?   SPARK & SFML no Window? Icon_minitimeWed Oct 12, 2011 2:04 pm


I have a problem with my first touch with SPARK and SFML...
The Problem is that if i open the program only the Console is opened and no Window...
I have described the Problem in a german Forum but i think its better if i ask here too.
The Code of the Program:

#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SPK.h>
#include <SPK_SFML.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <iostream>

#if defined(WIN32) || defined(_WIN32)
#include <windows.h>

//Use namespace
using namespace std;

SPK::SPK_ID BaseSparkSystemID = SPK::NO_ID;

int main(int argc, char *argv[])
   cout << "cout" << endl;

   sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SPARK Test");

   //Random seed
   SPK::randomSeed = static_cast<unsigned int>(time(NULL));

   //Sets the update step
   SPK::System::setClampStep(true, 0.1f);      
   SPK::System::useAdaptiveStep(0.001f, 0.01f);

   sf::Event Event;

   //Create Model
   SPK::Model *Model = SPK::Model::create(SPK::FLAG_BLUE | SPK::FLAG_GREEN | SPK::FLAG_BLUE | SPK::FLAG_GREEN,
                                SPK::FLAG_RED  | SPK::FLAG_GREEN | SPK::FLAG_BLUE);

   //Set Parameter
   Model->setParam(SPK::PARAM_BLUE, 0.2f, 0.5f);

   //Set Lifetime
   Model->setLifeTime(1.0f, 2.0f);

   //Create our SFML Renderer
   SPK::SFML::SFMLPointRenderer* Renderer = SPK::SFML::SFMLPointRenderer::create();

   //Zone where the Particles are
   SPK::Point *Point = SPK::Point::create(SPK::Vector3D(400.0f, 300.0f, 0.0f));

   //The Emitter
   SPK::RandomEmitter *Emitter = SPK::RandomEmitter::create();

   //Set Force
   Emitter->setForce(2.0f, 2.2f);

   //Set Zone

   //Set Tank

   //Set Flow

   //Create a Group
   SPK::Group *Group = SPK::Group::create(Model, 500);

   //Set Renderer

   //Set Emitter for the Group

   //Set Gravity
   Group->setGravity(SPK::Vector3D(0.0f, -1.0f, 0.0f));

   //Set Friction

   //Create SFML System
   SPK::SFML::SFMLSystem *System = SPK::SFML::SFMLSystem::create();

   //Add Group

   //Set Render Target

   //Set Shared

   //Set Z Factor

   //Set the Camera Position
   SPK::SFML::setCameraPosition(SPK::SFML::CAMERA_CENTER, SPK::SFML::CAMERA_BOTTOM, static_cast<float>(600), 0.0f);

   //Set the ID
   BaseSparkSystemID = System->getSPKID();

   //Create the real Particle System
   SPK::SFML::SFMLSystem* sparkSystem = SPK_Copy(SPK::SFML::SFMLSystem, BaseSparkSystemID);

   //Spark Factory

         if(Event.Type == sf::Event::Closed)

      //Update System





   System = NULL;

   return EXIT_SUCCESS;
The Compiler runs nothing of the Code, really nothing, the debugger says that he doesnt call the Main function
and the Cout dont issued. So i commented the Code bit by bit and i've found that the Problem is by the
System, Group and Render Object, if i commented they out it worked fine, but it does not really help me...

I hope that someone can help me to fix this strange Problem.
And sorry for my bad english. Razz
Back to top Go down

Messages : 11
Date d'inscription : 2011-10-12

SPARK & SFML no Window? Empty
PostSubject: Re: SPARK & SFML no Window?   SPARK & SFML no Window? Icon_minitimeThu Oct 13, 2011 3:18 am

I have solved the Problem...
Compiled the whole Libary for Microsoft Visual C++ 2010 and it works fine. cheers
Back to top Go down
SPARK & SFML no Window?
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: