Example #1
0
// render function for oscilliscope. Returns 0 if successful, 1 if visualization should end.
int render1(struct winampVisModule *this_mod)
{
	if (g_plugin.PluginRender(this_mod->waveformData[0], this_mod->waveformData[1]))
		return 0;    // ok
	else
		return 1;    // failed
}
Example #2
0
void RenderFrame()
{

	pD3DDevice->BeginScene();

	float waves[576*2];
	static float sin1 = 0;
	static float sin2 = 0;
	
//	sin1 += 10;
//	sin2 += 20;

	float sin1start = sin1;
	float sin2start = sin2;

	float Current = 0;
	for ( int i=0; i < 576; i++)
	{
// 		if ( ( rand() % 10) > 4)
// 			iCurrent += (short)(rand() % (255));
// 		else
// 			iCurrent -= (short)(rand() % (255));
		Current = sinf(sin1+sin2);
//		Current += sinf(sin2);
		sin1 += sin1add;
		sin2 += sin2add;
		waves[i*2+0] = Current*0.2f;
		waves[i*2+1] = Current*0.2f;
//		waves[0][i] = (rand() % 128 ) / 128.0f;//iCurrent;//iCurrent;
	//	waves[1][i] = (rand() % 128 ) / 128.0f;//iCurrent;//iCurrent;
	}
	sin1 = sin1start + sin1add;
	sin2 = sin2start + sin2add*7;

	g_plugin.PluginRender((unsigned char*) &waves[0], (unsigned char*)&waves[1] );

	pD3DDevice->EndScene();

	pD3DDevice->Present( NULL, NULL, 0, NULL );
}
extern "C" void Render()
{
	g_plugin.PluginRender(waves[0], waves[1]);
}