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

Pages: [1]
1
General / Re: How to debug NDK-projects?
« on: March 01, 2017, 02:44:41 am »
My android-application "stops working" upon starting.
Is there a way to debug this? The SFML example worked perfectly fine, could play around with it and nothing stopped working, but my own project is a bit larger and depends on Lua as well.
Probably you forgot to put
Code: [Select]
if (event.type == sf::Event::Closed)
            {
                window.close();
            }

            if (event.type == sf::Event::Resized)
            {
                view.setSize(event.size.width, event.size.height);
                view.setCenter(event.size.width/2, event.size.height/2);
                window.setView(view);
            }
and sf::View view = window.getDefaultView(); before the main loop

2
General / Re: [SOLVED] Cannot ndk-build example
« on: February 24, 2017, 10:26:27 am »
Works. Sadly, I could not find a single file where it would state to use 4.8.
Unless NDKABI 23 is associated with 4.8? No idea, haha.

On YOUR-ANDROID-PROJECT-FOLDER/jni/Application.mk
where it says NDK_TOOLCHAIN_VERSION i think... not sure at all.

3
General / Re: [SOLVED] Cannot ndk-build example
« on: February 23, 2017, 05:44:27 am »

But whenever I press the home-button or leave the app somehow, "Unfortunately, SFML has stopped." : /
Well, that might be an issue with the example (I hope).
Is a bug that persist since 2.4, 2.3.2 do not have this bug, so i recommend to use 2.3.2 for android builds like me (if you wanna use the vibration feature with sf::getNativeActivity, patch the source code of sfml with this patch https://github.com/SFML/SFML/pull/1005/files ).

4
General / Re: Can't compile SFML for Android on Linux
« on: February 13, 2017, 03:45:16 am »
Is this only a problem with Linux systems ?
i think so, not sure.

Otherwise why isn't stlport_shared the default ?
could you please make a pull request?

5
General / Re: Can't compile SFML for Android on Linux
« on: February 12, 2017, 10:19:06 am »
Oh im sorry, i forgoted that:
In the code example -> jni -> aplication.mk
APP_STL := stlport_shared

Sorry my bad english

6
General / Re: Can't compile SFML for Android on Linux
« on: February 12, 2017, 10:01:27 am »
Use stlport_shared, something like this
cmake -DANDROID_STL=stlport_shared  "OTHER THINGS..."

7
General / Re: Deleting an object from a vector
« on: January 31, 2017, 08:48:16 pm »
Oh i did't noticed the random i<10 xD
Code: [Select]
for (unsigned int i = 0; i < blockContainer.getContainer.size() ; i++)   // Fix, not sure at all :P
        {
            if (ball.getPosition().intersects(blockContainer.getContainer()[i].getPosition()))
            {
                // testing
                std::cout << "Hit 1st row, block: " << i;

                // Reverse ball
                ball.reboundSurface();

                // Delete block
                blockContainer.deleteObjectFromVector(i);
                i--;  // Fix... i think
                break;
            }
            else if (ball.getPosition().intersects(blockContainer2.getContainer()[i].getPosition()))
            {
                // testing
                std::cout << "Hit 2nd row, block: " << i;

                // Reverse ball
                ball.reboundSurface();

                // Delete Block
                blockContainer2.deleteObjectFromVector(i);
                i--;   // Fix
                break;
            }
Anyways you need to split the for funtion for the two vectors :P

8
General / Re: Deleting an object from a vector
« on: January 31, 2017, 07:23:01 pm »
Code: [Select]
void ContainerOfBlocks::deleteObjectFromVector(int objectNumber)
{
    blockContainer.erase(blockContainer.begin() + 2);
}
In "blockContainer.begin() + 2", i think is the problem ( im not sure if is on porpuse)
Anyways, if you do a for funtion to delete a objet from a vector, you need to do a i-- in case some one is erased, so... the fixed code is:
Code: [Select]
void ContainerOfBlocks::deleteObjectFromVector(int objectNumber)
{
    blockContainer.erase(blockContainer.begin() + objectNumber);
}

// On main.cpp replace the code of the for funtion by this
for (unsigned int i = 0; i < 10; i++)
        {
            if (ball.getPosition().intersects(blockContainer.getContainer()[i].getPosition()))
            {
                // testing
                std::cout << "Hit 1st row, block: " << i;

                // Reverse ball
                ball.reboundSurface();

                // Delete block
                blockContainer.deleteObjectFromVector(i);
                i--;  // Fix... i think
                break;
            }
            else if (ball.getPosition().intersects(blockContainer2.getContainer()[i].getPosition()))
            {
                // testing
                std::cout << "Hit 2nd row, block: " << i;

                // Reverse ball
                ball.reboundSurface();

                // Delete Block
                blockContainer2.deleteObjectFromVector(i);
                i--;   // Fix
                break;
            }
PD: sorry for my bad english
PD 2: i not have test it :P

9
General / Re: Android bug (crash)
« on: December 22, 2016, 07:41:24 am »
I discovered that only happends con my cell phone (Moto g 2013 android 6.0.1 Cyanogenmod 13)
i tested the official apk build on a chinese tablet with android 4.4 and the crash not appear.
The strange thing is that apk build with SFML 2.3.2 dont crashes on both cell phones...

10
General / Re: Android bug (crash)
« on: December 20, 2016, 06:30:54 am »
Any chance for a logcat snippet regarding the crash?
I hope that helps  :)
Code: [Select]
--------- log main
12-19 22:20:08.078 32278 32278 I art     : Late-enabling -Xcheck:jni
12-19 22:20:08.283 32278 32278 W linker  : /data/app/com.example.sfml-1/lib/arm/libopenal.so: unused DT entry: type 0xf arg 0x19ab
12-19 22:20:08.317 32278 32278 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/09/15, 6cbbf7d, I3193f6e94a
12-19 22:20:08.846 32278 32297 E libEGL  : call to OpenGL ES API with no current context (logged once per thread)
12-19 22:20:08.846 32278 32297 I sfml-error: Warning: The created OpenGL context does not fully meet the settings that were requested
12-19 22:20:08.846 32278 32297 I sfml-error:
12-19 22:20:08.846 32278 32297 I sfml-error: Requested: version = 1.1 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
12-19 22:20:08.846 32278 32297 I sfml-error:
12-19 22:20:08.846 32278 32297 I sfml-error: Created: version = 0.0 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
12-19 22:20:08.846 32278 32297 I sfml-error:
12-19 22:20:08.846 32278 32297 I sfml-error: Failed to activate the window's context
12-19 22:20:08.846 32278 32297 I sfml-error:
12-19 22:20:08.846 32278 32297 I sfml-error: Failed to activate the window's context
12-19 22:20:08.889 32278 32297 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, output 48000 Hz
12-19 22:20:14.648 32278 32297 W Adreno-GSL: <sharedmem_gpumem_alloc_id:2260>: sharedmem_gpumem_alloc: mmap failed errno 16 Device or resource busy
12-19 22:20:14.648 32278 32297 E Adreno-GSL: <gsl_memory_alloc_pure:1971>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.

Tombstone written to: /data/tombstones/tombstone_00
I attached the full log in case it becomes necessary

11
General / Android bug (crash)
« on: December 19, 2016, 09:30:10 pm »
I tried on Windows 10 and Ubuntu
Compiling the example android  SFML 2.3.2 is ok, but when i try to compile the example android code with SFML 2.4.1 , crashes when i switch to another applicaction.

I compiled SFML 2.4.1 with android ndk r10e and tried with the lastest ndk version (r13b), with c++_shared and stlport_shared but the problems still exist.

The apk from http://www.sfml-dev.org/artifacts/by-branch/2.4.x/ has the same bug

12
Network / Sending binary file donĀ“t send last bytes
« on: March 06, 2016, 09:35:22 pm »
Hi (sorry for my bad english)
I am currently trying to implement a function to send and receive maps and tilemap, but the problem is when sending the file gets corrupt for lack of approximately 2000 bytes.
I've tried sending other files without success.
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <iostream>
#include <string>
#include <fstream>

int main(){
    char resp;
    std::cin >> resp;
    sf::TcpSocket socket;
        std::cout << "s = Server      c= Client" << std::endl;
    if(resp=='s')
    {
        sf::TcpListener escucha;
        escucha.listen(43000);
        char Buffer[4096];
        if (escucha.accept(socket) == sf::Socket::Done)
        {
            std::ifstream File("send.bmp", std::ifstream::binary | std::ios::in | std::ios::binary);
            while (File.read(Buffer, sizeof(Buffer)))
            {
                socket.send(&Buffer, sizeof(Buffer));
                //std::cout << Buffer << std::endl;
                //sf::sleep(sf::milliseconds(30));
            }
            std::cout << "Done" << std::endl;
        }
    }
    else if(resp=='c')
    {
          std::cout << "Connecting" << std::endl;
          std::ofstream outfile("receive.bmp",std::ofstream::binary);
          if (socket.connect("127.0.0.1", 43000, sf::seconds(10)) != sf::Socket::Done)
          {
          std::cout << "Conection failed" << std::endl;
          }
          else std::cout << "Connected" << std::endl;
          socket.setBlocking(false);
        while(1){
                char Buffer[4096];
                std::size_t Size = 0;
                socket.receive(&Buffer, sizeof(Buffer),Size);
                outfile.write(Buffer, Size);
                //std::cout << Buffer << std::endl;
            }

    }
    system("PAUSE");
 return 0;
}
 

What is wrong ?
Thanks for you help!

Pages: [1]
anything