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

Pages: [1] 2 3
1
General / Re: Wont run on windows 10
« on: November 26, 2015, 07:13:46 pm »
It doesnt crash. But it wont load either. It is just loading but nothing appears - there is no error message to post + he tried to run it for windows 7 but it also didnt help.

2
General / Wont run on windows 10
« on: November 26, 2015, 06:50:15 pm »
Hello, I have sended a couple of programs to a friend, but he cant run them.
All the programs are just loading but wont either load or crash. Ive tried both Debug and Release but nothing works.
Im using vs 2015 on my win 7. He has win 10. We both have a 64bit-operating system. And ofc. everything runs fine on my PC.

Thanks for any ideas.

3
General / Re: "Sfml-system-2.dll missing in computer"
« on: June 15, 2015, 06:20:38 am »
The DLLs are there - I believe problem is caused by wrong compilation properties beceause other poeple can run the program...
Problem is, I tried dozens of variants and nothing works...

4
General / "Sfml-system-2.dll missing in computer"
« on: June 14, 2015, 10:03:07 pm »
Hello,
I have created a game for my friends, but one of them can not run it. He gets something like "Sfml-system-2.dll missing in computer", strange is, noone else has a same problem...

He has got XP64, updated to W764 OS. I tried diferent varieties of compilations (for 32(86bit), for 64bit and compilation for XPs, but nothing seems to work.

Thanks for any tipe what to do. Tell if You would need some more information...
Thanks for help.

5
Window / Re: Fullscrean falling
« on: June 12, 2015, 08:18:21 am »
Oh, 800 x 650 isnt a valid mode, stupid mistake...
Thank you for solving it.  :-*

6
Window / Fullscrean falling
« on: June 11, 2015, 09:33:02 pm »
Hello, this is code cut off my game - strange thing is that fullscrean sometimes (randomly) falls. Sometimes it stays windowed, sometimes it falls to window and then resize back to fullscrean...
while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event)){
                        if (event.type == sf::Event::Closed)window.close();
                        if (event.key.code == sf::Keyboard::F4)window.create(sf::VideoMode(800, 650), "My window", sf::Style::Fullscreen);
                        if (event.key.code == sf::Keyboard::Escape)window.create(sf::VideoMode(800, 650), "My window", sf::Style::Default);
                }
 
is there a mistake in code? , is good idea to use events for this? Any ideas?
Thanks for replies.

7
Network / Failed to bind listener socket
« on: June 22, 2014, 08:45:52 pm »
Hi
I read a few topics like this one, but I still dont know solution of my problem:
std::cout<<"LISTENNING - stop(0)\n";
                        listener.setBlocking(false);
                        while(true){
                                if(kbhit()){char stop = getch();
                                        if(stop == '0'){std::cout<<"listtenning stopped, return to main\n";return false;}
                                }
                                if (listener.listen(13129) != sf::Socket::Done)
                                        std::cout<<"aborted-er1\n";
                                if (listener.accept(p_socket[act_socketsCount]) == sf::Socket::Done){act_socketsCount ++;}
                                if (act_socketsCount == socketsCount){std::cout<<"all users conected\n";return true;}
                        }
 

- the point is that when i run the program it starst to write in console Failed to bind listener socket, but the program works OK (the clients can join normaly)- I just dont want that stuff in console.(or use something like cls...)
thanks for answers.

8
Graphics / real mouse coordinates
« on: June 09, 2014, 04:49:01 pm »
Hello, i need to get real mouse coordinates - coordinates relatively to SFML world - no to the window.
This is problem when I use views - I actually can calculate this using view.get...();
But when I use rotation of views, zoom, Im mooving with that view and so on... Its starting to be complicated...
Is there way to get mouse real coordinates directly (easily)?
Thanks for answers.

9
Graphics / Re: one texture problem
« on: May 24, 2014, 12:19:02 pm »
ok, I find out that static member HAVE TO be defined. When I use classic c++ variables it's clear, but how can i define sf::Texture outside the main(){}?(by definition of texture i mean something like .loadFromFile("")
Thanks for replies.

10
Graphics / one texture problem
« on: May 23, 2014, 09:48:32 am »
Hello, im trying to draw dozens of sprites of the same texture - but i dont know how (when im using classes and objects) load texture just once and use it for all my sprites...
I tried static texture but compilator doesnt like it:
1>project2.obj : error LNK2001: unresolved external symbol "private: static class sf::Texture solder::imageSource" (?imageSource@solder@@0VTexture@sf@@A)
1>C:\Users\.\documents\visual studio 2010\Projects\project2\Release\project2.exe : fatal error LNK1120: 1 unresolved externals

