View difference between Paste ID: EVLjvw1J and rYW1jvh1
SHOW: | | - or go back to the newest paste.
1
for (unsigned int devIndex = 0; devIndex < numDevs; devIndex++) {
2
				unsigned char devType = 0;
3
				unsigned char* devTypePtr = &devType;
4
5
				unsigned int descSize = 255;
6
				char* description = new char[descSize];
7
				result = getDeviceDescriptionFunction(devIndex, description, descSize, &devType);
8
				std::cout << "Description: " << description << std::endl;
9
				delete[]description;
10
11
				description = new char[descSize];
12
				LFX_COLOR color;
13
14
				unsigned int numLights = 0;
15
				result = getNumLightsFunction(devIndex, &numLights);
16
17
				for (unsigned int lightIndex = 0; lightIndex < numLights; lightIndex++) {
18
					result = getLightDescriptionFunction(devIndex, lightIndex, description, descSize);
19
					if (result != LFX_SUCCESS)
20
						continue;
21
22
					result = getLightColorFunction(devIndex, lightIndex, &color);
23
					if (result != LFX_SUCCESS)
24
						continue;
25
26
					std::cout << "\tLight: " << lightIndex << "\tDescription: " << description << "\tColor: " <<
27
						(short) color.brightness << ", " << (short) color.red << ", " <<
28
						(short) color.green << ", " << (short) color.blue << std::endl;
29
				}
30
31
				delete[]description;
32
			}