1
General discussions / Re: Android and iOS ports available for testing
« on: September 12, 2014, 04:19:03 pm »
I've been tinkering with SFML for a short while and I'd like to request some assistance and troubleshoot some issues I'm experiencing...
I use the bleeding edge master available at https://github.com/SFML/SFML. Here's a short piece of test code.
Android (test hardware, Nexus 5 and OnePlus One):
1. I experience the same issue AlexAUT and ChronicRat with the application crashing when backing out of it. I currently work around the issue by also using exit(0).
2. Crash upon pressing the "Home" button. AlexAUT and ChronicRat, how did you work around it?
iOS (test hardware: iPod touch, 4th Gen from 2011 running iOS6)
1. Does not compile unless I comment out line 94 from SFML/Window/JoystickManager.cpp -- item.identification = item.joystick.getIdentification();
2. Using the test code above, I get the resolution 480x320@32, but it appears to work in portrait mode. Upon rotating to landscape, the drawing looks even more funny. It does not matter if I change the application orientation int he project. Please see the enclosed screenshots.
3. The image loading works with JPEG, but fails when trying to open PNG (Failed to load image "res_texture.png". Reason : Corrupt PNG).
4. Crashes when killing the application from the "task bar". Here's a stack trace.
* thread #1: tid = 0x2503, 0x3b899eb4 libsystem_kernel.dylib`mach_msg_trap + 20, queue = 'com.apple.main-thread', stop reason = signal SIGKILL
frame #0: 0x3b899eb4 libsystem_kernel.dylib`mach_msg_trap + 20
frame #1: 0x3b89a04c libsystem_kernel.dylib`mach_msg + 40
frame #2: 0x372256c6 GraphicsServices`_GSSendEvent + 450
frame #3: 0x37224510 GraphicsServices`GSSendEvent + 132
frame #4: 0x3553af20 UIKit`_sendPendingApplicationSuspendEvent + 44
frame #5: 0x355344a2 UIKit`_UIApplicationHandleEvent + 7058
frame #6: 0x372265a2 GraphicsServices`_PurpleEventCallback + 590
frame #7: 0x372261d2 GraphicsServices`PurpleEventCallback + 34
frame #8: 0x33701172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
frame #9: 0x33701116 CoreFoundation`__CFRunLoopDoSource1 + 138
frame #10: 0x336fff98 CoreFoundation`__CFRunLoopRun + 1384
frame #11: 0x33672ebc CoreFoundation`CFRunLoopRunSpecific + 356
frame #12: 0x33672d48 CoreFoundation`CFRunLoopRunInMode + 104
* frame #13: 0x0002152a Proto`sf::priv::WindowImplUIKit::processEvents(this=0x1f1adc00) + 50 at WindowImplUIKit.mm:93
frame #14: 0x0001970c Proto`sf::priv::WindowImpl::popEvent(this=0x1f1adc00, event=0x2fdf89ac, block=false) + 56 at WindowImpl.cpp:120
frame #15: 0x00018ee0 Proto`sf::Window::pollEvent(this=0x2fdf8b24, event=0x2fdf89ac) + 52 at Window.cpp:187
frame #16: 0x000134de Proto`sfmlMain(argc=0, argv=0x00000000) + 658 at main.cpp:17
frame #17: 0x0001cc68 Proto`-[SFAppDelegate runUserMain](self=0x1ed16ec0, _cmd=0x0003846b) + 24 at SFAppDelegate.mm:67
frame #18: 0x3403a276 Foundation`__NSFireDelayedPerform + 450
frame #19: 0x337015de CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
frame #20: 0x33701290 CoreFoundation`__CFRunLoopDoTimer + 272
frame #21: 0x336fff00 CoreFoundation`__CFRunLoopRun + 1232
frame #22: 0x33672ebc CoreFoundation`CFRunLoopRunSpecific + 356
frame #23: 0x33672d48 CoreFoundation`CFRunLoopRunInMode + 104
frame #24: 0x372252ea GraphicsServices`GSEventRunModal + 74
frame #25: 0x35588300 UIKit`UIApplicationMain + 1120
frame #26: 0x000355c8 Proto`main(argc=1, argv=0x2fdf9d28) + 36 at MainiOS.mm:60
I use the bleeding edge master available at https://github.com/SFML/SFML. Here's a short piece of test code.
#include <iostream>
#include <SFML/Main.hpp>
#include <SFML/Graphics.hpp>
int main(int argc, char **argv) {
sf::VideoMode videoMode = sf::VideoMode::getFullscreenModes()[0];
std::cout << videoMode.width << "x" << videoMode.height << "@" << videoMode.bitsPerPixel << std::endl;
sf::RenderWindow window(videoMode, "Test", sf::Style::Fullscreen);
sf::RectangleShape rect(sf::Vector2f(window.getSize().x / 2, window.getSize().y / 8));
rect.setFillColor(sf::Color::Red);
sf::Event event;
while (window.isOpen()) {
while (window.pollEvent(event)) {
if ((event.type == sf::Event::Closed) || ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))) {
window.close();
}
}
window.clear(sf::Color(sf::Color::Blue));
window.draw(rect);
window.display();
}
exit(0);
}
#include <SFML/Main.hpp>
#include <SFML/Graphics.hpp>
int main(int argc, char **argv) {
sf::VideoMode videoMode = sf::VideoMode::getFullscreenModes()[0];
std::cout << videoMode.width << "x" << videoMode.height << "@" << videoMode.bitsPerPixel << std::endl;
sf::RenderWindow window(videoMode, "Test", sf::Style::Fullscreen);
sf::RectangleShape rect(sf::Vector2f(window.getSize().x / 2, window.getSize().y / 8));
rect.setFillColor(sf::Color::Red);
sf::Event event;
while (window.isOpen()) {
while (window.pollEvent(event)) {
if ((event.type == sf::Event::Closed) || ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))) {
window.close();
}
}
window.clear(sf::Color(sf::Color::Blue));
window.draw(rect);
window.display();
}
exit(0);
}
Android (test hardware, Nexus 5 and OnePlus One):
1. I experience the same issue AlexAUT and ChronicRat with the application crashing when backing out of it. I currently work around the issue by also using exit(0).
2. Crash upon pressing the "Home" button. AlexAUT and ChronicRat, how did you work around it?
iOS (test hardware: iPod touch, 4th Gen from 2011 running iOS6)
1. Does not compile unless I comment out line 94 from SFML/Window/JoystickManager.cpp -- item.identification = item.joystick.getIdentification();
2. Using the test code above, I get the resolution 480x320@32, but it appears to work in portrait mode. Upon rotating to landscape, the drawing looks even more funny. It does not matter if I change the application orientation int he project. Please see the enclosed screenshots.
3. The image loading works with JPEG, but fails when trying to open PNG (Failed to load image "res_texture.png". Reason : Corrupt PNG).
4. Crashes when killing the application from the "task bar". Here's a stack trace.
* thread #1: tid = 0x2503, 0x3b899eb4 libsystem_kernel.dylib`mach_msg_trap + 20, queue = 'com.apple.main-thread', stop reason = signal SIGKILL
frame #0: 0x3b899eb4 libsystem_kernel.dylib`mach_msg_trap + 20
frame #1: 0x3b89a04c libsystem_kernel.dylib`mach_msg + 40
frame #2: 0x372256c6 GraphicsServices`_GSSendEvent + 450
frame #3: 0x37224510 GraphicsServices`GSSendEvent + 132
frame #4: 0x3553af20 UIKit`_sendPendingApplicationSuspendEvent + 44
frame #5: 0x355344a2 UIKit`_UIApplicationHandleEvent + 7058
frame #6: 0x372265a2 GraphicsServices`_PurpleEventCallback + 590
frame #7: 0x372261d2 GraphicsServices`PurpleEventCallback + 34
frame #8: 0x33701172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
frame #9: 0x33701116 CoreFoundation`__CFRunLoopDoSource1 + 138
frame #10: 0x336fff98 CoreFoundation`__CFRunLoopRun + 1384
frame #11: 0x33672ebc CoreFoundation`CFRunLoopRunSpecific + 356
frame #12: 0x33672d48 CoreFoundation`CFRunLoopRunInMode + 104
* frame #13: 0x0002152a Proto`sf::priv::WindowImplUIKit::processEvents(this=0x1f1adc00) + 50 at WindowImplUIKit.mm:93
frame #14: 0x0001970c Proto`sf::priv::WindowImpl::popEvent(this=0x1f1adc00, event=0x2fdf89ac, block=false) + 56 at WindowImpl.cpp:120
frame #15: 0x00018ee0 Proto`sf::Window::pollEvent(this=0x2fdf8b24, event=0x2fdf89ac) + 52 at Window.cpp:187
frame #16: 0x000134de Proto`sfmlMain(argc=0, argv=0x00000000) + 658 at main.cpp:17
frame #17: 0x0001cc68 Proto`-[SFAppDelegate runUserMain](self=0x1ed16ec0, _cmd=0x0003846b) + 24 at SFAppDelegate.mm:67
frame #18: 0x3403a276 Foundation`__NSFireDelayedPerform + 450
frame #19: 0x337015de CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
frame #20: 0x33701290 CoreFoundation`__CFRunLoopDoTimer + 272
frame #21: 0x336fff00 CoreFoundation`__CFRunLoopRun + 1232
frame #22: 0x33672ebc CoreFoundation`CFRunLoopRunSpecific + 356
frame #23: 0x33672d48 CoreFoundation`CFRunLoopRunInMode + 104
frame #24: 0x372252ea GraphicsServices`GSEventRunModal + 74
frame #25: 0x35588300 UIKit`UIApplicationMain + 1120
frame #26: 0x000355c8 Proto`main(argc=1, argv=0x2fdf9d28) + 36 at MainiOS.mm:60