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

Pages: [1] 2 3
1
General discussions / SFML 2 for OS X comes true!
« on: October 18, 2011, 11:14:27 pm »
That seemed to work better! Stupid GUI indeed.

Thanks for the help!

2
General discussions / SFML 2 for OS X comes true!
« on: October 18, 2011, 01:38:39 pm »


Made a video to show my problem. Any thoughts?

3
General discussions / SFML 2 for OS X comes true!
« on: October 17, 2011, 03:30:46 pm »
It seems like Cmake ignores when i tick Build Frameworks. No frameworks :(

4
General discussions / SFML 2 for OS X comes true!
« on: October 17, 2011, 03:25:42 pm »
OK LOL WUT i renamed them from libsfml-audio.2.0.dylib to libsfml-audio-d.dylib and it worked.

Is this a bug?

5
General discussions / SFML 2 for OS X comes true!
« on: October 17, 2011, 03:04:40 pm »
I get

Code: [Select]
Command /Developer/usr/bin/clang++ failed with exit code 1

ld: library not found for -lsfml-system-d



I have built SFML2 with the makefile, done sudo make and sudo make install and there are files in /usr/local/lib and include.

I am using the Xcode 4 templates.

Lion 10.7.2 / Xcode 4.2


6
Graphics / Display only a part of a string
« on: January 07, 2009, 08:17:55 pm »
You can of course make a lot of ugly hacks to solve this problem.

One simple i can think of, not very general but at least a cheap solution is to draw a color in a PNG (or fileformat with support for alpha channel) and make a gradient with Your color to transparent, then just move this over the text corresponding to what you want to fade in.

WOILA INSTANT FADE!

7
General discussions / SFML 1.3 and OS X
« on: December 26, 2008, 07:08:44 pm »
Hey!

A freind of me is trying out some of the networking functions of SFML, this example works perfectly on his Windows computers and he thought i might give it a go and compile it:

Code: [Select]

#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;

const bool DEBUG = true;

const unsigned int PORTTCP = 4567;
const unsigned int PORTUDP = 4568;

struct Client
{
sf::SocketTCP socket;
sf::IPAddress address;
};

bool running = true;
string errMess;

sf::Mutex globalMutex;

vector<Client> connClients;
vector<sf::SocketTCP> connSendClients;

void handleConn(void *UserData)
{
if(DEBUG)
{
globalMutex.Lock();
cout << "\tDEBUG: Entering thread: \"handleConn()\"." << endl;
globalMutex.Unlock();
}

sf::SocketTCP listener;
if(!listener.Listen(PORTTCP))
{
running = false;
errMess = "Failed listening to port!";
return;
}

cout << "Listening to port " << PORTTCP << ". Waiting for TCP connections..." << endl;

sf::SelectorTCP selector;
selector.Add(listener);
while(running)
{
unsigned int NbSockets = selector.Wait(5.f);

for(unsigned int i = 0; i < NbSockets; i++)
{
sf::SocketTCP socket = selector.GetSocketReady(i);

//New connection.
if(socket == listener)
{
sf::IPAddress address;
sf::SocketTCP client;
listener.Accept(client, &address);

globalMutex.Lock();
cout << "Client connected ! (" << address << ")" << endl;
globalMutex.Unlock();
selector.Add(client);

Client tmpClient;
tmpClient.socket = client;
tmpClient.address = address;
connClients.push_back(tmpClient);

sf::SocketTCP tmpSocket;
if(!tmpSocket.Connect(PORTTCP, address))
{
globalMutex.Lock();
cout << "Unable to connect to client! (" << connClients[i].address.ToString() << ")" << endl;
globalMutex.Unlock();
}
connSendClients.push_back(tmpSocket);
}

else
{
sf::Packet packet;
if(socket.Receive(packet) == sf::Socket::Done)
{
sf::Int8 isMess;
string clientName;
string mess;
packet >> isMess >> clientName >> mess;

if(isMess == 0)
{
if(mess == "quit")
{
sf::IPAddress droppedIP;
int q;
for(unsigned int i = 0; i < connClients.size(); i++)
{
if(socket == connClients[i].socket)
{
droppedIP = connClients[i].address;
q = i;
}
}
globalMutex.Lock();
cout << "Client dropped! (" << droppedIP.ToString() << ")" << endl;
globalMutex.Unlock();
selector.Remove(socket);
globalMutex.Lock();
connClients.erase(connClients.begin()+q);
globalMutex.Unlock();
}
}

if(isMess == 1)
{
if(DEBUG)
{
globalMutex.Lock();
cout << "Message recieved!" << endl;
globalMutex.Unlock();
}
globalMutex.Lock();
cout << clientName << ": " << mess << endl;
globalMutex.Unlock();

if(DEBUG)
{
globalMutex.Lock();
cout << "\tDEBUG: connSendClients.size(): " << connSendClients.size() << endl;
globalMutex.Unlock();
}
for(unsigned int i = 0; i < connSendClients.size(); i++)
{
if(connSendClients[i].Send(packet) != sf::Socket::Done)
{
globalMutex.Lock();
cout << "Unable to send packet to client! (" << connClients[i].address.ToString() << ")" << endl;
globalMutex.Unlock();
}
}
}
}
}
}
globalMutex.Lock();
cout << "...waiting!" << endl;
globalMutex.Unlock();
}

for(unsigned int i = 0; i < connSendClients.size(); i++)
{
connSendClients[i].Close();
}
}

int main()
{
sf::RenderWindow app(sf::VideoMode(800, 600, 32), "Julles chatt server.");

sf::Thread connThread(&handleConn);
connThread.Launch();

while(app.IsOpened())
{
sf::Event Event;
while (app.GetEvent(Event))
        {
            // Close window : exit
            if(Event.Type == sf::Event::Closed)
app.Close();

if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
app.Close();
}

app.Display();
}
running = false;
connThread.Wait();

    return 0;
}


It compiles in OSX, but at runtime i get this:

Code: [Select]

...waiting!
Client connected ! (83.227.232.222)
...waiting!
SFML2(1725,0xb0147000) malloc: *** error for object 0xa02056d8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
SFML2(1725,0xb0147000) malloc: *** error for object 0xa02056d8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Message recieved!
blabla: tjo din keffade grek
DEBUG: connSendClients.size(): 1
Unable to send packet to client! (83.227.232.222)
...waiting!
SFML2(1725,0xb0147000) malloc: *** error for object 0xa02056d8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
SFML2(1725,0xb0147000) malloc: *** error for object 0xa02056d8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Message recieved!
blabla: jkhdfjkdh
DEBUG: connSendClients.size(): 1
Unable to send packet to client! (83.227.232.222)
...waiting!
Program received signal:  “SIGPIPE”.
Xcode: Introspection dylib not loaded because thread 3 has function: malloc_printf on stack
(gdb)


As said, this does not occur on his Windows machine. Is this code related or SFML related to the Mac?

I am compiling with the lastest version from the SVN.

8
Feature requests / Message Boxes
« on: December 01, 2008, 09:09:39 pm »
This would be quite hard to implement practical and universal.

SFML is used in a lot of different enviroments with a lot of different window handlers. Think of it, there is no "global" way of making a box on them all. Each system has to have a hand written implemention, not to mention the intergration with QT and such.

And then also, this would distract the focus from a simple and fast multimedia layer and turn into something bloated. There is no universal way for each project. I know people using it for games, visualising studies and such.

Get developing with Win32 or QT is my advice.

9
General discussions / SFML 1.3 and OS X
« on: November 30, 2008, 07:26:41 pm »
Ah, i can be calm then.

Don't forget to mention that you have to install XCode from the install discs / get it from ADC.

Have you tested your build with Tiger or is it Leopard only?

10
General discussions / SFML 1.3 and OS X
« on: November 30, 2008, 03:50:11 pm »
Getting started
  SFML and XCode

11
General discussions / SFML 1.3 and OS X
« on: November 30, 2008, 12:51:53 pm »
Tell me when you are done with the install. I'll write a tutorial for the SFML Tutorials and send to Laurent.

12
Graphics / FlipX and FlipY for sfml strings
« on: November 15, 2008, 04:30:38 pm »
Yes, text effects would certainly be nice. I thought about this to, if you are able to do a flipY(), then you can easily do web2.0 fluff ground text reflections.

13
Feature requests / Render to texture implementation question
« on: November 15, 2008, 04:28:17 pm »
I am not really sure if this fixes it, but:
Quote

void sf::RenderWindow::PreserveOpenGLStates     ( bool    Preserve  )      

Tell SFML to preserve external OpenGL states, at the expense of more CPU charge.

Use this function if you don't want SFML to mess up your own OpenGL states (if any). Don't enable state preservation if not needed, as it will allow SFML to do internal optimizations and improve performances. This parameter is false by default

14
General / Dev-C++ Instalation
« on: November 12, 2008, 09:32:23 pm »
Have you added the lsfml-graphics, lsfml-system and so on in your linker settings?

15
General discussions / SFML 1.3 and OS X
« on: November 08, 2008, 06:49:55 pm »
Nice, keep up the work!

I shall try asking a friend which has developed a few games to OSX how he handled the keys.

Pages: [1] 2 3
anything