Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Extrakun on May 29, 2006, 07:29:12 am

Title: Setting up DirectX with CodeBlocks
Post by: Extrakun on May 29, 2006, 07:29:12 am
Hi all,

I am new to CodeBlocks and would like to enquiry how to use DirectX with CodeBlocks. I already have installed the DirectX 9.0 (October) SDK and was using Visual Studo .Net.

Thanks in advance!
Title: Re: Setting up DirectX with CodeBlocks
Post by: sethjackson on May 29, 2006, 01:40:58 pm
Hi all,

I am new to CodeBlocks and would like to enquiry how to use DirectX with CodeBlocks. I already have installed the DirectX 9.0 (October) SDK and was using Visual Studo .Net.

Thanks in advance!


Search the forum with "DirectX". :D

There is a DirectX template that comes with Code::Blocks that would be the easiest way.....

Maybe some of these will help you.

http://forums.codeblocks.org/index.php?topic=750.0
http://forums.codeblocks.org/index.php?topic=1373.0
http://forums.codeblocks.org/index.php?topic=914.0

Oh BTW why don't you use OpenGL (I DO NOT want to start a flamewar just asking)?
Title: Re: Setting up DirectX with CodeBlocks
Post by: Extrakun on May 29, 2006, 04:11:02 pm
Project requirement, which I can't change...

Thanks for the links, I will take a look!
Title: Re: Setting up DirectX with CodeBlocks
Post by: sethjackson on May 29, 2006, 06:44:06 pm
Project requirement, which I can't change...

Thanks for the links, I will take a look!

Sure no problem.

If you do not have a nightly build grab one from here.

http://forums.codeblocks.org/index.php?board=20.0
Title: Re: Setting up DirectX with CodeBlocks
Post by: Vampyre_Dark on May 29, 2006, 08:28:55 pm
There is nothing special about setting up directx in codeblocks, it's just a normal library.

Add the include and lib directories to your path setup, and then include the appropriate files as they are needed. Type all the lib names in the linker config for your project just like you would any other library. Very easy.

Seth, "DirectX vs OpenGL" does not compute. Only "Direct3D vs OpenGL". Lots of us use OpenGL for graphics, and DirectX for the rest.
Title: Re: Setting up DirectX with CodeBlocks
Post by: sethjackson on May 29, 2006, 08:35:23 pm
There is nothing special about setting up directx in codeblocks, it's just a normal library.

Add the include and lib directories to your path setup, and then include the appropriate files as they are needed. Type all the lib names in the linker config for your project just like you would any other library. Very easy.

Seth, "DirectX vs OpenGL" does not compute. Only "Direct3D vs OpenGL". Lots of us use OpenGL for graphics, and DirectX for the rest.

Nowhere in my post did I say DirectX vs OpenGL.

I just wondered why he was useing DirectX. ;)
Title: Re: Setting up DirectX with CodeBlocks
Post by: Vampyre_Dark on May 29, 2006, 08:42:14 pm
DirectX != graphics;
Looks familiar.  :P

But it's true.

DirectX != Graphics. DirectX is a bunch of apis,  not one api. They are are seperate apis that serve their own functions, the only api that collides with OpenGL is Direct3D. Using OpenGL and the rest DirectX at the same time is very common.

I know you didn't say OpenGL vs DirectX. Just wanted to clear it up. ;)

Extrakun, for your linking order, put dxguid first, and then the rest of the libs as needed eg:
dxguid
dsound
dinput
d3d
Title: Re: Setting up DirectX with CodeBlocks
Post by: sethjackson on May 29, 2006, 08:45:15 pm
DirectX != graphics;
Looks familiar.  :P

But it's true.

DirectX != Graphics. DirectX is a bunch of apis,  not one api. They are are seperate apis that serve their own functions, the only api that collides with OpenGL is Direct3D. Using OpenGL and the rest DirectX at the same time is very common.

Yup I stole Thomas's phrase (sort of). :lol: Just like you said DirectX is a bunch of API's that each has a seperate purpose. Anyways, I hope the OP gets his problem fixed.
Title: Re: Setting up DirectX with CodeBlocks
Post by: kafoaai.elte on March 11, 2008, 11:47:10 pm
Hi!

I have some problems using directX SDK with C::B. I downloaded this new version of C::B(8.2), and intalled it. When I try to create a new directX project I get this dialog to give the name of the project and so on. Everything is fine, until the last part when i should actually type in the directory of the directX SDK. I have the Microsoft DirectX SDK 2007 november installed in my Program Files, but when I choose the folder I get this message :
"The path you entered seems valid, but this wizzard can't locate directx files in it..."
wich is a bit strange because the files should be there. I dont know exactly wich files are needed, but the Include and Lib directories are there, and I just cant figure it out, whats wrong :S

Can I get any help here? :)
Title: Re: Setting up DirectX with CodeBlocks
Post by: mandrav on March 12, 2008, 09:38:57 am
I have the Microsoft DirectX SDK 2007 november installed in my Program Files, but when I choose the folder I get this message :
"The path you entered seems valid, but this wizzard can't locate directx files in it..."

Judging from the message you get, it's failing to find <dxdir>/include/d3d.h.

I haven't tested the dx wizard for quite some time now but, if there's a bug, you could fix it and provide a patch for others to test and eventually get committed to our repository.
Don't worry, it's easy:



Fix what needs fixing in there and save the file.
Title: Re: Setting up DirectX with CodeBlocks
Post by: kafoaai.elte on March 12, 2008, 02:17:39 pm
Well, not quite the answer is was looking for, but you got me excited :) I will look at this thing, as soon as I get home.
I will post it here if I find somethig, i hope I will Oo
Title: Re: Setting up DirectX with CodeBlocks
Post by: kafoaai.elte on March 12, 2008, 08:39:04 pm
right, I just got home and I see no "d3d.h" file in the DirectX sdk :s I see tho d3dx.h and d3d9.h wich one should be needed?

edit :: dx9 sdk november does not include d3d8.h wich is needed for the script, and for the generated sample dx application as well :S
Title: Re: Setting up DirectX with CodeBlocks
Post by: MortenMacFly on March 12, 2008, 08:42:21 pm
d3d9.h wich one should be needed?
This one.

BTW: I have already a working DX8/9 wizard... it just need some polishing before commit.