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

Pages: [1] 2
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 / Re: TCPListener not able to listen to port
« on: January 25, 2014, 09:36:39 pm »
Never mind, solved it. I should have put listener.listen() outside of while loop so it gets called only once at the start of the program...

3
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;
}

4
Window / Re: .Net resize window
« on: January 19, 2014, 06:13:52 pm »
omg , dat line of code XD . Ty so much for help :D

5
Window / Re: .Net resize window
« on: January 19, 2014, 05:54:49 pm »
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SFML.Window;
using SFML.Graphics;

namespace Test
{
    public partial class Form1 : Form
    {
        private RenderWindow window = null;

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

        float mousePositionXpictureBox;
        float mousePositionYpictureBox;

        float mousePositionXMap;
        float mousePositionYMap;

        bool mouseInRender = false;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            window = new RenderWindow(pictureBox1.Handle);

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

            timer1.Enabled = true;

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            window.Clear(SFML.Graphics.Color.Red);

            //DRAW BEGIN

           

            //DRAW END
            window.Display();

            if (mouseInRender == true)
            {
                if (mousePositionXpictureBox < 100)
                {
                    view.Move(new Vector2f(-5f, 0f));
                    window.SetView(view);
                   
                }
                if (mousePositionXpictureBox > pictureBox1.Width - 100f)
                {
                    view.Move(new Vector2f(5f, 0f));
                    window.SetView(view);
                   
                }

                if (mousePositionYpictureBox < 100)
                {
                    view.Move(new Vector2f(0f, -5f));
                    window.SetView(view);
                   
                }
                if (mousePositionYpictureBox > pictureBox1.Height - 100f)
                {
                    view.Move(new Vector2f(0, 5f));
                    window.SetView(view);
                   
                }
            }

           

        }

        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            mousePositionXpictureBox = e.X;
            mousePositionYpictureBox = e.Y;

            mousePositionXMap = e.X + view.Center.X - pictureBox1.Width / 2;
            mousePositionYMap = e.Y + view.Center.Y - pictureBox1.Height / 2;

        }

        private void pictureBox1_MouseLeave(object sender, EventArgs e)
        {
            mouseInRender = false;
        }

        private void pictureBox1_MouseEnter(object sender, EventArgs e)
        {
            mouseInRender = true;
        }

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

    }
}

6
Window / Re: .Net resize window
« on: January 19, 2014, 05:25:06 pm »
Yes it is called i tested it with changing text in label. And i have tried to put it in pictureBox_Resize but still get same result;

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

8
General discussions / Re: Cloud storage :D
« on: January 18, 2014, 10:53:46 am »
When i reinstall my computer i usually want to format whole hard drive not just C drive. So i need to store all my movies music and stuff , witch is usually around 50gb-s, that's why i need it, but on the other hand i'm thinkind on getting an external hard drive and keeping my data on that :D

Also i'm using cloud storage sync application to sync my projects between my computer and laptop :D ( that need ~1gb XD ).

9
General discussions / Re: Cloud storage :D
« on: January 17, 2014, 11:38:13 pm »
Well i'm sorry if i offended someone with this post just wanted to share it with you guys. It is better then dropbox, gdrive, and skydrive because it offers unlimited space with invites... I was really hyped about it when i found out today about it, so i thought i share it ( and yes get some more space :P ) . If you want you can remove post i don't have anything against it, just thought this is a part of the forum for general stuff .

10
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)


11
Graphics / Re: OpenGL error report in console window
« on: January 14, 2014, 08:16:46 am »
Just found out that my Radeon HD 4000 series is no longer supported and i cant find appropriate driver for windows 8.1 there is only driver for windows 8.0 and before. Guess i'll go back to Windows 7 and hopefully solve this.
Many drivers are not marked explicitly for Win 8.1 but the Win 7/8 will still flawlessly work on Win 8.1, similar as to how you can still play games that are "just" for Vista. ;)
But you already downgraded so... :D

Trust me, i installed everything that i found on the interwebz but with no luck , sfml was still reporting that OpenGL 1.1 was in use :( .

12
Graphics / Re: OpenGL error report in console window
« on: January 14, 2014, 08:03:08 am »
Just finished installing Windows 7 and setting up all my stuff for SFML. And not only it is working now, but also i get like 1500 fps and before was only like 150 with few draw calls and unplayable with 10+ draw calls. So thank you all who replayed and make me realize that it was the driver problem :D

13
Graphics / Re: OpenGL error report in console window
« on: January 13, 2014, 08:13:27 pm »
Just found out that my Radeon HD 4000 series is no longer supported and i cant find appropriate driver for windows 8.1 there is only driver for windows 8.0 and before. Guess i'll go back to Windows 7 and hopefully solve this.

14
Graphics / Re: OpenGL error report in console window
« on: January 13, 2014, 07:54:27 pm »
Its says:

OpenGL version 1.1

15
Graphics / Re: OpenGL error report in console window
« on: January 13, 2014, 06:26:35 pm »
It occurs when i try to load texture with texture.LoadFromFile.

I don't know what it is, its driving me crazy i even reinstalled my computer i got everything fresh i linked all dll-s for debug with -d and for release without it. I get no errors in release mode but in debug i get them :S :S :S .


Pages: [1] 2
anything