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.


Messages - Trampeltier

Pages: [1]
1
General / Re: SFML Thor BigSprite Abstract class error
« on: March 22, 2014, 03:23:24 pm »
:D Yes, you are right.
I don't know why I didn't google it myself, maybe I didn't see any hope in it doing that.
Whatever, works now and everybody is happy (maybe you are not happy because you worked for me but someday who knows, I will work for you?)

2
General / Re: SFML Thor BigSprite Abstract class error
« on: March 22, 2014, 12:31:16 am »
Actually I was too lazy to google it  :P

Edit: Downloaded and installed VS2010 SP1, works fine now.

3
General / Re: SFML Thor BigSprite Abstract class error
« on: March 21, 2014, 10:56:33 pm »
So here is the CMake error:
  LINK : fatal error LNK1123: Fehler bei der Konvertierung in COFF: Datei ist ungültig oder beschädigt. [E:\docs\c++\SFML\SFML-master\Build\CMakeFiles\CMakeTmp\cmTryCompileExec3242043022.vcxproj]


Maybe you can help me out.

4
General / Re: SFML Thor BigSprite Abstract class error
« on: March 21, 2014, 09:06:58 pm »
So how can I compile the latest thor version with SFML 2.1 without using CMake?
CMake doesn't work for me for some reason...

