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.


Topics - dmitry_t

Pages: [1]
1
Graphics / [SOLVED] setVerticalSyncEnabled is broken in 2.5.0?
« on: August 21, 2018, 10:08:24 pm »
Hi there,

I just migrated to 2.5.0 and suddenly realized that the FPS is not limited, it does not matter whether verticalSyncEnabled is set to true or false.
Tested on Windows and Linux.
Is it something known?

Update. On Windows, the first call setVerticalSyncEnabled(true) does nothing, however, subsequent calls setVerticalSyncEnabled(false) and setVerticalSyncEnabled(true) lead to the desired effect.

2
General discussions / Common mistakes
« on: March 23, 2018, 07:51:08 am »
As far as I can see there is a set of common mistakes done when writing SFML based applications.
Is there a page describing the most common of them? If there is no, it is probably a good idea to gather explanations in a single place. Then it'll be possible to simply reply with a reference to a corresponding section.

These are the most common AFAICS:

- static SFML object initialization
- referring to a destroyed object
- not handling events
- drawing once out of the main loop
etc.

Let's list more in comments.

3
Graphics / [CLOSED] RenderTexture is invisible on Android
« on: March 14, 2018, 08:48:30 pm »
Hi!

On one of my Android devices (Lenovo K10a40, Android 6.0) a RenderTexture is not displayed on the screen. At all.
The following minimal example is enough to reproduce the issue:
Quote
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>

int main(int argc, char* argv[])
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window", sf::Style::Fullscreen);
    sf::RenderTexture texture;
    if (!texture.create(500, 500))
        return -1;

    sf::CircleShape shape(50);
    shape.setFillColor(sf::Color::White);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

            if (event.type == sf::Event::Resized)
            {
                sf::Vector2f size(
                    static_cast<float>(event.size.width),
                    static_cast<float>(event.size.height));
                window.setView({{}, size});
            }
        }

        texture.clear(sf::Color::Red);
        texture.draw(shape);
        texture.display();

        window.clear();
        window.draw(shape); // visible
        window.draw(sf::Sprite(texture.getTexture())); // invisible
        window.display();
    }
}

The code is almost the same as in the reference: https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1RenderTexture.php.
I have added an extra draw call to put the shape below the texture, it is visible as if there were no anything else. So there is just a circle on a black screen.

What can be wrong?

4
General / Could not find OpenAL while cmaking Android on Windows 10
« on: February 13, 2018, 09:48:02 pm »
Hi there!

I am trying to build Android application on Windows 10, basically performing steps described in this tutorial: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android-on-Windows.

When I used the command
Quote
cmake -G "MinGW Makefiles" -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..
I got the following error:
Quote
CMake Error at cmake/toolchains/android.toolchain.cmake:802 (message):
  Specified Android native API level 'android-8' is not supported by your
  NDK/toolchain.
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/CMakeDetermineSystem.cmake:95 (include)
  CMakeLists.txt:47 (project)

So I have added an extra option, -DANDROID_NATIVE_API_LEVEL=android-21 (which corresponds to the API level mentioned in the tutorial).

Now, while using the command
Quote
cmake -G "MinGW Makefiles" -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=android-21 -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..
I get the following error:
Quote
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindOpenAL.cmake:101 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/Audio/CMakeLists.txt:76 (find_package)

Could anyone help please?


Update
Just in case I added some logging into the Audio module CMakeList.txt before the if block the line 76 belongs to:
Quote
***** SFML_OS_ANDROID: 1
***** CMAKE_INCLUDE_PATH: C:/Users/Dmitry/projects/sfml/extlibs/headers;C:/Users/Dmitry/projects/sfml/extlibs/headers/AL;C:/Users/Dmitry/projects/sfml/extlibs/android

Then I added some logging into C:\Users\Dmitry\projects\sfml\src\SFML\CMakeLists.txt:
Quote
elseif(SFML_OS_ANDROID)
    message("***** CMAKE_ANDROID_ARCH_ABI: ${CMAKE_ANDROID_ARCH_ABI}")
    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
    set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-android/${CMAKE_ANDROID_ARCH_ABI}")
endif()
and got
Quote
***** CMAKE_LIBRARY_PATH: C:/Users/Dmitry/projects/sfml/extlibs/libs-android/
***** CMAKE_ANDROID_ARCH_ABI:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindOpenAL.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/Audio/CMakeLists.txt:76 (find_package)

It looks like CMAKE_ANDROID_ARCH_ABI does not add the required suffix "armeabi-v7a" to the path.
Unfortunately, putting ANDROID_NDK_ABI_NAME instead does not solve the issue either:
Quote
***** CMAKE_LIBRARY_PATH: C:/Users/Dmitry/projects/sfml/extlibs/libs-android/armeabi-v7a
***** CMAKE_ANDROID_ARCH_ABI:
***** ANDROID_NDK_ABI_NAME: armeabi-v7a
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindOpenAL.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/Audio/CMakeLists.txt:76 (find_package)

Pages: [1]