Can i use this

Started by
2 comments, last by MaulingMonkey 18 years, 10 months ago
I'm trying to put graphics on the screen but I want to do it dot by dot, in C I know how in basic 'pset (5,5),2' And i need to know how to use color in C to
Advertisement
In DOS you can use the graphics.h header which I remember has a putpixel function. You'll need to initialize graphics first.

In windows it's a whole other story, and you'd better look into APIs like SDL, DirectDraw, OpenGL, Direct3D.
Try SDL. Hey, look, an example.
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.
Quote:Original post by Ilici
In DOS you can use the graphics.h header which I remember has a putpixel function. You'll need to initialize graphics first.

In windows it's a whole other story, and you'd better look into APIs like SDL, DirectDraw, OpenGL, Direct3D.


graphics.h isn't a standard header, so that may not be portable. If you're in real DOS mode you could allways look up "mode 13h" and other direct SVGA programming :-).

For pixel pushing, I'd recomend the SDL (http://libsdl.org/)

This topic is closed to new replies.

Advertisement