Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 29. marec 2024

Súbor: [Platon] / games / _shared / my-graph.h (stiahnutie)

Revízia 1.8, Tue Apr 6 09:54:16 2004 UTC (19 years, 11 months ago) by nepto


Zmeny od 1.7: +13 -6 [lines]

Headers update:
    - switch to standard/classic Platon SDG source header
    - bumped copyright year to 2004
    - changelog dates reformatted to new format YYYY-MM-DD

/*
 * games/_shared/ - shared routines for games
 *
 * my-graph.h - universal graphics library header file
 * ____________________________________________________________
 *
 * Developed by Ondrej Jombik <nepto@platon.sk>
 * Copyright (c) 2003-2004 Platon SDG, http://platon.sk/
 * All rights reserved.
 *
 * See README file for more information about this software.
 * See COPYING file for license information.
 *
 * Download the latest version from
 * http://platon.sk/projects/games/
 *
 * Changelog:
 * 2003-05-10 - created
 * 2003-08-12 - X11 adaptations
 */

/* $Platon: games/_shared/my-graph.h,v 1.7 2003/08/12 20:50:59 nepto Exp $ */

#ifndef _MY_GRAPH_H
#  define _MY_GRAPH_H

#include <system.h> /* target operating system type */

#if PLATON_SYSTEM_MSDOS
#  include <graphics.h>
#endif

#if PLATON_SYSTEM_WIN32
#  include <winbgim.h>
#endif

#if PLATON_SYSTEM_SVGALIB
#  include <vga.h>
#  include <vgagl.h>
#endif

#if PLATON_SYSTEM_X11
#  include <x11-bgi.h>
#endif

int my_graph_init(int pagging);
void my_graph_refresh(void);
void my_graph_close(void);

#if PLATON_SYSTEM_MSDOS
#  define putimage_BGI            putimage
#  define putimage_BGI_cached    putimage
#else /* old putimage() functionality for all platforms except MS-Dos */
#  define PUTIMAGE_BGI_CACHE_SIZE        (32)
void putimage_BGI_cached(const int x, const int y, void *image, const int op);
void putimage_BGI(const int x, const int y, void *image, const int op);
#endif

#if PLATON_SYSTEM_SVGALIB

struct BGIimage {
    short width;
    short height;
    int   reserved; /* let bits be aligned to DWORD boundary */
    char  bits[1];
};
struct textsettingstype {
    int font;
    int direction;
    int charsize;
    int horiz;
    int vert;
};
#define MAXCOLORS 15
struct palettetype {
    unsigned char size;
    signed char colors[MAXCOLORS+1];
};
enum text_just /* Horizontal and vertical justification for settextjustify */
{
    LEFT_TEXT   = 0,
    CENTER_TEXT = 1,
    RIGHT_TEXT  = 2,
    BOTTOM_TEXT = 0,
    /* CENTER_TEXT = 1,  already defined above */
    TOP_TEXT    = 2
};
enum fill_patterns {        /* Fill patterns for get/setfillstyle */
    EMPTY_FILL,     /* fills area in background color */
    SOLID_FILL,     /* fills area in solid fill color */
    LINE_FILL,      /* --- fill */
    LTSLASH_FILL,       /* /// fill */
    SLASH_FILL,     /* /// fill with thick lines */
    BKSLASH_FILL,       /* \\\ fill with thick lines */
    LTBKSLASH_FILL,     /* \\\ fill */
    HATCH_FILL,     /* light hatch fill */
    XHATCH_FILL,        /* heavy cross hatch fill */
    INTERLEAVE_FILL,    /* interleaving line fill */
    WIDE_DOT_FILL,      /* Widely spaced dot fill */
    CLOSE_DOT_FILL,     /* Closely spaced dot fill */
    USER_FILL       /* user defined fill */
};
enum putimage_ops {     /* BitBlt operators for putimage */
    COPY_PUT,       /* MOV */
    XOR_PUT,        /* XOR */
    OR_PUT,         /* OR  */
    AND_PUT,        /* AND */
    NOT_PUT         /* NOT */
};

#define        grOk                        1
#define        graphresult()                1
#define        grapherrormsg(__code)        "grapherrormsg()"
#define        cleardevice()                gl_clearscreen(BLACK)
#define        getmaxx()                    (vga_getxdim() - 1)
#define        getmaxy()                    (vga_getydim() - 1)
#define        putpixel(__x, __y, __color)    gl_setpixel(__x, __y, __color)
#define        getpixel(__x, __y)            gl_getpixel(__x, __y)
void setcolor(const int color);
void setfillstyle(const int pattern, const int color);
void moveto(const int x, const int y);
void moverel(const int dx, const int dy);
void line(const int x1, const int y1, const int x2, const int y2);
void rectangle(const int x1, const int y1, const int x2, const int y2);
void bar(const int x1, const int y1, const int x2, const int y2);
void bar3d(const int x1, const int y1, const int x2, const int y2, const int depth, const int topflag);
void ellipse(const int x, const int y, const int stangle, const int endangle,
        const int xradius, const int yradius);
void fillellipse(const int x, const int y, const int xradius, const int yradius);
int textheight(char *str);
int textwidth(char *str);
void gettextsettings(struct textsettingstype *texttypeinfo);
void settextstyle(int font, int direction, int charsize);
void settextjustify(int horiz, int vert);
void outtext(char *str);
void outtextxy(const int x, const int y, char *str);
unsigned int imagesize(const int x1, const int y1, const int x2, const int y2);
void getimage(const int x1, const int y1, const int x2, const int y2, void *image);
void putimage(const int x, const int y, void *image, int bitblt);
struct palettetype *getdefaultpalette(void);
void getpalette(struct palettetype *palette);
void setpalette(int colornum, int color);
void setallpalette(const struct palettetype *palette);

#endif /* #if PLATON_SYSTEM_SVGALIB */

#endif /* ifndef _MY_GRAPH_H */


Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok