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 - Trampeltier

Pages: [1]
1
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?

2
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