Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Some questions about programming w/ graphics  (Read 952 times)

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Some questions about programming w/ graphics
« on: December 20, 2009, 08:43:42 pm »

Ever since I learned C++, I have used the Dev C++ compiler for all my codewriting needs. I have recently been attempting to learn how to program with DirectX 9, but I seem to be able to progress no further than simple 2d rendering due to all sorts of problems involving linking with the d3dx9.h header file and d3dx9.lib library. After searching the interwebs for several hours, I seem to be unable to figure out a way around these problems. I have however found claims that there used to be some addon which would get around these linker problems, but it is no longer available, as well as claims that directx 9 can no longer be programmed with Dev C++.
So my questions are these:
1. Is it actually possible to use Dev C++ for this or will I have to switch to *shudder* MS Visual C++?
2. If it is possible, does anyone have any links or information on how to get around these linker problems?
I would prefer not to use MS Visual C++ if at all possible, since everything I try in there always ends in disaster... Heck, over half the time even sample code doesn't build successfully.
Logged

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Some questions about programming w/ graphics
« Reply #1 on: December 20, 2009, 10:11:25 pm »

I don't know, but I have read that fmod's c++ method won't work on other compilers either.

Regardless, the C method might still work, since the issue, if I understood it, is how the diffrent compilers compiled classes. If you stick to C-style function calls, it might work on Dev C++ (And that IDE actually uses MinGW, and MinGW is actually GCC for windows...)

I don't have DirectX experience, but try using non object-oriented techniques, and see if it still won't work.
Logged
Eh?
Eh!

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Some questions about programming w/ graphics
« Reply #2 on: December 20, 2009, 10:39:22 pm »

The problem doesn't seem to be in my code... In some configurations, it actually compiles "successfully." By "successfully" though, I mean as soon as it runs, a window pops up saying it can't run because it could not find d3dx9.dll files... despite having these files liberally copied and pasted into just about every directory in the Dev C++ files, including in the folder with the program being run. I think it is not solvable. From what I have gathered since I initially posted, DirectX will no longer work with Dev C++. Which means tomorrow I get to spend a joyous day slogging through visual C++'s help files.  :(


/thread
Logged

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: Some questions about programming w/ graphics
« Reply #3 on: December 20, 2009, 11:26:50 pm »

Your problems are probably due to differences in structure between libraries built with MinGW and those built with Microsoft tools. I may be wrong, but I don't think they are negotiable.

Why are you shuddering at the idea of using MSVC++, though? It's a modern development environment. Dev-C++ is an abandoned project with an ancient copy of a mediocre compiler (which isn't to say that Microsoft's C++ compiler is any great shakes, but it's generally better than MinGW and, as one might expect, worse than ICC).

The Direct3D samples build fine; I just built them from whichever version of the SDK I have to make sure. I think you might want to go get VS2008 and read you some directions.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Some questions about programming w/ graphics
« Reply #4 on: December 21, 2009, 01:06:24 am »

Logged
Eh?
Eh!

kuro_suna

  • Bay Watcher
    • View Profile
Re: Some questions about programming w/ graphics
« Reply #5 on: December 21, 2009, 01:33:42 am »

If your using any static librarys  microsoft compilers and gcc based ones use different formats. I think it was microsoft used .lib and gcc .o

I moved to C# because, among other things in c++ linking external libraries is such a project.
Logged

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: Some questions about programming w/ graphics
« Reply #6 on: December 21, 2009, 10:25:54 am »

If your using any static librarys  microsoft compilers and gcc based ones use different formats. I think it was microsoft used .lib and gcc .o

I moved to C# because, among other things in c++ linking external libraries is such a project.
.lib is the standard designation on Win32 for both GCC and MSVC, I think--I know I've seen .lib files for GCC under Windows. As posted upthread, GCC is dumb about name mangling and isn't compatible with professional Windows tools.

You're right about C#, though. IMO, life's too short to screw around with unmanaged code when you don't need to.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

eerr

  • Bay Watcher
    • View Profile
Re: Some questions about programming w/ graphics
« Reply #7 on: December 21, 2009, 01:06:19 pm »

Are you sure nothing in D3 is from D2?

One might contain the other, causing import problems.
Logged

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Some questions about programming w/ graphics
« Reply #8 on: December 21, 2009, 02:02:46 pm »

I seem to have figured out one of the biggest problems I have had with Visual C++...
I get a bunch of errors when typing in example programs from DirectX books, "cannot convert const char to LPCWSTR" or somesuch... Turns out I can fix them just by adding L before parenthesis when initializing the values. :)
Logged