Archived

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

golrien

DirectX 8 is broken or something

Recommended Posts

GetAdapterDisplayMode seems to not work for me. At first I''d assumed it was because my graphics card was made by a bunch of priests in the Stone age, but even with everything from 0 to GetAdapterCount (which was one, but never mind that) it still fails. Then I tried it on a nice card and it still doesn''t work, heh... The precompiled sample programs work, though they point and laugh at my graphics card first. Not sure about any of the others because my compiler was created by dinosaurs in a mountain in Florida and is thus unable to compile them (I''ve only hacked the C interface to work). The code looks pretty much like the stuff in tutorial #1, and it seems to be calling the right routine and stuff. Anyone else had this problem? I looked for an updated driver and the manufacturer''s website says "Use the one that comes with Windows 98," so enh...

Share this post


Link to post
Share on other sites
Exactly what GFX card are you using?

As for compilers the borland one is free at www.borland.com.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
It''s an ATI card of some sort... can''t remember exactly. MACH64? Anyway, that''s not the problem. As I said, it also didn''t work on the ATI Rage 128 RAGE FURY ANGER KILL KILL KILL or something in this machine, which is a little newer.

Getting a decent graphics card isn''t insanely high on my agenda now, heh... when there''s a computer fair in the area or something I might go spend £50 on a nicer job, though.


"As for compilers the borland one is free at www.borland.com."

I''m using Watcom, which makes great code and supports COFF libraries.. it seems to be completely impossible to convert D3DX8.LIB and various others into OMF format for Borland to read (though I haven''t tried that hard.) Anyway, Watcom works for me, it just won''t compile the sample programs.

Share this post


Link to post
Share on other sites
then how are you compiling your own programs? and if you can''t compile what you want, then it sounds like your compiler isn''t working for you. are you taking code straight from the samples or did you alter it? if you altered it, then it is most likely your code and you will get a better response by showing us your code. your code (or the compiler) is the only thing I can think of that would be causing this problem if other dx apps run fine.

Share this post


Link to post
Share on other sites
The compiler was the first thing I suspected, but it looks to be producing the right code... it calls GetAdapterDisplayMode in exactly the same way as any other compiler would. I just have to hack to get it to do it.


I guess really the only reason I can''t compile the samples is that they use the C++ vtbl calling which I haven''t hacked around. I could change that.. but anyway, the code is exactly the same as the tutorial code, as I said in the original post. Thing is, the more advanced samples do a whole shedload of initialisation code which is hidden inside evil C++ stuff and is impossible to make out. I thought that could well be what I needed to do, but too much Hungarian notation makes my eyes run away.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The first thing I''d try to do is put a ''MessageBox()'' command in your loop that enumerates the modes. Have it pop up each one you have and then make sure that your selection criteria matchex. An example would be useful. You''re loop should look something like the following:

UINT uloop, limit;
limit=pD3D->GetAdapterModeCount(D3DADAPTER_DEFAULT);

for (uloop=0; uloop < limit; ++uloop)
{
if (pD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, loop, &d3ddm) != D3D_OK)
return E_FAIL;
if (d3ddm.Width==800 && d3ddm.Height==600)
break;
}

So all you need to do is add the following before the loop --

char buffer[200];

and the following inside the loop after you run the EnumAdapterModes() function --

sprintf(buffer, "Width: %d Height: %d", d3ddm.Width, d3ddm.Height);
MessageBox(hWnd, buffer, "Warning", MB_OK);

Change the variable names to the appropriate ones in your program etc.

-D

Share this post


Link to post
Share on other sites
I recomend you download Dev-C++ V4 (V5 is still in bata) this ide uses the mingw compiler and while it''s a strict ansi c++ compiler you can build the DX sdk samples with only minor changes to the code
http://www.bloodshed.net/devcpp.html

and you will need to get the direct X 8 package from here
http://www.bloodshed.net/dev/packages/index.html
or here
http://www.openrpgs.com/downloads/other/page.php

Share this post


Link to post
Share on other sites