Better performance with... Flash?

Started by
17 comments, last by marshdabeachy 17 years, 11 months ago
This seems absolutely bizarre to me, since it makes no sense, but it seems that my DirectX programs encounter hitching and stuttering unless I have the Macromedia Flash Player running in the background. As soon as I open an instance of the Flash Player, the hitching almost completely disappears. This isn't just my computer either, if I move the EXE to another system the same thing occurs. I have no idea what the link between these things are. Has anyone else experienced this?
Advertisement
That is incredibly bizzare. It makes me think that it has something to do with your initialization code or your main program loop. How is your CPU usage for your program?
I know sometimes on my comp (a Mac running OSX btw), I used to be able to get a great performance boost in my OpenGL apps simply by shuffling my mouse cursor through the menubar, which, technically, should decrease performance. I don't know why this happened or under what exact circumstances, and of course, this is a completely different OS...but it seems to be the same type of thing somewhat.
http://blog.protonovus.com/
Quote:Original post by Moe
That is incredibly bizzare. It makes me think that it has something to do with your initialization code or your main program loop. How is your CPU usage for your program?


I won't have access to the program until tonight (at work right now), but I believe it hangs around 10%. I don't remember it spiking at all, but I'll double-check.
Is that a managed program? Not that I'd be able to explain this either way, but strange performance changes happened to me with managed.
I don't even know what a "managed program" is, so probably not (I'm new to DirectX). It's just a standard Windows program. I'm using code from my instructor (from DigiPen) for the window wrapper. I asked him about the problem and he had no idea either. It may be somewhere in his code though.
This definatly sounds like a render loop issue to me. I'd guess Flash's drawings cause an invalidation of some sort in your app, triggering the rendering faster.

What language are you using? And can you possibly paste the code to it?

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
Flash is probelly changing windows internal timer resolution with timeBeginPeriod() as some mediaplayers do too. BTDT.
I am using C++. I will post when I get home later tonight with the loop code.

As a side note, Flash doesn't have to be running in an open window for this to occur. It just has to be a process running in the background.
Okay, here is the code for my main loop. I'm forcing the timeStep right now, but this problem happens either way.

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {	MSG msg = {0};	HACCEL hAccelTable;	// Initialize resources	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);    hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MODE7);    CMainWindow* pMainWindow = CMainWindow::CreateMainWindow( hInstance, szTitle );    	if (pMainWindow) 	{        // Main message loop:        while(msg.message != WM_QUIT) {			Sleep( 10 );			while( PeekMessage( &msg, NULL, 0, 0, TRUE ) ) {					TranslateMessage( &msg );				DispatchMessage( &msg );			}			// update game			pMainWindow->Update(				0.02f,									// timestep				GetAsyncKeyState( VK_LEFT ) & 0x8000,	// holding left				GetAsyncKeyState( VK_RIGHT ) & 0x8000,	// holding right				GetAsyncKeyState( VK_UP ) & 0x8000,		// holding up				GetAsyncKeyState( VK_DOWN ) & 0x8000	// holding down			);		}        delete pMainWindow;	}	return (int) msg.wParam;}


I checked the CPU usage, and came up with some interesting results. When Flash is not running, my program is using roughly 0-2% of the CPU (and is choppy as hell). As soon as I open Flash, my program jumps to 35-45% CPU usage, and becomes noticably smoother.

And as a sidenote, what is the tag on these forums for code?

[Edited by - marshdabeachy on May 17, 2006 11:07:47 PM]

This topic is closed to new replies.

Advertisement