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 - 51423benam

Pages: [1]
1
Graphics / UI performance and VertexArrays
« on: December 26, 2018, 05:34:03 pm »
Hello,
I use SFML to render my GUI, meaning that I implement the widgets, containers, event handlers etc. myself.
I have many Widgets of different types in the Software, and because of that, I am worried about the drawing performance.

Every widget holds a vector of it's components (sf::Drawable derivatives). For the example, buttons consist of rounded rectangles (custom shapes) which is textured, an outline, a sf::Text, and so on. It gets way more complicated with more complex composit widgets. All that would result in a very high number of draw calls.

Now, I read in the docs that it's especially slow to change the current texture (I think it's because of the underlying openGL bind () or whatever), so I think I can speed things up by drawing all the buttons with the same texture first.
Are there any further accelerations I should be aware of?
I read something about the sf:: Vertexarray, but I don't know how that would help me, because it seems like it's only for groups of primitives like tiles.
Thanks in advance

2
Audio / custom soundstream onGetData() quits being called after a few calls
« on: September 01, 2018, 02:05:49 pm »
Hello,

I did a thread already about that, but the thread was inactive a few weeks, I got some additional info and I wanted to make a fresh restart. So: I am implementing a custom soundstream. The problem is that onGetData() only gets called 3 or 4 times, although I continue to provide data and I don't quit the stream anyhow. I noticed that sometimes the data (samples) I deliver in the last onGetData() call that happens before not making calls anymore, consists completely of the value 255. But that happens only like half of the runs. Here is my code: https://ufile.io/vvyuw (It's a codeblocks project, but you can see the code anyways). Do you know what could be the problem?

3
General / Building SFML for Codelite with Clang on Windows
« on: July 21, 2018, 05:18:52 pm »
Hello,

I want to build SFML to use it in Codelite, with the compiler clang on Windows 10. I downloaded the sources, but when I want to configure cmake, I can't find Codelite clang in the exporter list. Is that important? Do the exporter and the use environment have to match up completely?
Thanks!

4
Audio / Soundstream onGetData() is called only once
« on: June 18, 2018, 03:50:36 pm »
Hey guys,

I wrote a custom Soundstream-derived class which is steered from outside. The problem is, I am cout-ing "ONGETDATA HAS BEEN CALLED" every time it is called, but in the main program is only outputs it once. Do you know a reason for that? My onGetData function gets it data from another class called AudioManager. And now, you might ask, if it has data and so on, but I am already checking that. In ongetData(), I am also cout-ing the sum of every buffer (which ligns up with the expected) and of course, returning true to continue playing. I connected it to a class which reads a file and pushes the buffers through a connection to the AudioManager.
I made sure it works, also, the sum of the buffers in the in- and output is the same, so the connection is not a problem either. The program just exits after about 2.5 seconds (although the file lasts 5 seconds) and onGetData() is called only once. Do you know a possible reason for the whole thing?

Btw: I know you want to have code  ;), but it is split across several files which is likely meaningless for you.

5
Audio / undefined reference to _imp___ZN2sf11SoundStreamC2Ev
« on: May 14, 2018, 06:43:35 pm »
Hello,

I am facing that error when implementing a custom soundstream inherited class.
Here is the code where it is complaining:
#ifndef AUDIOMANAGER_H_INCLUDED
#define AUDIOMANAGER_H_INCLUDED

#include <memory>
#include <vector>

#include <SFML/Audio.hpp>

#include "../nodes/outputNode.h"

class AudioManager;

class customAudioStream : sf::SoundStream{       // HERE IT IS THROWING THE ERROR!

public:

private:
    virtual bool onGetData(Chunk& data);
    virtual void onSeek(sf::Time timeOffset);
    void registerAudioManager(AudioManager* audioManager);

    AudioManager* manager;
};

class AudioManager{
public:

    AudioManager();
    ~AudioManager();
    void registerOutputNode(std::unique_ptr<outputNode> newOutNode);
    std::vector<sf::Int16> getOutputAudio();

private:
    std::unique_ptr<outputNode> outNode;
    customAudioStream stream;
};


#endif // AUDIOMANAGER_H_INCLUDED

There is some code for outputNode and so on that is missing, since the error seems to be unrelated to that parts.
Do you have any idea what that could be?


6
Audio / Soundstream understanding
« on: May 11, 2018, 11:36:11 pm »
Hello,
I want to implement a custom Soundstream. For that, I also have to override onGetData, but I don't really understand how I can feed it data. Why is data.samples a pointer to a int16? That doesn't make sense to me, I expected that I pass an array or something like that. Also, is it necessary to use a vector like in the example? My theory is that you are giving a pointer to a start int16, and then SFML is stepping through the vector by incrementing the sample pointer address by the size of int16 to get to the next sample. Is that right?

Another question, I deliver the data through a vector <boost::variant <int, int16, maybe something else...>>. Is there a way to give soundstream the data through that? Of course, the actual data in each variant passed to the soundstream will ALWAYS be an int16, but I need that variant for flexibility reasons (the vectors with the data is passed through a pipeline before it gets to the soundstream).
Thanks!

7
Graphics / Nice way to write a GUI organization system
« on: January 19, 2018, 06:00:23 pm »
Hello,

the following question might be a bit unspecific, but I hope I can ask it like that.
I want to write a node-based audio creation program (kind of a DAW for sound designers. The node system and look should be like the attached image (it's a nodetree from Blender).
Now I wrote a few Widgets and node organization classes, but I don't know really how to write the whole program in a nice and universal structure, but that might be a problem later for me and co-programmers. Can you maybe share some tips or link to good documents/books/whatever?
 I know it's a blurry question and topic, but I can't ask soneone else. Thanks!

8
Graphics / I can handle sf::Drawable only with pointers?
« on: December 31, 2017, 12:04:30 pm »
Hello,

I have a class "Container", which is just a Container for self-written widgets derived from sf::Drawable. It has a vector, which holds them. Also, I have the class "GUIManager", which is a class containing ALL widgets of the GUI (also in a vector). It has a function to add a Container to the GUI, in which all widgets from the vector of the Container are copied to his vector of all widgets.

I made the whole thing with shared_ptr s, because it seemed handy to me. So in the vectors of the Containers and also of the GUIManager are shared_ptr s to the widgets. But that becomes a problem more and more and gets to complicated, so I tried to store the widgets normal, without pointers, and just pass pointers of them to the GUIManager.
But I can't declare normal variables to classes derived from sf::Drawable, because sf::Drawable is a abstract class.
How can I do this (store object from classes derived from sf::Drawable in a normal variable)?

9
Graphics / sf::Text problem with a shared_ptr
« on: December 28, 2017, 01:51:45 pm »
Hello,

I have a shared_ptr to a sf::Text object, declaration:
    std::shared_ptr<sf::Text> title;

But when I want for example to set the character size like so:
    title->setCharacterSize(24);

... a exception is thrown:
    "this" was "Nullptr"   (in Visual Studio 2017)

But, strangely, when I set the font before that, like so:
    title->setFont(titleFont);

... the exception still appears at setCharacterSize, setFont works fine!

Do you know why this could happen?

Pages: [1]