Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » DJGPP or MinGW??

This thread is locked; no one can reply to it. rss feed Print
DJGPP or MinGW??
Mr. Xboxor
Member #3,763
August 2003
avatar

Basically, I am making a game and want to use allegro. It is very likely that I will only use allegro's function's for the game. So which would be better for this? I have grown comfortable making games in DOS, and expect DJGPP to be a very easy move from Turbo C++. However, if I just use allegro with MinGW will that be an easy move to? I want to run my game at 640x480x256, or maybe 800x600 or even 1024x768 if its fast enough, and use all the hardware acceleration I can get. I guess I am really only worried about a couple things:

Can I get access to all the hardware acceleration I have using DJGPP?
Is MinGW easy to use and set up?
Does DJGPP work well with Windows 2000/and or Windows XP?
Do DOS programs made with DJGPP work well with Windows XP/2000?

"Java is high performance. By high performance we mean adequate. By adequate we mean slow." -Mr. Bunny

kazzmir
Member #1,786
December 2001
avatar

Yes. Yes. No!. No!

Use mingw32. you will thank yourself later for the switch.

CGamesPlay
Member #2,559
July 2002
avatar

I believe MS dropped real DOS support at 2k, so you should use MinGW for those. Personally, I've never used DJGPP, but MinGW is simple enough for me.

Are you talking about Turbo C++ as an IDE, or a compiler? If an IDE, then either compiler will do better (so I recommend MinGW), but if a compiler, then I couldn't tell you.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Evert
Member #794
November 2000
avatar

You can develop using DJGPP - if you do this from pure DOS, you will have better chances of catching invalid memory access than you do under Windows. Then when you release your game, simply recompile with MinGW.
MinGW is just as easy (or difficult) to set up as DJGPP is, so if you got that installed installing MinGW should be a breeze.

Mr. Xboxor
Member #3,763
August 2003
avatar

Maybe I'm just stupid, but just looking at the MinGW website confuses the crap out of me. I have no idea what I need to download. DJGPP's website is much simpler, I just tell them what I want to do with the compiler and my operating system, and they tell me which files I need. Heck, I couldn't even find the world "compiler" on the MinGW website. If I just randomly ran into the website before so many people recommended it to me, I would have no idea that MinGW was even capable of compiling stuff. Someone please give some guidance to me.

"Java is high performance. By high performance we mean adequate. By adequate we mean slow." -Mr. Bunny

aybabtu
Member #2,891
November 2002

I recently (about 2 weeks ago) switched from DJGPP to MinGW, because a lot of people couldn't play my games, because they were DOS only! You can download all you need here. I don't know how I found it, but that's everything you need for MinGW! Once you have that, try compiling a few test programs, using the commandline:

gcc file.cpp -o file.exe

If you ever used command line to compile with DJGPP, you'll notice that the commandlines are exactly the same. It's just a different port!
That will compile and link file.cpp into file.exe. When you're ready to make allegro, you'll have to get a DirectX lib thing, but, it says in the allegro docs. (In the \build\ directory.)

Johnny13
Member #805
October 2000
avatar

aybabtu:i CAN still play dos game:P..latest MinGW is 3.0rc4, 3.0 may_be release soon

Quote:

Do DOS programs made with DJGPP work well with Windows XP/2000?

modern PC use USB,gameports are no longer supported,USB joypad not work in DOS!>< so you can only use it as
stardard joypad with few buttons,instead of a full featured joypad in Windows
..just my experience

Alg3D Praise my Games!!<code>#define SPAMMER (post>=666&&postperday>=6)</code><Mr.spellcaster>What post? <Mr.spellcaster>A useful post by me.

Mr. Xboxor
Member #3,763
August 2003
avatar

Well, MinGW looks really confusing. I definitely want to use allegro, but if I have to get a direct x dll or lib file or header file or something, it just sounds like a big pain in the butt to do on my home computer where I have to get permission from my dad to download anything. And he'll get all confused probably when he's trying to install it, and then I'll have to tell him that I need a direct x thing, and then I'll have to make him download the allegro stuff, and then he'll have to install that. You see what I'm dealing with?

So right now I think I'll just get DJGPP, then when I go back to school I'll download MinGW and port my code over from DJGPP to Windows. Will that be hard?

