Hello,
I want to use portaudio for my c++ audio project. The problem is: As you can see here and here, it wants me to pass the callback function as a function argument of openDefaultStre am(). The problem is: The audio data lies in a class. So there is a object of the class AudioManager() which collects the newest samples. The problem is now: I can't pass a member function pointer to openDefaultStre am(), right? Since that would require...
User Profile
Collapse
-
51423benam started a topic Portaudio wants a callback function pointer, but I have the data in a classin CPortaudio wants a callback function pointer, but I have the data in a class
-
So if I understand it correctly now: The reserve() still needs push_backs to fill the vector, but it takes care that the vector doesn't need to reallocate until I made 256 push_backs right? -
Vector at()
Hello,
in my program I use vectors, and I get a segfault. I use gcc on windows 10 x64. I could reproduce it with a test file:
...Code:#include <iostream> #include <vector> using namespace std; int main() { cout << "Hello world!" << endl; std::vector<int> tvec = vector<int>(); tvec.reserve(256); -
-
But the function returns true (not empty) when I can see in the debugger that it's empty. ):Leave a comment:
-
std::queue::empty() returns true but the size() is -1
Hello,
I have a std::queue I am pushing and popping items to / from. A output threads constantly ask for the oldest buffer (on queue::front()) . I wrote a safety function that checks if the queue is not empty, and another function which calls that functions, and thus, if the function returns true (queue is not empty), return front() of the queue, and if the function returns false (queue is empty) it should return a zero-constructed... -
I don't think so, the warnings are spread all over blender. But the problem is, the whitelist docs for dr. Memory are a bit... bot that detailed. It would be cool if I could whitelist only one file. Of course, I can suppress all other error types too, vut there seem to be still many uninitialized accesses or at least many possibilities for them.Leave a comment:
-
Well, it seems to be working, but I clearly have to learn how to supress and whitelist errors, because it counts more than 2.000.000 just on Blender startupLeave a comment:
-
I think I will try it with Dr. Memory or a similar tool which is windows compatible.Leave a comment:
-
Can you explain it please a little bit more detailed? What do you mean with is this Android or Linux? And which emulators?Leave a comment:
-
I just found that popular memory tools like asan (adress sanitizer) output the location where it is deleted. Now I only have to get one of those working on windows.Leave a comment:
-
I know smart pointers, in fact, I am using them where I can already in my projects, but as I sad, this is work for an open-source software (Blender). So I can't really rewrite millions of lines of code to use smart pointers, I have to take the code as it is.Leave a comment:
-
Read this, there it says that 0xDDDDDDDD means deallocated memory. https://www.softwareverify.com/memory-bit-patterns.phpLeave a comment:
-
C++ find dangling pointer deletion
Hello!
I am working on the source code of Blender and trying to contribute, mainly through bug fixes. Now I have a problem: I am using Visual Studio and Blender crashes because of a dangling pointer (value 0xDDDDDDDD). Now I want to find the place where it is deleted or freed. Are there tools or solutions for that? Most tools seem to only search for memory leaks and so on, those, which find dangling pointers, don't usually search the... -
I would start with Pygame, but I don't have that much experience. The best tip I can give is: be patient. You won't immediately develop a fancy ego shooter or anything in 3d. You will start with simple 2d games.Leave a comment:
-
Ah, I wanted to do your approach with the proxy, but I have a problem. Your example itself is nice, but my problem still exists. I need to call functions on that template object (or, in this case, the proxy) which return data types differ, depending on the template argument of the object. How can I solve this using the proxy pattern? By the way, the return values aren't primitive data types such as int or float which you can convert easily, it's...Leave a comment:
-
Ok. Now I got another example working, now I'm trying it out on my main project. But do you think there is a way to integrate that proxy somehow in the base class including casting? Because another class adds not-much-doing-code.Leave a comment:
-
I wouldn't start with javascript, but python is good for beginners in my opinion.Leave a comment:
-
Ok now I don't know much about unions and variants, I think I just use the Proxy pattern in a way you posted above and then do casts whenever I want to call a non-baseclass function. I've calculated a little and figured out that shouldn't be a performance impact (audio sample rate of 44.100 hertz standard, buffer size 64 standard, makes only about 690 of this function calls per second). Can I just use static_cast for downcasting and then call the...Leave a comment:
No activity results to display
Show More
Leave a comment: