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

Pages: [1]
1
General discussions / Re: Android and iOS ports available for testing
« on: March 14, 2014, 07:37:17 am »
on Android, how to detect if the player presses the back button or the menu button?  the Home button is really handled by the OS itself and suspends your app, but in other games the back button can be used for menu navigation among other things.  I cant find the way to detect that event.

2
Graphics / Re: Tilemap rendering issues
« on: March 05, 2014, 02:50:46 pm »
moving the view or moving the tilemap is essentially the same thing anyway ultimately to the video card doing the actual rendering.  It is ultimately trying to render your tiles at a non-integer location and with floating point precision not being perfect can lead exactly to the problem you are seeing.

I would suggest to keep a floating point location for your view, but before rendering, round/cast it to the closest integer.

3
Graphics / Re: Vsync causing strange jitter effect (SFML 2.0)
« on: March 05, 2014, 02:46:57 pm »
#include <SFML/Graphics.hpp>


#ifdef _DEBUG
        #pragma comment(lib, "sfml-system-d.lib")
        #pragma comment(lib, "sfml-window-d.lib")
        #pragma comment(lib, "sfml-graphics-d.lib")
#else
        #pragma comment(lib, "sfml-system.lib")
        #pragma comment(lib, "sfml-window.lib")
        #pragma comment(lib, "sfml-graphics.lib")
#endif

int main(int argc, char** argv)
{
        sf::VideoMode video_mode(1280, 720);
        sf::RenderWindow rw(video_mode, "Title", sf::Style::Close |sf::Style::Titlebar);
        rw.setVerticalSyncEnabled(true);

        sf::RectangleShape rs;
        rs.setSize(sf::Vector2f(100, 100));
        rs.setPosition(50.0f, 50.0f);
        rs.setFillColor(sf::Color::Red);
        rs.setOutlineColor(sf::Color::Blue);
        rs.setOutlineThickness(2.0f);


        sf::Event e;
        bool running = true;

        while (running)
        {
                while (rw.pollEvent(e))
                {
                        if (e.type == sf::Event::Closed)
                        {
                                running = false;
                        }
                }

                // update
                rs.move(2.0f, 0.0f);

                // render
                rw.clear();

                rw.draw(rs);

                rw.display();
        }
}
 

This is the minimal code to reproduce the problem.  As I said, it smoothly moves for 1-2 seconds then seems to jump backwards for one frame then forwards again.  I have is vsync so it will stay with the 60fps but even if there is a slightly longer frame time, then it wouldnt move backwards though.  And I can take the same exact program here and convert it to use SDL for rendering and have no issues.  Now I understand SDL uses DirectX as its backend on Windows which is why I think it may just be an OpenGL issue on my laptop.

Unless I am really doing something wrong, but I don't believe I am, then this makes SFML unusable for me as I cannot get smooth movements which is unfortunate because I love SFML.  And I dont believe it is an issue with SFML itself really since I dont see alot of people mentioning this problem on the boards or on google.

I should mention that i have used the .NET binding of SFML with C# with the same issue.

4
Graphics / Re: Vsync causing strange jitter effect (SFML 2.0)
« on: March 05, 2014, 05:27:39 am »
I know this topic is really old but I was doing some searching on an issue I am having and this post describes it perfectly.  And since I didn't see an answer/reply to this I am hoping that maybe the original poster came up with a solution or someone else can point me in the right direction.

I almost think it is some kind of issue with my video card (Geforce GTX 560M) driver issue but the driver is very up to date or maybe some setting with the OS (Windows 7). 

I have no issue using SDL2 program structured identical except using SDL2 for rendering instead of SFML2.  Now I really, really want to use SFML2 instead of SDL2 but I need to figure out this jitter.

5
General discussions / Re: Android and iOS ports available for testing
« on: January 05, 2014, 08:25:09 am »
so it appears i finally got success in using cmake and compiling sfml for android....here is what i found out should others have the same issue.

