Accueil > > > GRAPHICS.H
GRAPHICS.H
Information sur la source
Description
Voici le contenu de la librairie GRAPHICS.H, à priori tant attendue ! Ms je crois qu'elle marche que sur Linux ou Unix (?). Bon, en tout cas il faut d'autres librairies pour la faire marcher, ms si vous voulez seulement graphics.h, la voilà :
Source
- /* Interface de la bibliothèque `graphics' */
-
- #include <X11/Xlib.h>
-
- /* Ouverture de la fenêtre, fermeture et fonctions associées. */
-
- void gr_open_graph(char* arg);
-
- void gr_close_graph(void);
-
- void gr_clear_graph(void);
-
- int gr_size_x(void);
-
- int gr_size_y(void);
-
- /* Primitives de dessin */
-
- void gr_plot(int x, int y);
-
- void gr_moveto(int x, int y);
-
- void gr_current_point(int *x, int *y);
-
- void gr_lineto(int x, int y);
-
- void gr_draw_arc(int x, int y, int rx, int ry, int a1, int a2);
- void gr_draw_ellispe(int x, int y, int rx, int ry);
- void gr_draw_circle(int x, int y, int r);
- void gr_draw_poly(int* array, int npoints);
-
- void gr_set_line_width(int width);
-
- /* Remplissage */
-
- void gr_fill_rect(int x, int y, int w, int h);
- void gr_fill_poly(int* array, int npoints);
-
- void gr_fill_arc(int x, int y, int rx, int ry, int a1, int a2);
- void gr_fill_ellipse(int x, int y, int rx, int ry);
- void gr_fill_circle(int x, int y, int r);
-
- /* Couleurs */
-
- typedef unsigned long color;
-
- #define RGB(r,g,b) (((r) << 16) + ((g) << 8) + b)
-
- #define black 0x000000
- #define white 0xFFFFFF
- #define red 0xFF0000
- #define green 0x00FF00
- #define blue 0x0000FF
- #define yellow 0xFFFF00
- #define cyan 0x00FFFF
- #define magenta 0xFF00FF
-
- #define background white
- #define foreground black
-
- void gr_set_color(color c);
-
- color gr_get_color(int x, int y);
-
- /* Texte */
-
- void gr_set_font(char *fontname);
-
- void gr_draw_char(char chr);
-
- void gr_draw_string(char *str);
-
- void gr_text_size(char *str, int *w, int *h);
-
- /* Images */
-
- struct grimage {
- int width, height; /* Dimensions de l'image */
- Pixmap data; /* Pixels */
- Pixmap mask; /* Masque pour les points transparent */
- };
-
- /* couleur pour les points transparents */
- #define Transparent (-1)
-
- struct grimage* gr_create_image(int w, int h);
-
- void gr_blit_image(struct grimage *im, int x, int y);
-
- /* static void gr_free_image(struct grimage *im); */
-
- struct grimage* gr_make_image(color* m, int width, int height);
-
- color* gr_dump_image(struct grimage* image);
-
- struct grimage* gr_get_image(int x, int y, int w, int h);
-
- /* Son */
-
- void gr_sound(int freq, int dur);
-
- /* Événements */
-
- struct status {
- int mouse_x;
- int mouse_y;
- Bool button;
- Bool key_pressed;
- char key;
- };
-
- #define BUTTON_DOWN 0x00000001
- #define BUTTON_UP 0x00000002
- #define KEY_PRESSED 0x00000004
- #define MOUSE_MOTION 0x00000008
- #define POLL 0x00000010
-
- struct status* gr_wait_event(int eventmask);
-
- void gr_mouse_pos(int *x, int *y);
- Bool gr_button_down(void);
- Bool gr_key_pressed(void);
- char gr_read_key(void);
/* Interface de la bibliothèque `graphics' */
#include <X11/Xlib.h>
/* Ouverture de la fenêtre, fermeture et fonctions associées. */
void gr_open_graph(char* arg);
void gr_close_graph(void);
void gr_clear_graph(void);
int gr_size_x(void);
int gr_size_y(void);
/* Primitives de dessin */
void gr_plot(int x, int y);
void gr_moveto(int x, int y);
void gr_current_point(int *x, int *y);
void gr_lineto(int x, int y);
void gr_draw_arc(int x, int y, int rx, int ry, int a1, int a2);
void gr_draw_ellispe(int x, int y, int rx, int ry);
void gr_draw_circle(int x, int y, int r);
void gr_draw_poly(int* array, int npoints);
void gr_set_line_width(int width);
/* Remplissage */
void gr_fill_rect(int x, int y, int w, int h);
void gr_fill_poly(int* array, int npoints);
void gr_fill_arc(int x, int y, int rx, int ry, int a1, int a2);
void gr_fill_ellipse(int x, int y, int rx, int ry);
void gr_fill_circle(int x, int y, int r);
/* Couleurs */
typedef unsigned long color;
#define RGB(r,g,b) (((r) << 16) + ((g) << 8) + b)
#define black 0x000000
#define white 0xFFFFFF
#define red 0xFF0000
#define green 0x00FF00
#define blue 0x0000FF
#define yellow 0xFFFF00
#define cyan 0x00FFFF
#define magenta 0xFF00FF
#define background white
#define foreground black
void gr_set_color(color c);
color gr_get_color(int x, int y);
/* Texte */
void gr_set_font(char *fontname);
void gr_draw_char(char chr);
void gr_draw_string(char *str);
void gr_text_size(char *str, int *w, int *h);
/* Images */
struct grimage {
int width, height; /* Dimensions de l'image */
Pixmap data; /* Pixels */
Pixmap mask; /* Masque pour les points transparent */
};
/* couleur pour les points transparents */
#define Transparent (-1)
struct grimage* gr_create_image(int w, int h);
void gr_blit_image(struct grimage *im, int x, int y);
/* static void gr_free_image(struct grimage *im); */
struct grimage* gr_make_image(color* m, int width, int height);
color* gr_dump_image(struct grimage* image);
struct grimage* gr_get_image(int x, int y, int w, int h);
/* Son */
void gr_sound(int freq, int dur);
/* Événements */
struct status {
int mouse_x;
int mouse_y;
Bool button;
Bool key_pressed;
char key;
};
#define BUTTON_DOWN 0x00000001
#define BUTTON_UP 0x00000002
#define KEY_PRESSED 0x00000004
#define MOUSE_MOTION 0x00000008
#define POLL 0x00000010
struct status* gr_wait_event(int eventmask);
void gr_mouse_pos(int *x, int *y);
Bool gr_button_down(void);
Bool gr_key_pressed(void);
char gr_read_key(void);
Conclusion
Voilà j'espère que ça vous a fé plaisir !!!!
;)
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
[TECHDAYS2012] OUI J'Y SERAI![TECHDAYS2012] OUI J'Y SERAI! par JeremyJeanson
Bonsoir, Certes, je l'annonce avec un peu de retard, mais je serai effectivement au Techdays demain. Comme l'an dernier, je participerai au programme ATE (Ask The Expert). Si vous avez des questions Workflow, WCF, AppFabric ou plus généralement .net, n'hé...
Cliquez pour lire la suite de l'article par JeremyJeanson TFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICESTFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICES par vfabing
Afin de s'assurer du bon fonctionnement des différentes synchronisations effectuées par les TFS Integration Tools, 2 rapports sont présents dès l'installation. Il suffit alors d'effectuer les manipulations suivantes pour pouvoir les visualiser : Loca...
Cliquez pour lire la suite de l'article par vfabing CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT)CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT) par FREMYCOMPANY
Bonjour à tous, Je viens de publier une proposition comprenant 5 pseudo-classes pour le CSS Working Group ayant trait à l'état de chargement d'un élément (ex: IMG,VIDEO,AUDIO,OBJECT pour l'HTML.). Si le c½ur vous en dit, vous pouvez retrouver cette p...
Cliquez pour lire la suite de l'article par FREMYCOMPANY MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ?MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ? par ROMELARD Fabrice
Formation initiale Durant la formation, le découpage classique est le suivant (je donnerai les équivalences Suisse lorsque je les connaîtrais) : Ecole primaire jusqu'au Collège : Formation générale permettant d'obtenir les méthodes...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice Y'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENTY'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENT par Aleks
Quand on a ce genre d'erreur sans log :
Et bas on a juste envie de choper le gas de Microsoft qu'a développé ça et lui foutre des baffes de Coboye ! ...
Cliquez pour lire la suite de l'article par Aleks
Forum
RE : ARBRE BINAIRERE : ARBRE BINAIRE par pacotheking
Cliquez pour lire la suite par pacotheking
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|