A question about Chroma C++ SDK | Razer Insider

A question about Chroma C++ SDK

Hello, everyone!
Let's say I have a simple C++ application:

RZRESULT res = Init();
assert(res == RZRESULT_SUCCESS);

ChromaSDK::Keyboard::STATIC_EFFECT_TYPE effect{};
effect.Color = RGB(255, 0, 0);

// std::this_thread::sleep_for(std::chrono::seconds{1}); // This fixes it!

res = CreateKeyboardEffect(ChromaSDK::Keyboard::CHROMA_STATIC, &effect, NULL);
assert(res == RZRESULT_SUCCESS);


res = UnInit();
assert(res == RZRESULT_SUCCESS);

Weirdly enough, this application doesn't work, unless I delay setting the effect for roughly a second. All asserts pass, but the effect doesn't apply. Looks like there's some kind of asynchronous initialization happening with no explicit way to control or observe it. Am I doing something wrong? Is there a way to consistently enable an effect immediately after application start?

This topic has been closed for comments