1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
//msoftcon.h
//declarations for Lafore's console graphics functions
//uses Window's console functions
#ifndef _INC_WCONSOLE //don't let this file be included
#define _INC_WCONSOLE //twice in the same source file
#include <windows.h> //for Windows console functions
#include <conio.h> //for kbhit(), getche()
#include <math.h> //for sin, cos
enum fstyle { SOLID_FILL, X_FILL, O_FILL,
LIGHT_FILL, MEDIUM_FILL, DARK_FILL };
enum color {
cBLACK=0, cDARK_BLUE=1, cDARK_GREEN=2, cDARK_CYAN=3,
cDARK_RED=4, cDARK_MAGENTA=5, cBROWN=6, cLIGHT_GRAY=7,
cDARK_GRAY=8, cBLUE=9, cGREEN=10, cCYAN=11,
cRED=12, cMAGENTA=13, cYELLOW=14, cWHITE=15 };
//--------------------------------------------------------------
void init_graphics();
void set_color(color fg, color bg = cBLACK);
void set_color(int fg, int bg = 0);
void set_cursor_pos(int x, int y);
void clear_screen();
void wait(int milliseconds);
void clear_line();
void draw_rectangle(int left, int top, int right, int bottom);
void draw_circle(int x, int y, int rad);
void draw_line(int x1, int y1, int x2, int y2);
void draw_pyramid(int x1, int y1, int height);
void set_fill_style(fstyle);
void set_fill_style(char);
#endif /* _INC_WCONSOLE */
|