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
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : WIN APIRE : WIN API par racpp
Cliquez pour lire la suite par racpp WIN APIWIN API par omarino_007
Cliquez pour lire la suite par omarino_007
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|