1 - I was initially using cmake 2.8.7 and was having all of those problems and errors outlined in my first post
2 - I then put some message statements into the cmake toolchain file and realized that it wasnt pulling in the ANDROID_NDK environment variable i was setting from the command line so as far as cmake was concerned the path to the ANDROID_NDK was "".  So I just added that variable on the command line to cmake and was able to cmake successfully
Quote
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.toolchain.cmake -DANDROID_USE_STLPORT=1 -DANDROID_NDK=/home/daniel/Desktop/programming/android/adt-x86/ndk-r9 ..
3 - but at that point I would then try to do the make but would receive errors in the compilation process due to the SONAME_FLAG issue that was detailed in the other post.  I did some googling and people recommened to update cmake to at least 2.8.9 to fix that issue
4 - So i go to the cmake website and get the latest version of 2.8.12 and installed it
5 - I then went back and deleted my build dir and recreated it empty and ran cmake again.....now cmake would give errors about unable to find certain files and I found that it was putting its version number (2.8.12) into that path of where it expected some of the cmake files inside the SFML drectories
6 - I then went and downgraded to cmake 2.8.9 and started this process over again
7 - this time success with cmake and make to build the libraries
8 - now i did still have to specify the ANDROID_NDK on the command line for cmake as for some reason it wouldnt pick up the environment variable of the same name i would export right before doing the cmake

hopefully anyone else running into this problem then this will help them out

now my next task is figuring out how to get the sfml into my programs.  I have already been doing some NDK stuff on my own with raw OpenGL so I have figured out a little of it.  I also dabbled with SDL2 when I was hitting these brick walls with SFML and successfully got it setup, but I much prefer the c++ interface of SFML so I came back to give it another shot in compiling it and success this time.

If anyone has a step by step process to use SFML in an eclipse project then let me know.

6
General discussions / Re: Android and iOS ports available for testing
« on: January 05, 2014, 03:33:40 am »
it it helps i am using cmake version 2.8.7 from the command line on Ubuntu 12.04

7
General discussions / Re: Android and iOS ports available for testing
« on: January 04, 2014, 06:18:41 pm »
yeah i have tried multiple times deleting the entire build directory and starting over from scratch with the same results.

8
General discussions / Re: Android and iOS ports available for testing
« on: January 04, 2014, 03:17:25 am »
inserted the D there and now I have different issues.  I consider myself pretty computer savy but not overly so on Linux so I am trying to track it down as much as possible....but this is what i am getting now

Quote
daniel@ubuntu:~/Desktop/programming/android/SFML/build$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.toolchain.cmake -DANDROID_USE_STLPORT=1 ..
CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/x86-4.6/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/arm-linux-androideabi-clang3.3/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/x86-clang3.2/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/llvm-3.2/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/arm-linux-androideabi-clang3.2/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/mipsel-linux-android-clang3.3/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/x86-4.8/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/mipsel-linux-android-clang3.2/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/llvm-3.3/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/x86-clang3.3/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Warning at cmake/toolchains/android.toolchain.cmake:326 (message):
  Could not uniquely determine machine name for compiler from
  /home/daniel/Desktop/programming/android/adt-x86/ndk-r9/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86_64.
Call Stack (most recent call first):
  cmake/toolchains/android.toolchain.cmake:502 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Error at cmake/toolchains/android.toolchain.cmake:514 (message):
  Could not any working toolchain in the NDK.  Probably your Android NDK is
  broken.
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:86 (INCLUDE)
  CMakeLists.txt:17 (project)


CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/home/daniel/Desktop/programming/android/SFML/build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/home/daniel/Desktop/programming/android/SFML/build/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

I know that is a lot to look at so here is what I figure out about it so far on my own.  All those initial warnings looks like they are looking for the compilers in the NDK directories but for some reason it seems to be looking in a linux-x86_64 directory which wont exist in that location for any of those since I am on an x86 system (actually in WMware Player) and only have the linux-86 directory there because I downloaded the x86 NDK from the Android website.

So it looks like it goes through all the folders i guess looking for a compatible compiler but it cant find one do to the fact that the folder it tries to look in doesnt exist.  And since it cant find one, it is unable to set all the variables at the bottom of that error list.

I know overall the NDK works as I can do a simple project using the ADT and use native code on my own making some OpenGL calls with success.

Anyone have had a similar issue?  I been trying to hack through this most of the day and am about to go back and give it a shot in Windows but am trying to teach myself Linux stuff at the same time so would like to develop in that system to become more familiar with it.





