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

Pages: 1 [2] 3 4 ... 9
16
SFML projects / Re: SFNUL
« on: December 17, 2015, 11:39:42 am »
After I read on internet on the broadcast ip address and how to calculate it I tested on the precalculated broadcast ip address of my ip address and worked :D . Now the question is: what is the best way to get the local ip and mask? Should I include and use asio or is a better way? ( If asio is the way, should use the version that come with SFNUL? I found in the SFNUL's cmake file that the include path is included but leave out the sources, or maybe he is just a dependency of a dependency).

17
SFML projects / Re: SFNUL
« on: December 16, 2015, 09:35:10 pm »
Nice library. I decided to use SFNUL in my new tableboard multiplayer mini game, but I need some help. I firstly used SFML and then decided to use SFNUL because of the relief of code the library offer. In my LAN server overview window I used sf::UdpSocket with sf::AnyPort to send a package to all servers on network using sf::IpAddress::Broadcast and the port of the server, then the server would send back the a package so the client would know that at that ip is a server. Now that I switched to SFNUL I don't know how to do same thing. The Bind() function require a ip address and a port, not just the port and also how to send a message to the network because I can't find a function to get the broadcast ip address( EDIT: I think it is 0.0.0.0).

18
Graphics / Re: Text.GetGlobalBounds() is lying to me!
« on: October 06, 2015, 12:08:57 pm »
Another method would be:
text.setOrigin(text.getLocalBounds().left, text.getLocalBounds().top);

19
Graphics / Re: CircleShape performance
« on: September 23, 2015, 05:20:11 pm »
You can also use a fragment shader.

20
Graphics / Re: Qt & SFML
« on: September 18, 2015, 01:25:24 pm »
I don't know if I understood the problem but it would not be easier to put the sfml window( the loop) in a separated thread and then call it.

21
General / Re: undefined reference to 'WinMain@16'
« on: July 29, 2015, 08:58:20 am »
I don't know if is typo but in the code instead of "int main()" is "int mian()".

22
General / Re: AlexxanderX problems...
« on: July 21, 2015, 06:04:14 pm »
Hello :D I have a problem: I'm getting high CPU usage with this code and I don't know what I'm doing wrong:
#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow window({800, 600}, "My window");

        sf::Time m_timePerFrame = sf::seconds(1.0f / 60.0f);
        sf::Time m_timeSinceLastUpdate = sf::Time::Zero;

        sf::Clock m_clock;
    while (window.isOpen())
    {
                sf::Time m_frame = m_clock.restart();
                m_timeSinceLastUpdate += m_frame;

                while (m_timeSinceLastUpdate >= m_timePerFrame)
                {
                        sf::Event event;
                while (window.pollEvent(event))
                {
                    if (event.type == sf::Event::Closed)
                        window.close();
                }

                        m_timeSinceLastUpdate -= m_timePerFrame;
                }

                window.clear();

                window.display();
    }

    return 0;
}

If instead of all the manual frame limiting I use window.setFramerateLimit(60) everything works fine - 0% cpu usage, but with my above code I'm getting high CPU usage. Please some help.

23
General / Re: How to setup an android project.
« on: May 22, 2015, 07:34:53 am »
I responsed here. For the example for android, the ABI is set to armeabi-v7a( jni/Application.mk)  so you need to be carefully what arhitecture the phone/simulator has. ( yes, you can add more/change values to the ABI).

24
General / Re: How to randomly create rectangles?
« on: May 22, 2015, 07:27:05 am »
From what I read you should take a good C++ book and read it. For what you want to make you don't need threads and can do everything in the main thread.

25
After you compiled SFML for Android( here) just go in the folder of the sfml example and run ndk-build and then open normally the project in Eclipse or Android Studio.

26
Lastest master, 80214d1cb916ae5f49c63ade4c167369faab9b9e .

27
Now I'm getting beside the sigsegv these errors:
Quote
05-11 20:26:11.019    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.019    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.029    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.029    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.039    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.039    4777-4792/com.example.sfml I/sfml-error﹕ Failed to activate the window's context
05-11 20:26:11.039    4777-4792/com.example.sfml I/sfml-error﹕ Failed to activate the window's context
05-11 20:26:11.079    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.079    4777-4792/com.example.sfml E/Adreno200-ES20﹕ <get_simple_queries:1021>: GL_INVALID_ENUM
05-11 20:26:11.089    4777-4792/com.example.sfml E/Adreno200-ES11﹕ <qglDrvAPI_glTexImage2D:1913>: GL_INVALID_ENUM
05-11 20:26:11.089    4777-4792/com.example.sfml E/Adreno200-ES11﹕ <qglDrvAPI_glTexSubImage2D:2055>: GL_INVALID_ENUM
05-11 20:26:11.109    4777-4792/com.example.sfml E/ExtendedExtractor﹕ Failed to open MM_PARSER_LIB, dlerror = Cannot load library: reloc_library[1314]:   129 cannot locate '_ZN7android11MediaSource13getBufferInfoERNS_2spINS_7IMemoryEEEPj'...
05-11 20:26:11.109    4777-4792/com.example.sfml E/ExtendedExtractor﹕ Failed to open MM_PARSER_LITE_LIB, dlerror = Cannot load library: load_library[1120]: Library 'libmmparser_lite.so' not found
05-11 20:26:11.119    4777-4792/com.example.sfml I/sfml-error﹕ Failed to open sound file "canary.wav" (format not supported)
( errors are from the example, only changed the android-9 to android-15( and also in the manifest) and targetSdkVersion to 22.)

28
Graphics / Re: Screen view wont change
« on: April 25, 2015, 03:47:12 pm »
Maybe
window1.setView(view1);
?

30
Graphics / Re: SFML_T.exe has stopped working error
« on: April 16, 2015, 10:55:14 am »
Texture is destroyed at the final of loop. Try to put everything between .clear and .display out of the main loop and keep only
window1.draw(sprite1);

Pages: 1 [2] 3 4 ... 9