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

Pages: [1]
1
Yes, this is why I edited the post to strike the "Currently we can do".

I thought we could multiply vectors using operator* between two vectors, but not using the *= operator, so I thought that it was weird.

I initially thought that because the rust-sfml binding allows multipliying two vectors together (and also has some other operators such as vector + number, etc...)

2
Oh I see. Thanks for the information.

3
I tried to search the forum for "Multiplication", "Multiply" and "Multiply Assignement", and it didn't find anything. But apparently, if I click on search again, it finds result (which I didn't know before creating this feature request, sorry about that).

Anyway, after re-reading the docs, and reading the related posts, I understand why you don't want to make this function.

Sorry for the inconvenience.

4
Hi !

This feature would not bring much but I feel like it would make sense to have the operators *= and /= between two vectors. Currently, we can do this:

Code: [Select]
sf::Vector2f v1(1.0, 2.0);
sf::Vector2f v2(1.0, 2.0);
v1 = v1 * v2;

but we can't do this

Code: [Select]
sf::Vector2f v1(1.0, 2.0);
sf::Vector2f v2(1.0, 2.0);
v1 *= v2;

Is there any reason for this ?

Thank you in advance.

5
Audio / Re: Can't resume music after pause
« on: July 03, 2017, 09:35:25 am »
I added a
std::cout << music.getPlayingOffset().asMilliseconds() << std::endl;
before and after the last sleep, and I get this on the terminal
4969
4969

It's kind of weird, I asked a friend to try this on ubuntu to see if he has the same problem, and it seems to work correctly on ubuntu, he gets this
4966
14991

It might be a problem with my alsa or something...

EDIT: I think the problem is not with sfml, but most likely with my sound configuration. Anyway, to solve this problem, I basically re-coded the pause function, instead of pausing, I store the playing offset, and I stop the sound. When play is triggered, if it was paused, I play the sound from start and instantly change the playing offset to what is was before. It's quite uggly, but it works.

Thank you !

6
Audio / Re: Can't resume music after pause
« on: June 28, 2017, 04:39:54 pm »
Well spotted, I tried with the -g flag. I had the same results though (initially, I had std::cout << .. but I replaced it with asserts because I thought it would be more clear).

7
Audio / [CLOSED] Can't resume music after pause
« on: June 28, 2017, 04:07:00 pm »
Hi,

first of all, thanks for SFML, which is the best multimedia library for C++ to me.

Recently, I've been trying to make a small music player in Rust. For this, I use Rust-SFML which is based on CSFML itself based on SFML. To solve some trouble, I came back to C++, and I have the following problem : once I pause a music, there's no way to resume the playing. getStatus gives me sf::Sound::Platying, but there's no sound in my earplugs.

I think it might be something stupid, but I can't see what.

#include <iostream>
#include <chrono>
#include <thread>
#include <cassert>
#include <SFML/Audio/Music.hpp>
#include <SFML/Audio/Sound.hpp>

int main(int argc, char *argv[])
{
    sf::Music music;
    if (!music.openFromFile("resources/orchestral.ogg")) {
        return 1;
    }

    music.play();
    assert(music.getStatus() == sf::Sound::Playing);

    std::this_thread::sleep_for(std::chrono::seconds(5));

    music.pause();
    assert(music.getStatus() == sf::Sound::Paused);

    music.play();
    assert(music.getStatus() == sf::Sound::Playing);

    std::this_thread::sleep_for(std::chrono::seconds(10));

    return 0;
}

that I compile with

g++ -g -std=c++14 main.cpp -o main -lsfml-audio

I run on ArchLinux, I tried this with gcc 7.1.1 and clang 4.0.1, and I'm using SFML 2.4.2.

Do you have any hints ?

Thanks in advance !

EDIT : Added the -g flag in the compilation command line for the assert to be taken into account.

8
Graphics / Re: Android / OpenGL ES / depthBits = 0
« on: January 07, 2016, 10:53:22 am »
Hi,

Sorry for the constructors, I did a last minute change and it broke up everything... and thanks for all this information, everything works now !

9
Graphics / Re: Android / OpenGL ES / depthBits = 0
« on: January 07, 2016, 09:55:36 am »
Hi everyone,

thank you for trying to help me. So I switched to bugfix/android_contextinfo, recompiled everything, and now, my depthBits seems correct (meaning that it gets the value that I try to give him).

However, I still have problems with the depth buffer.

Here is the program I try to run.

I tried to simplify it as much as possible. It is supposed to draw a cube with two red faces, two green faces and two blue faces. but I get this kind of results :



To me, it really looks like the depth buffer is not enabled (but it should be though).

Thanks guys !

10
Hi everyone,

Recently, I tried to use the SFML port for Android, and I tried to use OpenGL ES code in order to do some 3D rendering on my phone.

For the moment, I'm just trying to draw a cube with different colors for each face, but I seem to have a problem with the depth buffer. It seems that, even though I try to create a window with a depthBits of 24, when my window is created, the depthBits is 0, and I guess that's why my depth buffer doesn't work.

Here is my minimal example :

#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <android/log.h>

#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG  , "MyApp", __VA_ARGS__)

int main(int argc, char *argv[])
{
    sf::ContextSettings settings(24, 8, 0, 1, 1);
    sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "", sf::Style::Default, settings);

    LOGD("OpenGL Version : %s", glGetString(GL_VERSION));
    LOGD("DepthBits = %d", window.getSettings().depthBits);

    return 0;
}

My output is
D/MyApp   (22428): OpenGL Version : OpenGL ES-CM 1.1
D/MyApp   (22428): DepthBits = 0

I have seen that the the tutorials say that

Quote
OpenGL versions above 3.0 are supported by SFML (as long as your graphics driver can handle them), but you can't set flags for now. This means that you can't create debug or forward compatible contexts; in fact SFML automatically creates contexts with the "compatibility" flag, because it uses deprecated functions internally. This should be improved soon, and flags will then be exposed in the public API.

Is this the cause of my problems ? Is there any way to enable the depth buffer on Android ?

Thank you !

11
General / Re: Android Demo Code Segfaults or Freezes on Exit
« on: January 02, 2016, 12:21:07 pm »
Yes, I also have some problems with this.

However, when I use your example, my app does return (my android goes back to the menu of apps), but if I try to start it again, none of the main function is executed, I get a black screen with the title of the window at the top.

Should we open an issue on github ?

Pages: [1]