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

Pages: 1 2 3 [4] 5 6
46
General / Re: C++11 and SFML 2.0
« on: February 15, 2013, 10:03:52 pm »
Okay, I followed the tutorial and have configured and generated with CMake.

I have the following files but I'm finding the rest of the tutorial hard to follow, I'm really lost on what to do next.



Also I got no options about c++11 flags or anything like that, so I may not have even done it right. :/

47
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 06:53:58 pm »
Thanks for the help guys :)

So to get the new templates for Xcode I have to recompile SFML with C++11, any tutorials on how to do this?

Is this what you mean? http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

48
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 09:33:32 am »
Okay I have found what causes the issue. :)

In my build settings I have this by default:


Which gives me errors on the SFML side of things:


To fix it I set it to the compiler default:


Which causes me to lose C++11 compatibility:


Anyone know how to get around this?

49
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 09:12:03 am »
Sorry, my language isn't 100% correct.

Will do. :)

50
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 08:53:28 am »
Hmm ok :/

Like I said, projects without SFML work with C++11 fine, just seems odd it stops working as soon as I link SFML.

51
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 08:44:30 am »
Yep, I still get an error with the code you posted above.

Any clue what I would be doing wrong with my setup?

52
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 08:30:43 am »
Okay, I typed up the code under the Networking tutorial for SFML and included <thread>

#include <iostream>
#include <thread>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include "ResourcePath.hpp"

using namespace sf;
using namespace std;

int main(){
    RenderWindow window(VideoMode(800, 600), "SFML Networking - MarcuzPwnz");
   
    cout << "Would you like to be a server or client? (c/s)" << endl;
    char input = ' ';
    cin >> input;
    if(input == 'c'){
    /* CLIENT */
        TcpSocket socket;
        socket.connect("localhost", 1337);
       
        string message = "Hey, I'm the client!";
        socket.send(message.c_str(), message.size() + 1);
       
        char buffer[1024];
        size_t received = 0;
        socket.receive(buffer, sizeof(buffer), received);
        cout << "[Server]: " << buffer << endl;
            }else{
    /* SERVER */
        TcpListener listener;
        listener.listen(1337);
       
        TcpSocket socket;
        listener.accept(socket);
        cout << "Client connected: " << socket.getRemoteAddress() << endl;
       
        char buffer[1024];
        size_t received;
        socket.receive(buffer, sizeof(buffer), received);
        cout << "Client: " << buffer << endl;
       
        string message = "Welcome client!";
        socket.send(message.c_str(), message.size() + 1);
       
    }
   
    while(window.isOpen()){
       
       
        Event event;
        while(window.pollEvent(event)){
           
        }
    }
    return 0;
}

The code runs fine without #include <thread> on the second line, but with it I get errors.

Error: Lexical or Preprocessor Issue. 'thread' file not found.

Thanks for the reply. :)

53
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 07:38:13 am »
I am running Mac OSX 10.7.5 and have my Xcode update to the latest version.  I can run C++11 features fine without SFML, just with SFML I can't seem to use C++11 :o

54
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 06:49:09 am »
Thanks! :D

Is it known if SFML will ever just support C++11 out of the box like it does with the current version of C++?

55
General / Re: C++11 and SFML 2.0
« on: February 14, 2013, 06:10:36 am »
Where do I set flags? and are you talking about the tutorial found in the tutorials section of the site? or is it somewhere on the forums? :)

56
General / C++11 and SFML 2.0
« on: February 14, 2013, 04:42:46 am »
I was working with the network module from SFML 2.0 this morning and tried to use the std::thread class that was introduced in C++11 and noticed that I could only use sf::Thread class from SFML.

Am I doing something wrong? or is C++11 not supported yet on SFML 2.0?

As a side note I'm on a Mac so I'm not sure if that's the issue.

57
SFML projects / Re: [First SFML Project] 2D Minecraft
« on: February 11, 2013, 08:51:49 am »
@eXpl0it3r, Okay, I wasn't trying to start a flamewar I was just trying to have a laugh.


58
SFML projects / Re: [First SFML Project] 2D Minecraft
« on: February 10, 2013, 09:51:36 am »
Nope :/

mingw32-g++.exe -std=c++11 -Wall -DSFML_STATIC  -std=c++11 -g    -IC:\Users\newowner\Documents\TDM471x32\include -I"C:\Program Files\CodeBlocks\include"  -c "C:\Users\newowner\Documents\Marcuzcraft 2D v0.1.3\Source\BlockHandler.cpp" -o "obj\Debug\Documents\Marcuzcraft 2D v0.1.3\Source\BlockHandler.o"
cc1plus.exe: error: unrecognized command line option '-std=c++11'
cc1plus.exe: error: unrecognized command line option '-std=c++11'
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)

THIS is the reason I have a Mac. :P hehe

59
SFML projects / Re: [First SFML Project] 2D Minecraft
« on: February 10, 2013, 02:12:32 am »
From http://en.sfml-dev.org/forums/index.php?topic=9513.0 do I want to download the latest build for MinGW TDM GCC 4.7.1 32bit?

Considering I have MinGW 4.7.1? :)

60
SFML projects / Re: [First SFML Project] 2D Minecraft
« on: February 10, 2013, 12:51:44 am »
MinGW 4.7.1 :)

I will download the nightly build and try that out later today, I'm going out for a bit. :)

Thanks again for all the help!


Also "You probably should implement a parser and keep the data (which texture part relates to with tile) in an external file, which can then get parsed on runtime. This not only gives you way more freedom in adding/removing new stuff, but it also allows you to reduce the codebase dramatically."

I'm really new to all this and I have no clue what any of that really means, sorry. :S

Pages: 1 2 3 [4] 5 6
anything