Author Topic: Setting up DirectX with CodeBlocks  (Read 14992 times)

Extrakun

  • Guest
Setting up DirectX with CodeBlocks
« 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!

sethjackson

  • Guest
Re: Setting up DirectX with CodeBlocks
« Reply #1 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)?

Extrakun

  • Guest
Re: Setting up DirectX with CodeBlocks
« Reply #2 on: May 29, 2006, 04:11:02 pm »
Project requirement, which I can't change...

Thanks for the links, I will take a look!

sethjackson

  • Guest
Re: Setting up DirectX with CodeBlocks
« Reply #3 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

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: Setting up DirectX with CodeBlocks
« Reply #4 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.
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~

sethjackson

  • Guest
Re: Setting up DirectX with CodeBlocks
« Reply #5 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. ;)
« Last Edit: May 29, 2006, 08:37:03 pm by sethjackson »

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: Setting up DirectX with CodeBlocks
« Reply #6 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
« Last Edit: May 29, 2006, 08:44:57 pm by Vampyre_Dark »
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~

sethjackson

  • Guest
Re: Setting up DirectX with CodeBlocks
« Reply #7 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.

Offline kafoaai.elte

  • Single posting newcomer
  • *
  • Posts: 3
Re: Setting up DirectX with CodeBlocks
« Reply #8 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? :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Setting up DirectX with CodeBlocks
« Reply #9 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:

  • Click "File->New->Project"
  • Right-click the "Direct/X project" icon
  • Click on "Edit this script". You should be seeing the wizard script open in a new editor now :).
  • Find the function named "OnLeave_DirectXPath"


Fix what needs fixing in there and save the file.
Be patient!
This bug will be fixed soon...

Offline kafoaai.elte

  • Single posting newcomer
  • *
  • Posts: 3
Re: Setting up DirectX with CodeBlocks
« Reply #10 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

Offline kafoaai.elte

  • Single posting newcomer
  • *
  • Posts: 3
Re: Setting up DirectX with CodeBlocks
« Reply #11 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
« Last Edit: March 12, 2008, 09:22:06 pm by kafoaai.elte »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Setting up DirectX with CodeBlocks
« Reply #12 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