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

Pages: [1]
1
Audio / sf::SoundRecorder derived class
« on: December 11, 2017, 08:58:26 pm »
Hello everyone,

I'm trying to make a derived class of sf::SoundRecorder, but I get an error at the start in the constructor:

Code: [Select]
class cMicRecord : public sf::SoundRecorder
{
public:
cMicRecord();
~cMicRecord();

bool isRecording();

protected:
virtual bool onStart();
virtual bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount);
virtual void onStop();

private:
bool m_bRecording;
bool m_bOperational;
};

Quote
Exception is thrown at 0x77D0A225 (ntdll.dll) in ******.exe : 0xC0000005 : Access violation when writing at 0x00000004.
(Screenshot)

I really don't understand how is it possible. I guess I did a mistake in the implementation ?
Is it impossible to make a constructor of a derived class wich has its constructor in protected ?


2
Graphics / Multi pass drawing
« on: April 14, 2017, 05:01:50 pm »
Hello,

I'm trying to do a multi pass drawing (e.g environment, character, particles), but I can't figure out how to draw sf::RenderTexture to another sf::RenderTexture with a sf::Blend style.

I guess my logic is wrong... How should I draw my drawables to multiples buffers with transparent background, and then draw all this buffers to a sf::RenderTexture with blend style ?

I actually draw all my drawables to the related sf::RenderTexture, and then try to combine all thoses render texture with blend style in one to apply a shader on it.

3
Audio / [SOLVED] OpenAL error (AL_OUT_OF_MEMORY)
« on: April 13, 2017, 03:56:08 pm »
Hello,

I get an AL error, but I have no idea what I did wrong in my code. I really don't think it's a memory problem, I have RAM 16 GB and create new sounds only if there are less than 100 sounds in the vector (I read that it can works until 256).

The first error I get is:
Quote
An internal OpenAL call failed in SoundSource.cpp(37).
Expression:
   alGenSources(1, &m_source)
Error description:
   AL_OUT_OF_MEMORY
   There is not enough memory left to execute the command.

And then, every new sound created implies this error:
Quote
An internal OpenAL call failed in SoundSource.cpp(37).
Expression:
   alSourcei(m_source, AL_BUFFER, 0)
Error description:
   AL_INVALID_NAME
   A bad name (ID) has been specified.

It's probably because of my sound manager, so here is it:
Quote

for (std::vector<sSoundManager*>::iterator iteratorSounds = m_soundManager.begin(); iteratorSounds != m_soundManager.end() ; )
   {   
      if ((*iteratorSounds)->m_bPlayed == false // Play the sound if not played yet
         && (*iteratorSounds)->m_iTimeDelay <= 0)
      {
         (*iteratorSounds)->m_bPlayed = true;
         (*iteratorSounds)->m_sound.play();
         iteratorSounds++;
      }
      else if ((*iteratorSounds)->m_bPlayed == true // Purge played sounds
         && ((*iteratorSounds)->m_sound.getStatus() == sf::Sound::Status::Stopped
         || ((*iteratorSounds)->m_bTimeToLive_enabled && (*iteratorSounds)->m_iTimeToLive <= 0)))
      {
         if ((*iteratorSounds)->m_sound.getStatus() != sf::Sound::Status::Stopped)
            (*iteratorSounds)->m_sound.stop();

         delete(*iteratorSounds);
         iteratorSounds = m_soundManager.erase(iteratorSounds);
      }
      else // Processing sounds
      {
         (*iteratorSounds)->m_iTimeDelay -= m_DeltaTime;

         if ((*iteratorSounds)->m_bTimeToLive_enabled
            && (*iteratorSounds)->m_iTimeDelay <= 0)
            (*iteratorSounds)->m_iTimeToLive -= m_DeltaTime;

         iteratorSounds++;
      }
}

I saw that "erase.()" deletes the element when it want (not instantly)... But I don't think it can be the problem.

Do anybody have an idea where the problem can be ?

4
Network / ttl
« on: March 11, 2017, 11:03:53 pm »
Hello,

I'm working on network with SFML and I just would like to know if a next version of the SFML will allow to define the ttl's packet ?

Pages: [1]