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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Assimodeus

Pages: [1]
1
General / After installing SFML Full SDK ver1.4: unusual Termination
« on: January 08, 2009, 12:22:51 am »
I started a project, which used to run properly using 1.3, and i got a runtime error now:



how could it be?


note: i did no changes in the source, just installed 1.4.


EDIT: Code

SfShapeSpriteMove.cpp

Code: [Select]


/*
 * SfShapeSpriteMove.cpp
 *
 *  Created on: 05.01.2009
 *      Author: Meta
 */

#include <iostream.h>
#include <SFML/Graphics.hpp>
#include "SfShapeSpriteMove.h"
//#include "MyKoords.h"


int main(){

/*INITIALISIERUNGEN */

sf::RenderWindow App(sf::VideoMode(1024,748,32),"SFML Bewegung",sf::Style::Close, sf::WindowSettings(24,8,0));
    //App.SetBackgroundColor(sf::Color(0,0,0,255));
    App.SetFramerateLimit(60);

    //MyKoords myxysys(100,10,&App);

    sf::Shape spr1 = sf::Shape::Circle(500,375,25,sf::Color::Green,1,sf::Color::Black);


    sf::String success = sf::String("ERFOLG!",sf::Font::GetDefaultFont(),50.f);
    success.SetColor(sf::Color(255,255,255));


    while(App.IsOpened()){

 sf::Event Event;
while(App.GetEvent(Event)) {

//Abarbeitung des Events "CLOSE"
if((Event.Type==sf::Event::Closed))
App.Close();  //falls das X geklickt wurde, schließe App


//geradlinige Bewegungen mit je einer Pfeil-Taste, Move: float x float ---> void
if((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Up))
   spr1.Move(0,-10);

            if((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Down))
                spr1.Move(0,10);

            if((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Right))
            spr1.Move(10,0);
            if((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Left))
            spr1.Move(-10,0);

            /*TODO schräge Bewegungen mit mehreren Pfeil-Tasten, Move: Vector2f  ---> void
            hmm will nich so recht

            //falls das Event lautet "je beide Tasten gedrückt" ...
            if(((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Up))&&((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Right)))

            //...mache solange wie sie gedrückt sind
 while((App.GetInput().IsKeyDown(sf::Key::Up))&&(App.GetInput().IsKeyDown(sf::Key::Right)))
    //...einen Move
 {spr1.Move(sf::Vector2f(10,-10));App.Draw(success);}

if(((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Down))&&((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Right)))

while((App.GetInput().IsKeyDown(sf::Key::Down))&&(App.GetInput().IsKeyDown(sf::Key::Right)))
         {spr1.Move(sf::Vector2f(10,10));App.Draw(success);}

if(((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Down))&&((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Left)))

while((App.GetInput().IsKeyDown(sf::Key::Down))&&(App.GetInput().IsKeyDown(sf::Key::Left)))
      {spr1.Move(sf::Vector2f(-10,10));App.Draw(success);}

if(((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Up))&&((Event.Type==sf::Event::KeyPressed)&&(Event.Key.Code == sf::Key::Right)))

while((App.GetInput().IsKeyDown(sf::Key::Up))&&(App.GetInput().IsKeyDown(sf::Key::Left)))
   {spr1.Move(sf::Vector2f(-10,-10));App.Draw(success);}
                */

}

        App.Draw(spr1);


        /*Ausgabe der aktuellen Position von spr1 im Fenster auf die Standard Ausgabe*/
        float xs1 = spr1.GetPosition().x;
        float ys1 = spr1.GetPosition().y;


        std::cout<<"Circle spr1 drawed"<<endl;
        std::cout << "Position "<< "(" << xs1 <<","<< ys1 << ")" << endl;


        //myxysys.drawKoord();
App.Display(); //erschaffenes Fenster anzeigen
}

return EXIT_SUCCESS;
}







SfShapeSpriteMove.h
Code: [Select]
/*
 * SfShapeSpriteMove.h
 *
 *  Created on: 05.01.2009
 *      Author: Meta
 */

#ifndef SFSHAPESPRITEMOVE_H_
#define SFSHAPESPRITEMOVE_H_

/*Klassendeklaration*/
class SfShapeSpriteMove {
public:
SfShapeSpriteMove();
virtual ~SfShapeSpriteMove();
};

#endif /* SFSHAPESPRITEMOVE_H_ */

2
Window / Undefined Reference Errors
« on: December 13, 2008, 03:19:31 pm »
Hey guys,

i got a problem compiling one of the Window-Tutorials (the very first writing a simple Window without Event-Handling).



So i got 3 'undefined Reference' Errors:

I calling the constructor

II calling the member-function "Display()" of "Window App"

III calling the Destructor ~Window()


But..why?

My IDE is Eclipse 3.4.0 (CDT Plugin) using the MinGW/GCC Toolchain (ver. unknown, probably 4.1/4.2).

I'm grateful for every helpful hint.



PS:  SeFu was used & google is my friend.

Pages: [1]
anything