• Advertisement
Sign in to follow this  

How do I make something with graphics in C?

This topic is 4792 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Allright, I've done some programming in C and I feel comfortable with structures, pointers and the like, and I've just started learning classes. So far I've managed to make a simple DOS game. The only problem is that it's 'graphics' are all ASCII. I wanted to rewrite the game to include sprites instead of ASCII characters, so I've read some tutorials and downloaded some source code. The problem is, none of it works with my compiler (Bloodshed Dev-cpp)! So, should I get a new compiler (free one, I can't afford buying Visual C++), or can I go to 0x13 mode in my current compiler? Do I need to download additional libraries (download links would be appreciated)? And how do I implement sprites once I get into graphics mode?

Share this post


Link to post
Share on other sites
Advertisement
my friend my friend. though i am an advocate of Allegro ( www.allegro.cc ) i suggest you looking at cone3d.gamedev.net and all will be answered.

-good day [smile]

Share this post


Link to post
Share on other sites
Allright, I've done some programming in C and I feel comfortable with structures, pointers and the like, and I've just started learning classes.

There are no classes in C. . .

Share this post


Link to post
Share on other sites
Well, I want to get into C++. Do I need it for making games (I don't have 3d games ambitions)?

Share this post


Link to post
Share on other sites
Quote:
Original post by ImperfectFreak
Allright, I've done some programming in C and I feel comfortable with structures, pointers and the like, and I've just started learning classes.

There are no classes in C. . .

who cares. He asked something but he didn't ask you to start complaining :P

Now on to the answer. Alpha_Progdes is right the thing is that using the things on cone3d won't allow your game to run in dos and since you said it's a dos game I guess you mean console game :)

Share this post


Link to post
Share on other sites
Quote:
Original post by DJ14IVI3
Well, I want to get into C++. Do I need it for making games?
No, you don't need it.

Mode 13h (0x13) is not directly supported under Windows, if that's your target environment. You can emulate it, of course, by essentially undersampling your resultant pixels. But that's all getting ahead of ourselves...

Your central problem appears to be outdated tutorials (if they're talking about mode 13h!). Cone3d is good place to start, and there are dozens more tutorials on the net.

Share this post


Link to post
Share on other sites
This should work in any windows environment and this is a 13h 3d render.

http://rel.betterwebber.com/junk.php?id=24

For 13h you should use Djgpp or TurboC++



Share this post


Link to post
Share on other sites
For mode 13h best use DJGPP from www.delorie.com/djgpp/

Or You can use the Borland Free Compiler from http://www.borland.com.With Borland's Compiler use bcc -m source.cpp to compile mode 13h programs


Brackeen's VGA Tutorials are a very good resource for mode 13h programming

And there's always GOOGLE

Helps?

[Edited by - FireNet on January 7, 2005 3:37:24 AM]

Share this post


Link to post
Share on other sites
Thanks a lot. It did seem to me that all the tutorials I've found were kinda old (most programming tutorials I find are).

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
AFAIK, 640x640x4 is the lowest supported Win32 resolution. Anything lower is being simulated, perhaps by DirectX.
Sure about that. And if so then why?

I've never had any problems setting lower resolutions and programs like NVIDIA's resolution tweak utility allows me to access very low custom resolutions while still presenting "standard" resolutions, like 320x240, by default.
I can't select anything less than 800x600x16 in my display settings but that's nothing more than a safety limit to avoid letting users screw up their display without being able to set it back, and other programs still allow me to set any resolution on the desktop.

Besides, our game has a default resolution of 512x384 and my system supports direct writes to the front buffer, which (compared to double buffered emulation) seems a bit slow to emulate.

Or has all this been emulated behind my back all of these years?

Share this post


Link to post
Share on other sites
Quote:
Original post by doynax
Sure about that. And if so then why?
Lowest VESA resolution.

Obviously, your GPU supports lower resolutions, dating all the way back to EGA and CGA, but you can't access all of them under Windows' protected mode operation. Consequently, your GPU driver, DirectX or some other delegate must either simulate the mode or, through low-level hackery, assume an exclusive graphics mode and then set the resolution.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Quote:
Original post by doynax
Sure about that. And if so then why?
Lowest VESA resolution.

Obviously, your GPU supports lower resolutions, dating all the way back to EGA and CGA, but you can't access all of them under Windows' protected mode operation. Consequently, your GPU driver, DirectX or some other delegate must either simulate the mode or, through low-level hackery, assume an exclusive graphics mode and then set the resolution.
But that's not even the lowest VESA resolution (0x10e is 320x200x16, for example)..

Besides, Windows surely doesn't rely on a 16 bit video BIOS code as a graphics card driver. Perhaps you can force it as a special compability code in case you don't have a card driver, there are VESA X-Windows servers for this purpose, but it's hardly standard.

I doubt any recent windows graphics card driver supports the 2 bpp CGA mode but I can generally access the 1 bpp mode after a fresh install (although that one could easily be emulated by using a single EGA bitplane).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement