Dreikblack Posted Tuesday at 06:12 AM Share Posted Tuesday at 06:12 AM Steam, beta branch. In steam version music can be found in steam games path\Quake\rerelease\id1\music #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0], WINDOW_TITLEBAR | WINDOW_CENTER); //Load sound auto sound = LoadSound("track02.ogg"); //Play sound auto speaker = CreateSpeaker(); speaker->SetSound(sound); speaker->SetLooping(true); speaker->Play(); while (window->Closed() == false) { if (window->KeyDown(KEY_ESCAPE)) break; } return 0; } Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted Tuesday at 07:53 PM Solution Share Posted Tuesday at 07:53 PM It works, but it seems that loading is very slow... Debug: 98 seconds Release: 96 seconds These results cause me to believe the problem has to do with constant buffer resizing (4096 bytes at a time), instead of decoding time. If I disable resizing and copying data to the uncompressed sound buffer, it only takes 904 milliseconds to decode the same file in release builds, and 2076 in debug builds. I was able to eliminate this delay simply by switching to STL vectors, as they have some implementation-dependent optimizations to help with frequent resizes. When a vector is resized, a memory block that is about 30% bigger than requested is allocated, which eliminates a lot of frequent resizing. You can see the difference by checking size() and capacity() of a vector. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.