home *** CD-ROM | disk | FTP | other *** search
- //***************************************************************************
- //* *
- //* Interactive 3D Tool Kit I3D v2.0 *
- //* *
- //* Functions for drawing in VGA mode 0x13 (320x200x256) *
- //* *
- //* (c) 1993-94 Jim O'Keane *
- //* All Rights Reserved Worldwide *
- //* *
- //***************************************************************************
-
- #ifndef _VGA_DRAW_H
-
- #define _VGA_DRAW_H 1
-
- #if defined ( __cplusplus )
- extern "C" {
- #endif
-
- // Bios Mode 0x13 VGA
- #define SCREEN_WIDTH 320
- #define SCREEN_HEIGHT 200
-
- // which fields in DACPAL256 correspond to which color components
- #define RED 0
- #define GREEN 1
- #define BLUE 2
-
- ///////////////////////////////////////////////////////////////////////////
- // NOTE: None of these routines can take XMS handles as arguments! ////////
- ///////////////////////////////////////////////////////////////////////////
-
- // set clipping rectangle
- void FAR PASCAL set_clip_rect(short min_x, short min_y,
- short max_x, short max_y);
-
- // Set the off-screen buffer to buf
- BYTE * FAR PASCAL set_screen_buf(BYTE FAR *buf);
-
- // Set the off-screen buffer dimensions
- short FAR PASCAL set_screen_buf_size(short width,short height);
-
- // Put a pixel into the off-screen buffer at (x,y) in color
- void FAR PASCAL put_pix(short x, short y, short color);
-
- void FAR PASCAL nc_put_pix(short x, short y, short color);
-
- // Return color of pixel at (x,y)
- short FAR PASCAL get_pix(short x, short y);
-
- short FAR PASCAL nc_get_pix(short x, short y);
-
- // Clear off-screen buffer to color
- void FAR PASCAL clear_screen_buf(short color);
-
- // Clear lines in off-screen buffer from start to end to color
- void FAR PASCAL clear_screen_lines(short color,short start,short end);
-
- // Draw a solid colored rect in off-screen color
- void FAR PASCAL draw_rect(short ulx, short uly, short width, short height,
- short color);
-
- void FAR PASCAL nc_draw_rect(short ulx, short uly, short width, short height,
- short color);
-
- // Draw a line in off-screen buffer in color
- void FAR PASCAL draw_line(short x1, short y1, short x2, short y2, short color);
-
- void FAR PASCAL nc_draw_line(short x1, short y1, short x2, short y2, short color);
-
- // Draw a circle in off-screen buffer with edge and fill
- // if edge = -1 then no edge drawn, if fill = -1 then no fill drawn
- void FAR PASCAL draw_circle(short xc, short yc, short r, short edge, short fill);
-
- // Draw a concave or convex polygon in off-screen buffer with edge and fill
- // if edge = -1 then no edge drawn, if fill = -1 then no fill drawn
- BOOL FAR PASCAL draw_polygon(short nvert, POINT FAR *point, short edge, short fill);
-
- // Put image in buf to off-screen buffer at x,y
- void FAR PASCAL put_image(BYTE FAR *buf, short x, short y, short w, short h);
-
- void FAR PASCAL nc_put_image(BYTE FAR *buf, short x, short y, short w, short h);
-
- // Get image into buf from off-screen buffer at x,y
- void FAR PASCAL get_image(BYTE FAR *buf, short x, short y, short w, short h);
-
- // Put image in buf to off-screen buffer at x,y with color 0 transparent
- void FAR PASCAL put_trans_image(BYTE *buf, short x, short y, short w, short h);
-
- void FAR PASCAL nc_put_trans_image(BYTE *buf, short x, short y, short w, short h);
-
- // Copy off-screen buffer to VGA memory REAL fast!
- void FAR PASCAL update_screen(void);
-
- // Copy a portion of off-screen buffer to VGA memory fast!
- void FAR PASCAL update_rect(short ulx, short uly, short width, short height);
-
- // Fire up VGA mode 0x13 320x200 256 colors
- void FAR PASCAL init_graphics(void);
-
- // Return to previous video mode, free memory
- void FAR PASCAL exit_graphics(void);
-
- // Get the VGA palette
- void FAR PASCAL get_vga_palette_256(DACPAL256 FAR *PalBuf);
-
- // Set the VGA palette
- void FAR PASCAL set_vga_palette_256(DACPAL256 FAR *PalBuf);
-
- // Set the current text font parameters
- void FAR PASCAL text_font(short width, short height, short space, BYTE FAR *font_ptr);
-
- // Set the current text colors
- void FAR PASCAL text_color(short forecolor, short backcolor, short transparent);
-
- // Draw some text in the off-screen buffer
- void FAR PASCAL text_xy(short x, short y, char FAR *text);
-
- // Fade palette in from black
- void FAR PASCAL vga_palette_fadein(DACPAL256 FAR *pal);
-
- // Fade palette out to black
- void FAR PASCAL vga_palette_fadeout(DACPAL256 FAR *pal);
-
- #if defined ( __cplusplus )
- }
- #endif
-
- #endif
-