Archived

This topic is now archived and is closed to further replies.

hammerstein_02

Is it my design? Or is it just sloooooow

Recommended Posts

Right, I just got my first working graphics class, very exciting time seeing the fruits of your labour don''t you agree? But.. in moving my image across the screen it seems very slooow.. every now and then it stutters and I am wondering if it is my design. I have a cImagelist class which is a linked list of cImage items, which basically store LPDIRECTDRAWSURFACE7, x_pos, y_pos. My imagelist keeps a current pointer and when I call GetCurrentFrame() it returns the current images surface and progresses the pointer to the next. (Moving back to the start when I reach the end) My image displays ok, but it jutters when moving across the screen. I use LaMothes StartClock() and WaitClock() functions to sync my display to 30, but even with these removed it is slooow. I am asking this in the directx forum just in case it is directx related, I am using the 8.1 SDK, but can''t quite master D3D yet, so think that starting with directdraw and working out how to make a game is my best move. Any help would be massively appreciated, and admin I apologise if this belongs somewhere else.

Share this post


Link to post
Share on other sites
I''m no expert in optimisation, but I''d say it could just be the norm. I find that even when running a simple D3D app to make a 3D cube spin around, it tends to stutter, stop and start a bit and generally not look like its running too efficiently, and I''m using the retail version rather than the slower debug version.

I do however find that this stuttering doesnt seem to get any worse as I use more sophisticated techniques and render more polys though (up to a point obviously). Also I find if I''m running something in windowed mode this stuttering seems worse than in full screen mode, probably because your program doesnt have exclusive use of the system resources or something I guess. Perhaps if you''re using a windowed mode you should try full screen? Just a thought, but like I say, I''m no expert on these matters.

Share this post


Link to post
Share on other sites
I am running a full screen app. I suppose I will just have to see if it gets worse the more I add to the program. This is my first attempt at writing any sort of graphics engine, so its early days. In my current design, I plan to have put my imagelist class into a cSprite class which will then be used as a member of a cSpriteManager class. If I continue down this route am I likely to slow the program down even further, if so do I simply make my cImageList class my sprite class? I suppose this is now going down the design route though, maybe time to move forums.

Share this post


Link to post
Share on other sites
Have you checked on how you are setting up your D3DDevice? You may have put yourself into referance mode "D3DDEVTYPE_REF
Microsoft® Direct3D® features are implemented in software; however, the reference rasterizer does make use of special CPU instructions whenever it can. "

If you do this then your app will work on any box... but be VERY slow... try something like this instead:
if(FAILED(g_pD3D->CreateDevice( D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
hwnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&d3dpp,
&g_pd3dDevice)))
{
if(FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&g_pd3dDevice)))
{
if(FAILED(g_pD3D->CreateDevice( D3DADAPTER_DEFAULT,
D3DDEVTYPE_SW,
hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&g_pd3dDevice)))
{
return E_FAIL;
}
}

}



I hope that doesn''t look too horrible - but I think you get the idea (even if this is for D3D)

Share this post


Link to post
Share on other sites
Hes using Direct Draw not D3D!!
I get this sometimes to... dont really know why, but I would say that it is when the comp goes to another thread and it use''s a little more time than usuall or something, it would probly be less of faster comps...

CEO Plunder Studios

Share this post


Link to post
Share on other sites