And also, can I run DJGPP on Windows XP (our schools run XP, my home runs ME so I'll be okay) easily? Do I like have to worry about XP not letting me do somethings?

And here's a question no one will give me a clear answer to:

When I initialize graphics mode, allegro will allocate some memory for the screen, which may be much larger than what is actually visible. Then it warns not to use the global *screen at the same time as create_video_bitmap() because the two may overlap. Well, I'm going to be using a double-bufferring system (I'm am overdrawing some, so I assume that is the fastest method?), and want to shrink the screen down to the physical size of the screen. Then I want to allocate a screen size amount of video memory for the screen_buffer (assuming blitting is being accelerate by hardware) along with the rest of the video memory for my graphics (assuming masked blitting is being accelerated by hardware). How do I do this?

"Java is high performance. By high performance we mean adequate. By adequate we mean slow." -Mr. Bunny

psundlin
Member #175
April 2000

Installing mingw and compile allegro is not a pain in the butt.
You can download that direct x thingy from alleg.sf.net and all you have to do is unzip it into the mingw dir. Thats it.

And then just the usual allegro dance:
fix mingw
make
make install

edit:

I had some problems with video bitmaps in allegro, but i found some advice in these forums. :)

The problem looks to be that the first video bitmap is the same as the screen bitmap. So this should fix that. :)

Sirocco
Member #88
April 2000
avatar

Why not use both?

For my non-commercial work, I do all my coding with Rhide/Djgpp, then take the finished work and compile it using MingW to get the win32 port. Since I spent many years using Borland C++, Rhide's appearance is very familiar to me, and easy to navigate. Then again, Dev-CPP is quickly catching up in terms of ease of use.

Quote:

So right now I think I'll just get DJGPP, then when I go back to school I'll download MinGW and port my code over from DJGPP to Windows. Will that be hard?

Not at all. If you stick to ANSI/Posix commands, you shouldn't have to worry about changing any of the code. Just remember your END_OF_MAIN() tag :)

Quote:

if you do this from pure DOS, you will have better chances of catching invalid memory access than you do under Windows

Unfortunately, this is very true. An invalid pointer call or out of bounds array access will kill your program instantly under DOS. As inconvenient as this sounds from a end-user standpoint, it's valuable to us dev'rs.

-->
Graphic file formats used to fascinate me, but now I find them rather satanic.

Carrus85
Member #2,633
August 2002
avatar

Dev-CPP is catching up, but it still has a long way to go before it is complete. Personally, I'm still all-for writting my own ide, perhaps using some of the scintilla code to make life a little easier. Dev-cpp has too many bugs for my taste, I prefer just using scite instead.

Bob
Free Market Evangelist
September 2000
avatar

If you've read the Allegro documentation, you'd have known that it provides you a direct link to the downloads, and even includes installation instructions. allegro/docs/build/mingw32.txt

--
- Bob
[ -- All my signature links are 404 -- ]

Sirocco
Member #88
April 2000
avatar

Quote:

Dev-cpp has too many bugs for my taste, I prefer just using scite instead.

Indeed... I have noticed that the last two builds I've used (including the latest) crashed way too often. Version 3.9somethingorother crashed every time I saved a file, which was rather... er... inconvenient.

Regardless, it's nice to know that thanks to cross-platform libs you can do your dev'ing in the IDE of your choice, then move to the other compilers for quick ports. I love that :)

-->
Graphic file formats used to fascinate me, but now I find them rather satanic.

Korval
Member #1,538
September 2001
avatar

Quote:

if you do this from pure DOS, you will have better chances of catching invalid memory access than you do under Windows

That's not true. Well, not the last part. Windows is quite good at catching invalid memory accesses (what do you think a GPF is?). As good as an OS can be.

amarillion
Member #940
January 2001
avatar

For a long time, I had both DJGPP and MinGW installed. I used DJGPP + RHIDE for development, and compiled binaries both for dos and windows. That setup worked pretty well.

Nowadays I'm developing under linux though :)

gillius
Member #119
April 2000

I have to agree with Korval. I would have made a point earlier because people say this so often, but I very very rarely see a memory error go unnoticed.

I mostly reserved my statement for three reasons. The first being I have Windows XP, a real operating system, instead of Win98, a fancy shell over DOS. The second is that I use MSVC in debug mode, its debugging DLL does a lot of checking for you and adds "memory fences" around every allocation you make, checking them for modification. The third being that I use MSVC and not mingw, which are different compilers generating different code.

