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

Pages: [1] 2
1
General / Re: VM aborting when launching Android example
« on: January 17, 2015, 12:23:11 am »
I decided to try again to make the Android example application run on Android 2.3.3. I now found out that the execution stops at the first call to window.pollEvent(event).

More precisely at the m_impl->popEvent(event, false); call in Window/Window.cpp inside function Window::pollEvent

More precisely at the processEvents(); call in Window/WindowImpl.cpp inside function WindowImpl::popEvent

More precisely at the sf::Lock lock(states->mutex); call in Window/Android/WindowImplAndroid.cpp inside function WindowImplAndroid::processEvents

More precisely at the m_mutex.lock(); call in System/Lock.cpp inside constructor Lock::Lock

More precisely at the m_mutexImpl->lock(); call in System/Mutex.cpp inside function Mutex::lock()

More precisely at the pthread_mutex_trylock(&m_mutex); call in System/Unix/MutexImpl.cpp inside function MutexImpl::lock()

Could you please fix this so that SFML2 be supported on Android 2.3.3? You know, it is still a widely used version of Android on the market.

2
General / Re: VM aborting when launching Android example
« on: November 29, 2014, 08:35:01 pm »
I installed Kroniax on my HTC Desire HD to check it out and it did the same thing as the SFML android example. It crashes as soon as I launch it.

3
General / Re: VM aborting when launching Android example
« on: November 29, 2014, 04:14:34 pm »
The sample project uses OpenGL ES 1.1 as can be found in the AndroidManifest.xml file:

<uses-feature android:glEsVersion="0x00010001" />

And this version is supported by any device running android-1.0 or higher as mentioned in the Android API guide here http://developer.android.com/guide/topics/graphics/opengl.html

4
General / VM aborting when launching Android example
« on: November 29, 2014, 03:47:37 pm »
Hi,

I built SFML for Android as explained in Github Wiki tutorial. I created a new Android application project in Eclipse and then replaced the default Manifest and project.properties files with the ones included in the example provided with the source code. I also dropped all the files from the example in the project folder.

I created an AVD emulating a device running android-9 (2.3.3) with a armeabi CPU architecture and launched the application. The application crashes as soon as it starts both on the emulator and on the actual device (HTC Desire HD).

The logcat output is:
11-29 14:44:26.391: D/libEGL(485): egl.cfg not found, using default config
11-29 14:44:26.401: D/libEGL(485): loaded /system/lib/egl/libGLES_android.so
11-29 14:44:26.991: I/sfml-error(485): Failed to activate the window's context
11-29 14:44:26.991: I/sfml-error(485): Failed to activate the window's context
11-29 14:44:27.013: W/dalvikvm(485): JNI WARNING: JNI method called with exception raised
11-29 14:44:27.013: W/dalvikvm(485):              in Landroid/app/NativeActivity;.onResumeNative (I)V (GetStaticIntField)
11-29 14:44:27.021: W/dalvikvm(485): Pending exception is:
11-29 14:44:27.021: I/dalvikvm(485): Ljava/lang/NoSuchFieldError;: SYSTEM_UI_FLAG_LOW_PROFILE
11-29 14:44:27.021: I/dalvikvm(485):    at android.app.NativeActivity.onResumeNative(Native Method)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.NativeActivity.onResume(NativeActivity.java:228)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.Activity.performResume(Activity.java:3832)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-29 14:44:27.031: I/dalvikvm(485):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 14:44:27.031: I/dalvikvm(485):    at android.os.Looper.loop(Looper.java:123)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.main(ActivityThread.java:3683)
11-29 14:44:27.031: I/dalvikvm(485):    at java.lang.reflect.Method.invokeNative(Native Method)
11-29 14:44:27.031: I/dalvikvm(485):    at java.lang.reflect.Method.invoke(Method.java:507)
11-29 14:44:27.031: I/dalvikvm(485):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-29 14:44:27.031: I/dalvikvm(485):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-29 14:44:27.031: I/dalvikvm(485):    at dalvik.system.NativeStart.main(Native Method)
11-29 14:44:27.081: I/dalvikvm(485): "main" prio=5 tid=1 NATIVE
11-29 14:44:27.081: I/dalvikvm(485):   | group="main" sCount=0 dsCount=0 obj=0x4001f1a8 self=0xce48
11-29 14:44:27.081: I/dalvikvm(485):   | sysTid=485 nice=0 sched=0/0 cgrp=default handle=-1345006528
11-29 14:44:27.081: I/dalvikvm(485):   | schedstat=( 709030121 900968440 86 )
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.NativeActivity.onResumeNative(Native Method)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.NativeActivity.onResume(NativeActivity.java:228)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.Activity.performResume(Activity.java:3832)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-29 14:44:27.081: I/dalvikvm(485):   at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 14:44:27.081: I/dalvikvm(485):   at android.os.Looper.loop(Looper.java:123)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.main(ActivityThread.java:3683)
11-29 14:44:27.081: I/dalvikvm(485):   at java.lang.reflect.Method.invokeNative(Native Method)
11-29 14:44:27.081: I/dalvikvm(485):   at java.lang.reflect.Method.invoke(Method.java:507)
11-29 14:44:27.081: I/dalvikvm(485):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-29 14:44:27.081: I/dalvikvm(485):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-29 14:44:27.081: I/dalvikvm(485):   at dalvik.system.NativeStart.main(Native Method)
11-29 14:44:27.131: E/dalvikvm(485): VM aborting

 