here is  my code:
class car{
public:
        void set_up(){
                if(!source.loadFromFile("Untitled.png"));
        }
        car(){
                sprite.setTexture(source);
        }
        ~car(){}

private:
        static sf::Texture source;
        sf::Sprite sprite;
}
 
thans for help.

11
General / Re: c++oop basic
« on: May 22, 2014, 06:08:06 pm »
i actually bought c++ book, but it's quite complicated and when i meet a problem i cant solve it using just book - its hard to find simple solution in 400 pages...
ps: i know this isnt much programing message, but...  And sory for the mess in forums.

12
General / c++oop basic
« on: May 22, 2014, 05:30:32 pm »
hello, how can i get data from one class to another, without using specific object?
-smthing like this:
class bank{
public:
        int getMoney(){return money;}
private:
        int money;
}
class thief{
public:void stole(){
                   int money;
                   money = bank.getMoney;
                   std::cout<<"thief stole"<<money;
           }
}
 

please write an example - im beginner

13
Graphics / sprites filed with ,,strange-shaped textures,,
« on: May 18, 2014, 03:00:00 pm »
hello, im filling sprites with textures - for example with image of ball. When i transfer it to texture and then use this texture for sprite... the sprite wont be just ball, but ball on some square white background (background of image i used)...
so how can i make sprite to ignore background of its image? - have i define all points i want to ignore? - cant i just tell sprite to ignore some colors of its texture? what about sprite of ring (transparent in middle)- for example.

14
Network / recive data in loop
« on: April 30, 2014, 05:12:25 pm »
Hi, how can i receive data in same loop, and in case no data comes in three secs (for example) the loop continues

- i could sand data at,,every start of loop,, just sometimes ,,fill them,, but isnt another easier way?
(tcp cockets)

15
Graphics / Re: too much text problem
« on: April 13, 2014, 06:21:27 pm »
- the problem is definitely in class. - the main(){...} really wont help you, its just creating object of Text_manager, than .set_text(0,24,10);and .add_text(...) twicely, and of course .draw() in main loop...
Something is wrong with class, the description of the problem is above.
Anyway the complete code is here:
#include <SFML/Graphics.hpp>
#include <windows.h>
#include <iostream>

sf::RenderWindow window(sf::VideoMode(800, 650), "screen");

class Text_manager{
public:
    bool add_text(const std::string& text_worlds){
       
                rectangle.setTexture(&texture);
        rectangle.setPosition(0,0);
        rectangle.setSize(sf::Vector2f(800, count * (text_size + space_size)));

                sf::Font font;
        if (!font.loadFromFile("arial.ttf"))
            return false;
        sf::Text text;
        text.setFont(font);
        text.setString(text_worlds);
        text.setCharacterSize(text_size);
        text.setColor(sf::Color::Red);
                text.setPosition(0,count * (text_size + space_size) + space_size);

                renderTexture.create(800, (count + 1) * (text_size + space_size));
        renderTexture.clear();
       
        renderTexture.draw(rectangle);
        renderTexture.draw(text);

        renderTexture.display();

        texture = renderTexture.getTexture();
        count ++;
        return true;
    };
    void set_text(int p_count, int p_text_size, int p_space_size){
        count = p_count;
        text_size = p_text_size;
        space_size = p_space_size;
    };
    void draw(){
        sprite.setTexture(texture);
        window.draw(sprite);
    };

private:
    int count;
        int text_size;
    int space_size;
   
    sf::RenderTexture renderTexture;
    sf::RectangleShape rectangle;  
        sf::Sprite sprite;
    sf::Texture texture;
};


int main()
{
    Text_manager try1;
        try1.set_text(0,24,10);
       
        try1.add_text("text");
        try1.add_text("newText");
        //---------------------------
    while (window.isOpen())
                {
                        sf::Event event;
                        while (window.pollEvent(event)){
                        if (event.type == sf::Event::Closed)window.close();
                        }
                        //------------------------------------------------
                window.clear(sf::Color::Black);
               
                try1.draw();
                //--------------------------
        window.display();
    }

    return 0;
}
 

      

Pages: [1] 2 3