Gillius
Gillius's Programming -- https://gillius.org/

Sirocco
Member #88
April 2000
avatar

Quote:

I mostly reserved my statement for three reasons. The first being I have Windows XP, a real operating system, instead of Win98, a fancy shell over DOS.

Unfortunately, under Win2k (sp3) there are many times when I find an illegal memory access glossed over by the OS, when it should have generated a GPF. This behavior, as you seemed to imply, happens far more often in the 9x/me family.

-->
Graphic file formats used to fascinate me, but now I find them rather satanic.

Bob
Free Market Evangelist
September 2000
avatar

Quote:

Unfortunately, under Win2k (sp3) there are many times when I find an illegal memory access glossed over by the OS, when it should have generated a GPF.

Are you sure? Not all illegal memory accesses trigger GPFs.
I'm with Korval on this one.

--
- Bob
[ -- All my signature links are 404 -- ]

Sirocco
Member #88
April 2000
avatar

Quote:

Are you sure? Not all illegal memory accesses trigger GPFs.

Yep. Although you're correct in that a GPF won't always be triggered, a line such as:

blah = foo[21];

where foo[] only has 20 indices, will crash a program (under DOS) instantly. That is not always the case under the various flavors of Windows; indeed, under both 98 and 2K that particular situation will only cause a crash around 15% of the time. Of course, given your CPU and OS, YMMV.

My whole point being, it's entirely possible to have a serious (albeit simple to fix) memory access bug that will always make its presence known under DOS, but not necessarily under Windows with 100% frequency; although I cannot vouch for XP since I don't use it.

From above post:

Quote:

f you do this from pure DOS, you will have better chances of catching invalid memory access than you do under Windows

In all honestly, it should probably read "...better chances of noticing invalid memory access...". Catching implies preventive measures, which Windows certainly possesses.

-->
Graphic file formats used to fascinate me, but now I find them rather satanic.

gillius
Member #119
April 2000

No but in MSVC it will always cause an error in the debugging DLL.

I don't see how it can possibly cause a GPF in DOS. No operating system can possibly tell you that's a bug. The memory at the "21st" element can be perfectly fine to write to, no matter what OS you are using. Even if your OS was some ultra-uber OS, it still probably couldn't do anything unless that access crossed the memory boundary of a page, because exceptions will only be thrown with access to invalid pages or pages with readonly bit set in the page table.

We just saw a case with an array in a class, where accessing 1 element out of bounds was fiddling with a BITMAP* member.

Gillius
Gillius's Programming -- https://gillius.org/

Bob
Free Market Evangelist
September 2000
avatar

Quote:

No but in MSVC it will always cause an error in the debugging DLL.

It won't either. You'll need to insert bounds checking code to catch invalid reads, which (unfortunately) isn't really possible to make work for the general case of C/C++ programs.

--
- Bob
[ -- All my signature links are 404 -- ]

gillius
Member #119
April 2000

err yes that's right. It will detect writes though.

But I usually don't get memory errors anymore. Good use of STL and safer RAII-type methods. Pointers and arrays are evil.

Gillius
Gillius's Programming -- https://gillius.org/

Sirocco
Member #88
April 2000
avatar

Crap... browser ate my reply, and I didn't catch it. Yay.

Quote:

No operating system can possibly tell you that's a bug.

That's my whole point. If the bug's presence is blatantly obvious due to how the OS handles memory access, that's a plus.

Quote:

We just saw a case with an array in a class, where accessing 1 element out of bounds was fiddling with a BITMAP* member.

I've run into this as well, on several occasions. Fun stuff.

-->
Graphic file formats used to fascinate me, but now I find them rather satanic.

Derezo
Member #1,666
April 2001
avatar

Quote:

We just saw a case with an array in a class, where accessing 1 element out of bounds was fiddling with a BITMAP* member.

That was happening to me all the time with strings.
I'd have two strings declared one after another.. and if I edit the first one too far (from a badly coded input box), it'd go into the next string. I couldn't stop laughing at first, and I just couldn't figure out why it was doing that.... finally I realized, a few days later after putting up with the bug :P

"He who controls the stuffing controls the Universe"

Go to: