Advertisement

Game Programming in C

Started by February 09, 2003 10:25 PM
3 comments, last by steve010 21 years, 9 months ago
OK, I''m not a TOTAL newb in C, but I am pretty much a newb. Any way, how is it possible to progam graphical games with C? No, I won''t resort to using some graphical application. Please help! A suid program means root for me!
A suid program means root for me!
Well, that is a very open question... which compiler, platform, and operating system. There are different ways on different systems.
Advertisement
If the entire quake series was written in C, then I think so.
Multiversal Gaming-redefining engine technology, graphics, and neworking technology in our upcoming MMORPG and FPS gameIf interested Contact MBRAM32@aol.com Huge royalties will benefit
C doesn''t have inherent support for graphics. You can work with graphics in it, but that means you''re going to have to use some libraries for the platform you''re on to finally display them. Thta''s the major downside of getting into game programming via C.

You can start looking into the windows API, or look online for custom graphics libraries.

Hope that helped.
Allegro is a C library for
quote: From allegro readme. . .
Cross-platform support for DOS, Windows, Unix, BeOS, QNX and MacOS systems.

Drawing functions including putpixel, getpixel, lines, rectangles, flat
shaded, gouraud shaded, texture mapped, and z-buffered polygons, circles,
floodfill, bezier splines, patterned fills, masked, run length encoded,
and compiled sprites, blitting, bitmap scaling and rotation,
translucency/lighting, and text output with proportional fonts. Supports
clipping, and can draw directly to the screen or to memory bitmaps of any
size.

DOS graphics drivers for VGA mode 13h, mode-X (twenty three tweaked VGA
resolutions plus unchained 640x400 Xtended mode), and SVGA modes with 8,
15, 16, 24, and 32 bit color depths, taking full advantage of VBE 2.0
linear framebuffers and the VBE/AF hardware accelerator API if they are
available. Additional video hardware support is available from the
FreeBE/AF project (http://www.talula.demon.co.uk/freebe/).

Windows graphics drivers using DirectX in fullscreen and windowed modes,
plus routines for drawing onto GDI device contexts.

Unix graphics drivers for X, DGA, fbcon, SVGAlib, VBE/AF, mode-X, and
standard VGA.

BeOS graphics drivers using BWindowScreen in fullscreen and BDirectWindow
in windowed modes.

Hardware scrolling and triple buffering (where available), mode-X split
screens, and palette manipulation.

FLI/FLC animation player.

Plays background MIDI music and up to 64 simultaneous sound effects, and
can record sample waveforms and MIDI input. Samples can be looped
(forwards, backwards, or bidirectionally), and the volume, pan, pitch,
etc, can be adjusted while they are playing. The MIDI player responds to
note on, note off, main volume, pan, pitch bend, and program change
messages, using the General MIDI patch set and drum mappings. DOS version
currently supports Adlib, SB, SB Pro, SB16, AWE32, MPU-401, ESS
AudioDrive, Ensoniq Soundscape, and Windows Sound System. Windows version
supports WaveOut and DirectSound interfaces and the system MIDI drivers.
Unix version supports OSS, ESD, and ALSA sound drivers. BeOS version
supports BSoundPlayer and BMidiSynth interfaces. All versions provide
software wavetable MIDI playback.

Easy access to the mouse, keyboard, joystick, and high resolution timer
interrupts, including a vertical retrace interrupt simulator in the DOS
version.

Routines for reading and writing LZSS compressed files.

Multi-object data files and a grabber utility.

Math functions including fixed point arithmetic, lookup table trig, and
3d vector/matrix/quaternion manipulation.

GUI dialog manager and file selector.

Built-in support for 16-bit and UTF-8 format Unicode characters.


SDL is also pretty common. I don''t like it as much as Allegro but I''m biased, so you might want to look at it too and decide which one you would prefer.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.

This topic is closed to new replies.

Advertisement