5
General / SFML Thor BigSprite Abstract class error
« on: March 21, 2014, 06:47:42 pm »
Hi,
I  am using thor::BigSprite class (http://www.bromeon.ch/libraries/thor/v1.1/doc/classthor_1_1_big_sprite.html)
When i try to use this class as an object, there come multiple error messages:


#ifndef BACKGROUND_H
#define BACKGROUND_H

#include <SFML\Graphics.hpp>
#include <Thor\Multimedia.hpp>
#include <string>

namespace classes
{
        namespace gui
        {
                class Background
                {
                public:
                        Background() {state = false;}

                        // Constructor with arguments
                        Background(std::string TexturePath, sf::Vector2f WindowSize);

                        //Changes picture
                        void SetTextureFromFile (std::string TexturePath);

                        //Scaling background to window
                        void ScaleToWindow(sf::Vector2f WindowSize);

                        //Draw
                        void Draw(sf::RenderWindow &window);

                        //Sets the state
                        void SetState(bool Bool);

                        //returns the state
                        bool GetState();
                private:
                        thor::BigTexture texture;
                        thor::BigSprite sprite;  // "sprite" is red underlined
                        bool state;
                };
        }
}
#endif // BACKGROUND_H

#include "Background.h"

namespace classes
{
        namespace gui
        {
                Background::Background(std::string TexturePath,sf::Vector2f WindowSize)
                {
                        state = false;
                        SetTextureFromFile(TexturePath);
                        ScaleToWindow(WindowSize);
                }
                void Background::SetTextureFromFile (std::string TexturePath)
                {
                        this->texture.LoadFromFile(TexturePath);
                        this->sprite.SetTexture(texture);
                }
                void Background::ScaleToWindow(sf::Vector2f WindowSize)
                {
                        this->sprite.setScale( (WindowSize.x / this->texture.GetWidth()), (WindowSize.y / this->texture.GetHeight()));
                }
                void Background::Draw(sf::RenderWindow &window)
                {
                        window.draw(this->sprite);
                }
                void Background::SetState(bool Bool)
                {
                        state = Bool;
                }
                bool Background::GetState()
                {
                        return state;
                }
        }
}

1>c:\dropbox\c++ vr\sfml-2.1\include\thor\multimedia\shapes.hpp(111): error C2259: 'thor::ConcaveShape': Instanz von abstrakter Klasse kann nicht erstellt werden
1>          aufgrund folgender Member:
1>          "void sf::Drawable::draw(sf::RenderTarget &,sf::RenderStates) const": ist abstrakt
1>          c:\dropbox\c++ vr\sfml-2.1\include\sfml\graphics\drawable.hpp(69): Siehe Deklaration von 'sf::Drawable::draw'
1>c:\dropbox\c++ vr\click-game\click-game\click-game\background.h(36): error C2259: 'thor::BigSprite': Instanz von abstrakter Klasse kann nicht erstellt werden
1>          aufgrund folgender Member:
1>          "void sf::Drawable::draw(sf::RenderTarget &,sf::RenderStates) const": ist abstrakt
1>          c:\dropbox\c++ vr\sfml-2.1\include\sfml\graphics\drawable.hpp(69): Siehe Deklaration von 'sf::Drawable::draw'
1>  ScoreManager.cpp

My Visual Studio 2010 is German, sorry about that.

So it say that the thor::BigSprite class is an abstract class because of sf::Drawable::draw().
Doesn't thor::BigSprite have its own definition of draw() ?
So what reason could be this error?

6
Window / Re: TextEntered Event does weird stuff
« on: January 15, 2014, 10:50:42 pm »
Thanks, so now I'm using if-statement instead of switch and it's working!
But why is that if I may ask you?

7
Window / Re: TextEntered Event does weird stuff
« on: January 15, 2014, 10:21:48 pm »
So my code looks like this:


//This function is triggered in the main function
void game::events::mainEvents()
{
        sf::Event Event;
        while (game::Window->pollEvent(Event))
        {
                switch (Event.type)
                {
                case sf::Event::Closed:
                        game::events::Close(Event);
                case sf::Event::Resized:
                        game::events::Resize(Event);
                case sf::Event::MouseMoved:
                        game::events::MouseMove(Event);
                case sf::Event::MouseButtonReleased:
                        game::events::MouseReleased(Event);
                case sf::Event::TextEntered:
                        game::events::TextEntered(Event);
                }
        }
}

//This is the TextEntered-Event Function:
void game::events::TextEntered(sf::Event& Event)
{
        for(unsigned int i = 0; i < game::gui::GUIManagerVector.size(); i++)
        {
                game::gui::GUIManagerVector[i]->CheckPossibleTextEntered(Event, *game::Window);
        }
}

void game::gui::GUIManager::CheckPossibleTextEntered(sf::Event& Event, sf::RenderWindow& Window)
{
        for(size_t i = 0; i <  this->InputBoxes.size(); i++)
        {
                if (InputBoxes[i]->GetState())
                {
                        char TempChar = static_cast<char>(Event.text.unicode);
                        std::string TempString(1, TempChar);
                        std::cout << TempString;
                        std::ofstream Write("weirdtext.txt", std::ios::app);
                        Write<< TempString;
                        Write.close();
                       
                        InputBoxes[i]->AddText(TempString);
                }
        }
}

 

8
Window / TextEntered Event does weird stuff
« on: January 15, 2014, 09:51:15 pm »
Hi everyone,
my problem is that if I use the TextEntered-Event, It's working fine, BUT there will spawn RANDOM GENERATED CHARACTERS  :o :o :o :o
It's not the first time it happened to me - in my last project aswell.
I'm using the event as given in the documentation, so am I the only one beeing affected by that?
Could there be programs, which create these symbols?
Here is an example of the symbols - I have saved them by using fstream:

Ì  îÞÑ´ª¢š‰~o^IA<5&    
,,F“¨¶Üëø ÿüôîéä×ÑÈÀ¬ —Ž|pcU.zzjYF?;742111 1111111111111111000 ÿ໕e4%% ÷éÚǵž‹u_M=.#    !$&()+,-..///00/-("
$).269<>@B>=;::98740+%~vi]QD9*þìßʹ¨šŽ~ri`WOH?80' '/:=@@ABBCDDFFHKNUY\adgknstvwxxxxyyyyyyyxvvusqokgffeedccbZVRK5&)S~¦Çé
þûûú ÷ôóòññïîÜƱ ‰uI2*>LWabdd\P B.

 ””­É'ùÌ {[

þþü.>O^’¥³ÂÌÔÙàãåæææèéêêêêêêéééçåáÞÚÔÎÈþº¹¹¹º½ÂÉÓåù`bcddeed^320/.,+)'&%$$$$$$$$$$$$$11ƒƒ{uqkd^ZVROLIFC@=;:876555544444445569<?BDEGGHHIIJJKMNPSWZ_bfilortwy{~€‚‚‚ƒ„„„      cceffgghijjjjj29ABDEFFFFEDA?=;862-'8889<>ADGJQTYbekqw}ˆ’—› ¤¨­±³µ¶¶······¸¸º»¼¼¼ÆÏÖÝÞÞÞÞ*8DLWXYYYYTO.7899MŽ…}uqooqrty{|ƒ‡Œ’¥­³´´´±¬¨¢š“Šjjlmmlkhecba`WVRI3ÿã '>HVaqwyy yyyyvvurpnl &"%Œ’–š¡§©«ª§¦¥¢ œ™˜—–‘Ž‹ˆ„}wsnheba`_^][WUTNIGEA>:974&-'T~±1BR\djoqtyzz{|}~€„‡‹Ž““’’‘‘‘““”••—˜˜˜šúáÃŽw`M0  "1<HUdimpstux}‡‰‹ŒŒŽ‘’•–˜˜™šš›œœž ¢±±°¯¯®®®®®®®®¯²µ·ºÁÅÉÌÖÙÜÞÞáãäää äãáàÝÛÙ×ÖÑÏÌÊÅÃÀ½´°«¥™“ˆ|vqld`[WMJFEZesŒ— ¡ ‹|m\>/!De—›œ œŸ§®µ¿ÐÖÕ̺¨qIººººººº¹¹¹¼½ÁÄÉÎ×ãìõü  !##$$%%%%$#!!!!ëêç1Kdz% 77779<>??60+&" ü÷ôðíêéèçåáÞÚØÕÒÐÎÍÌËÕÜâéïöý  !#%'.4;DO\hu‡­yF ךe5%4?IU_gov{ƒƒ„„†‡ˆ‰ŠŒ…~tk^QB/"*2:@GLN[]ekw}ƒ‰’™Ÿ£«nA 


If there is no way fixing that, should I use the KeyPressed-Event?

Pages: [1]
anything