What could be the cause of this?

5
Network / Re: proper server exit cleanup
« on: February 22, 2013, 06:16:17 pm »
When I call disconnect from the server I should immediately get a message on the client output. This is not happening. I only get that after the listener.close() call.

6
Network / Re: proper server exit cleanup
« on: February 22, 2013, 06:00:40 pm »
I don't get the same problem when I close the client and restart it while the server is still running.
I discovered that the call for disconnect() in the server cleanup is not working and this is causing the problem.

7
General / Re: Compiling SFML 2.0
« on: February 22, 2013, 05:49:47 pm »
Reinstall Mingw

8
Network / Re: proper server exit cleanup
« on: February 22, 2013, 05:04:11 pm »
Are you going to use shutdown() sometime soon ?  :(

It seems this problem does not occur with TcpSocket because I don't get the same error when I close and relaunch the client. Is this true ?

9
Network / proper server exit cleanup
« on: February 22, 2013, 01:33:08 pm »
What I want to do is for the client to detect server disconnection and reconnect automatically when it starts listening again.
To test that, I start the client, I start the server then I stop it and try to start it again and see if the client reconnects.
The problem is that the server cannot rebind to the same port again.
What should I do ?

Client:
void SDP::RunNet()
{
    sf::TcpSocket CMDSocket;
    CMDSocket.setBlocking(false);

    sf::Time CMDSocketTimeout = sf::seconds(0.05f);

    std::cout<<"Connecting to CMD... "<<std::flush;

    mutexRunning.lock();
    bool stillRunning = Running;
    mutexRunning.unlock();
    while(stillRunning)
    {
        if(!connectedToCMD)
        {
            if(CMDSocket.connect("localhost", 55001,CMDSocketTimeout)==sf::Socket::Done)
            {
                connectedToCMD=true;
                std::cout<<"Connected to CMD."<<std::endl;
            }
            sf::sleep(CMDSocketTimeout);
        }
        else
        {
            sf::Packet packet;
            sf::Socket::Status CMDSocketStatus = CMDSocket.receive(packet);
            if(CMDSocketStatus==sf::Socket::Disconnected)
            {
                connectedToCMD=false;
                CMDSocket.disconnect();
                std::cout<<"CMD disconnected."<<std::endl<<"Trying to reconnect... "<<std::flush;
            }
        }
        mutexRunning.lock();
        stillRunning = Running;
        mutexRunning.unlock();
    }

    if(connectedToCMD)
    {
        CMDSocket.disconnect();
        std::cout<<"Disonnected from CMD."<<std::endl;
    }
 

Server:
void CMD::RunNet()
{
    sf::TcpListener listener;
    listener.setBlocking(false);
    listener.listen(55001);
    sf::SocketSelector selector;
    selector.add(listener);

    std::list<sf::TcpSocket*> clients;

    mutexRunning.lock();
    bool stillRunning = Running;
    mutexRunning.unlock();
    while (stillRunning)
    {
        if (selector.wait(sf::seconds(0.015f)))
        {
            if (selector.isReady(listener))
            {
                sf::TcpSocket* client = new sf::TcpSocket;
                if (listener.accept(*client) == sf::Socket::Done)
                {
                    std::cout<<"client accepted: "<<client->getRemoteAddress()<<std::endl;
                    std::cout<<"list size: "<<clients.size();
                    clients.push_back(client);
                    std::cout<<" then: "<<clients.size()<<std::endl;
                    selector.add(*client);
                }
                else
                {
                    delete client;
                }
            }
            else
            {
                for (std::list<sf::TcpSocket*>::iterator it = clients.begin(); it != clients.end(); ++it)
                {
                    sf::TcpSocket& client = **it;
                    if (selector.isReady(client))
                    {
                        sf::Packet packet;
                        sf::Socket::Status clientStatus = client.receive(packet);
                        if (clientStatus == sf::Socket::Done)
                        {
                            std::cout<<"Done"<<std::endl;
                        }
                        if (clientStatus == sf::Socket::Disconnected)
                        {
                            std::cout<<"Client disconnected"<<std::endl;
                            std::cout<<"list size: "<<clients.size();
                            selector.remove(client);
                            client.disconnect();
                            delete(&client);
                            clients.erase(it);
                            it--;
                            std::cout<<" then: "<<clients.size()<<std::endl;
                        }
                    }
                }
            }
        }
        mutexRunning.lock();
        stillRunning = Running;
        mutexRunning.unlock();
    }

    std::cout<<"Disconnecting from all clients."<<std::endl;
    for (std::list<sf::TcpSocket*>::iterator it = clients.begin(); it != clients.end(); ++it)
    {
        sf::TcpSocket& client = **it;
        std::cout<<"list size: "<<clients.size();
        selector.remove(client);
        client.disconnect();
        delete(&client);
        clients.erase(it);
        it--;
        std::cout<<" then: "<<clients.size()<<std::endl;
    }
    clients.clear();
    selector.remove(listener);
    listener.close();
}
 

10
Network / Re: removing a socket from list on disconnect
« on: February 07, 2013, 09:49:12 pm »
==5638== HEAP SUMMARY:
==5638==     in use at exit: 13,051,799 bytes in 1,173 blocks
==5638==   total heap usage: 169,543 allocs, 168,370 frees, 1,477,238,691 bytes allocated
==5638==
==5638== LEAK SUMMARY:
==5638==    definitely lost: 172 bytes in 1 blocks
==5638==    indirectly lost: 2,424 bytes in 12 blocks
==5638==      possibly lost: 13,021,927 bytes in 742 blocks
==5638==    still reachable: 27,276 bytes in 418 blocks
==5638==         suppressed: 0 bytes in 0 blocks
==5638== Rerun with --leak-check=full to see details of leaked memory
 

11
Network / removing a socket from list on disconnect
« on: February 07, 2013, 08:57:42 pm »
Based on the example from the SocketSelector class reference in the SFML 2.0 documentation i completed the code to remove a TcpSocket from the std::list after it disconnects like this:

                for (std::list<sf::TcpSocket*>::iterator it = clients.begin(); it != clients.end(); ++it)
                {
                    sf::TcpSocket& client = **it;
                    if (selector.isReady(client))
                    {
                        sf::Packet packet;
                        if (client.receive(packet) == sf::Socket::Done)
                        {
                            std::cout<<"Done"<<std::endl;
                        }
                        if (client.receive(packet) == sf::Socket::Disconnected)
                        {
                            std::cout<<"Client disconnected"<<std::endl;
                            std::cout<<"list size: "<<clients.size();
                            selector.remove(client);
                            client.disconnect();
                            delete(&client);
                            clients.erase(it);
                            it--;
                            std::cout<<" then: "<<clients.size()<<std::endl;
                        }
                    }
                }
 

It is working great but i get memory leak and some other non critical errors when i profile it with Valgrind
how could i enhance it more ?

12
Graphics / wxSMFLcanvas problem
« on: August 29, 2011, 05:49:58 pm »
Quote
Try to define the UNICODE macro in the "preprocessor definitions" of your project.


That's what was missing, it worked now. Thanks!

Quote
There's none :wink:


Then you should add GUI controls to SFML so we can use it alone and avoid wxWidgets :wink: .

13
Graphics / wxSMFLcanvas problem
« on: August 29, 2011, 05:27:31 pm »
1- I downloaded the source from the "Integrating to a wxWidgets interface" tutorial, I use CodeBlocks with Mingw under windows and I built wxWidgets with Unicode support enabled.
when i compile it gives me the error: "cannot convert 'const TCHAR *' to 'const WCHAR*'
do you i also need to enable Unicode support somewhere else (GCC, SFML) or what's the problem exactly?

2- WxWidgets can provide a rendering context for OpenGL. What are the advantages of using SFML with it if all what you need from SFML is a redering context and handling input ?

14
General / SFML + OpenGL + wxWidgets
« on: July 14, 2011, 05:13:08 pm »
I'm trying to develop a small game in OpenGL.
can i integrate wxWidgets to SFML and use it to open dialogs inside my SFML window to allow players to change game settings ?
can someone describe briefely how to do that ?

15
Window / OpenGL cube
« on: June 20, 2011, 07:32:19 pm »
thanks, it works now.

Pages: [1] 2