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 - Mad Engineer

Pages: [1]
1
General discussions / Linux Code Editor
« on: September 06, 2015, 02:08:22 pm »
I just switched to Linux... So far i used Atom to edit my code but can someone recommend an IDE. I'm using Xubuntu if that matters.

2
Network / TCPListener not able to listen to port
« on: January 25, 2014, 09:19:08 pm »
When i create listener and make him listen for incoming connection, he waits and when connection arrives he accepts connection and everything is good.

But when i set listener to non-blocking mode my console window gets spamed with error messages that listener cant listen to specific port, but when i try to connect he accepts the connection from client.

This is minimal example of my code.

#include <SFML/Network.hpp>

#include <iostream>

int main()
{
   
        sf::Clock clock;
        sf::Time deltaTime = sf::seconds(1.f / 60.f);
        sf::Time timeSinceLastUpdate = sf::Time::Zero;

        sf::TcpListener listener;
        listener.setBlocking(false);

        sf::TcpSocket sockets[3];
       
        for (int i = 0; i < 3 ; i++)
        {
                sockets[i].setBlocking(false);
        }

        int socketCounter = 0;

        while (true)
        {
                timeSinceLastUpdate += clock.restart();

                while (timeSinceLastUpdate > deltaTime)
                {
                        timeSinceLastUpdate -= deltaTime;
                       
                        //60 fps....

                        listener.listen(27100);

                        if (listener.accept(sockets[socketCounter]) == sf::Socket::Done)
                        {
                                socketCounter++;
                                std::cout << "Player Connected";
                        }

                }
               
                //max fps...
               
        }

    return 0;
}

3
Window / .Net resize window [Solved]
« on: January 19, 2014, 04:17:40 pm »
I want to know how to re-size view when i re-size pictureBox.

This is my code so far, but it doesn't work well:

private RenderWindow window = null;

SFML.Graphics.View view = new SFML.Graphics.View();

window = new RenderWindow(pictureBox1.Handle);

view.Reset(new FloatRect(0f, 0f, pictureBox1.Width, pictureBox1.Height));
           
window.SetView(view);

private void Form1_Resize(object sender, EventArgs e)
{
            view.Reset(new FloatRect(0f, 0f, pictureBox1.Width, pictureBox1.Height));
            window.SetView(view);
 
}

When i start program everything is great, but when i re-size window(pictureBox) all Sprites start to get wider when i reduce size and smaller when i increase size.

4
General discussions / Cloud storage :D
« on: January 17, 2014, 06:36:08 pm »
Just found out this cloud storage that offers sync application and 20 gb at start and +5 gb for every invite to infinity. You can use this link to register and get +5 gb at start :D , and also help me get some more :P

https://copy.com?r=vFuKFx  (link broken pls copy it)


5
Graphics / Pass RenderWindow to function
« on: January 12, 2014, 10:55:02 pm »
Lets say i have main function and there i have declared a RenderWindow window.

In my player class i have Draw function to draw everything relevant to player. How can i pass window from my main function  to my draw function in player class so i can draw player stuff, and then just call player.draw( render window) in main game loop.

6
Graphics / OpenGL error report in console window
« on: January 11, 2014, 08:30:37 pm »
So program works fine but i get this weird error message in console window, anyone knows what might be the problem. I never got this kind of error in 2.0 , but now in 2.1 i get it. There is screen shot i hope its big enough to read.

Also, when i set release build i get no error in console window, when debug build is set i get error as shown in screen shot.

7
Network / Networking question
« on: January 05, 2014, 02:23:04 pm »
Let's say i have 2 computers.
On one computer i have two applications that receive data.
With second computer i have application that is sending data.

How can i send data to specific application and not both of them, with only using one port.

8
General / Using SFML with win32 API
« on: December 28, 2013, 09:51:07 pm »
Is it possible to make only part of the window render target, so i can use rest of the window for my win32 commands. I want to do this to create map editor for my 2D game.

9
Graphics / Shader exemple not working
« on: December 27, 2013, 06:41:34 pm »
When i start Shader example that comes with SFML 2.0 it says shader not supported. Does that mean shaders for that example are written with GLSL that my GPU does not support ???

10
General / Build for Visual Studio 2013 ?
« on: July 14, 2013, 06:29:21 pm »
When we can get build for Visual Studio 2013 ?

11
General / What is the best way to limit fps?
« on: February 17, 2013, 06:10:53 pm »
So i have problem with my game. It works very well on my computer. But when i play it on slower computer it just runs slow, and if i play it on faster computer everything moves faster. So my question is, what is the best way to limit loop per sec (fps) to 60 so it can run at the same speed on all computers ?

Pages: [1]
anything