EDIT:
It seems if I run the same command twice consecutively, the second time it looks in the linux-86 directories and gives warning on a few of the directories but seems to find some of the compatible compilers and is therefore able to set those variables and it reports "Configuring done" and "Generating done".

I then try the make -j8 command and get the following
Quote
daniel@ubuntu:~/Desktop/programming/android/SFML/build$ make -j8
Scanning dependencies of target sfml-system
Scanning dependencies of target sfml-activity
Scanning dependencies of target sfml-main
[  1%] Building CXX object src/SFML/Main/CMakeFiles/sfml-activity.dir/SFMLActivity.cpp.o
/home/daniel/Desktop/programming/android/SFML/src/SFML/Main/SFMLActivity.cpp: In function 'void ANativeActivity_onCreate(ANativeActivity*, void*, size_t)':
/home/daniel/Desktop/programming/android/SFML/src/SFML/Main/SFMLActivity.cpp:151:113: warning: invalid conversion from 'void*' to 'void (*)(ANativeActivity*, void*, size_t) {aka void (*)(ANativeActivity*, void*, unsigned int)}' [-fpermissive]
     void (*ANativeActivity_onCreate)(ANativeActivity*, void*, size_t) = dlsym(handle, "ANativeActivity_onCreate");
                                                                                                                 ^
[  2%] Building CXX object src/SFML/Main/CMakeFiles/sfml-main.dir/MainAndroid.cpp.o
[  3%] [  4%] Linking CXX shared library ../../../lib/libsfml-activity.so
[  6%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.o
arm-linux-androideabi-g++: error: SONAME_FLAGlibsfml-activity.so: No such file or directory
make[2]: *** [lib/libsfml-activity.so] Error 1
make[1]: *** [src/SFML/Main/CMakeFiles/sfml-activity.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  7%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Err.cpp.o
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Lock.cpp.o
[  8%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Mutex.cpp.o
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Sleep.cpp.o
[  9%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/String.cpp.o
[ 10%] [ 12%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/ThreadLocal.cpp.o
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Thread.cpp.o
[ 13%] [ 14%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Time.cpp.o
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Unix/ClockImpl.cpp.o
[ 15%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Unix/MutexImpl.cpp.o
[ 17%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Unix/SleepImpl.cpp.o
[ 18%] [ 19%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Unix/ThreadImpl.cpp.o
[ 20%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Unix/ThreadLocalImpl.cpp.o
Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Android/Activity.cpp.o
[ 21%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Android/ResourceStream.cpp.o
Linking CXX static library ../../../lib/libsfml-main.a
[ 21%] Built target sfml-main
Linking CXX shared library ../../../lib/libsfml-system.so
arm-linux-androideabi-g++: error: SONAME_FLAGlibsfml-system.so: No such file or directory
make[2]: *** [lib/libsfml-system.so] Error 1
make[1]: *** [src/SFML/System/CMakeFiles/sfml-system.dir/all] Error 2
make: *** [all] Error 2
daniel@ubuntu:~/Desktop/programming/android/SFML/build$

errors in building the actual libraries

9
General discussions / Re: Android and iOS ports available for testing
« on: January 03, 2014, 11:11:56 pm »
Whenever I try to use cmake on ubuntu I get the following results:

The commands I use are:
export ANDROID_NDK=/home/daniel/Desktop/programming/android/adt-x86/ndk/
and
cmake -CMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.toolchain.cmake -DANDROID_USE_STLPORT=1 ..


This is the result and cant get to the bottom of it:
loading initial cache file MAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.toolchain.cmake
CMake Error: Error processing file:MAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.toolchain.cmake
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib/i386-linux-gnu/libX11.so
-- Found OpenGL: /usr/lib/i386-linux-gnu/libGL.so
-- Found GLEW: /usr/lib/i386-linux-gnu/libGLEW.so
-- Found JPEG: /usr/lib/i386-linux-gnu/libjpeg.so
-- Found Freetype: /usr/lib/i386-linux-gnu/libfreetype.so
-- Found OpenAL: /usr/lib/i386-linux-gnu/libopenal.so
-- Found SNDFILE: /usr/lib/i386-linux-gnu/libsndfile.so
-- Configuring incomplete, errors occurred!



So not sure what the config error is as it doesnt actually tell me any specific error.....anything I am missing here?

Pages: [1]