Monthly archives: November, 2016

Doppler Effect removed from Chrome

In Chrome 55+ the function setVelocity has been removed. If your C++ game depends on OpenAL and somewhere you call:

alSource3f(mAlSourceId, AL_VELOCITY,

alSource3f(mAlSourceId, AL_SOURCE_RELATIVE, ...

Then you should either remove those calls, but if your game depends on AL_SOURCE_RELATIVE and you cannot remove it, then it’s required to add a simple snipped to your HTML page:

// A stub for missing setVelocity in Chrome 56+
try {
	if (typeof PannerNode.prototype.setVelocity == "undefined") {
		PannerNode.prototype.setVelocity = function() {}
	}
} catch (e) {}

try {
	if (typeof AudioListener.prototype.setVelocity == "undefined") {
		AudioListener.prototype.setVelocity = function() {}
	}
} catch (e) {}

It’s required due an underlying implementation that sets velocity while you call set source relative.

 

 
4 Kudos
Don't
move!

Use Docker image directly under Windows 10

Windows Subsystem for Linux allows to run Linux binaries directly under Windows. Next logical step might be to try to install Docker on the Linux, and then run images.

It might work, never tried. But, I’ve discovered (quite late – I have to admit) a way to ‘mount’ directly any Docker image as a subsystem for Windows 10.

What is needed:

 
2 Kudos
Don't
move!

Unique identified of any Type in C++

Simple and useful snippet that helps to make an unique identifier for any type in C++.

template <typename T>
std::uintptr_t getTypeId() {
	static int id;
	return reinterpret_cast<std::uintptr_t>(&id);
}

It uses a fact that function static member of a function is a part of template installation, hence it contains own, unique address.

 

 
1 Kudos
Don't
move!

Configure ConEmu and clink to show git branch

This is an extension to https://trzeci.eu/customize-conemu/ but int this case in a form of a tutorial / guideline that will help me (and maybe you) to mirror this setup.

The description shows how to configure conemu and clink, and display name of current branch:

 

 
16 Kudos
Don't
move!