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

Pages: [1]
1
Graphics / sf::Vertex V.S sf::Shape / sf::Sprite
« on: April 19, 2015, 04:47:56 pm »
Hi, is there any reason to use sh::Shape or sf::Sprite instead of sf::Vertex and create your own class with your owns metods? Since sf::Vertex is more efficient, isn't it?

Regards

2
General / Is possible to force mouse to stay in sf::RenderWindow?
« on: January 18, 2014, 12:48:28 am »
Hi, I am learning OpenGL under SFML, and I am trying to move the 3D camera with mouse.

Is there any way to force the cursor to stay in the window? Since I can almost force it with the next code, but it doesnt work when you move the mouse so fast than the cursor can leave the window.

            case sf::Event::MouseMoved:
                // For camera rotation
                gradh += (event.mouseMove.x - (int)window.getSize().x/2)/7;
                grady += (event.mouseMove.y - (int)window.getSize().y/2)/7;
                // Force mouse to stay in the middle
                sf::Mouse::setPosition(sf::Vector2i(window.getSize().x/2,window.getSize().y/2),window);
                break;

Or another way to rotate the camera with mouse?

Sorry if bad english. Greetings

3
Hi, I'm working on a Client App and I wish to create a Client class where I create 2 threads (R and S), who execute functions Receiver and Sender, respectively...
class Client {
    sf::IPAddress ServerAddress;
    sf::SocketTCP Socket;
    sf::Packet Packet;
    sf::Thread R, S;
    void Receiver(void*);
    void Sender(void*);
    bool connected;
    bool updated;
public:
    Client();
    sf::Packet Receive();
    void Send(sf::Packet);
    bool IsConnected();
    bool IsUpToDate();
};
 

Then, I get:
Thread.hpp|92|error: 'sf::Thread::Thread()' is protected|

I tried with
class Client : public sf::Thread {
and
class Client : private sf::Thread {
but this doesn't resolve it

How can I resolve it?

PD: Sorry if bad english ^^

Pages: [1]
anything