Pipeline graphique
Page principale
Espaces de nommage
Structures de données
Fichiers
Liste des fichiers
Variables globale
Tout
Structures de données
Espaces de nommage
Fichiers
Fonctions
Variables
Définitions de type
Énumérations
Valeurs énumérées
Macros
pipeline
modelloader
defUtil.h
Aller à la documentation de ce fichier.
1
#ifndef _DEF_UTIL
2
#define _DEF_UTIL
3
#include <stdlib.h>
4
#include <stdio.h>
5
#include <utility>
6
#include "
defTypes.h
"
7
8
#define SAFE_DELETE(x) { if ((x)!=NULL) { delete (x); x=NULL; } }
9
#define SAFE_DELETE_ARRAY(x) { if ((x)!=NULL) { delete [] (x); x=NULL; } }
10
11
// error codes
12
typedef
unsigned
int
ErrCode
;
13
const
unsigned
int
error
= 0;
14
const
unsigned
int
success
= !
error
;
15
16
void
WriteConsole
(
const
char
*fmt, ...);
17
#define FATAL_ERROR(msg) { printf("%s:%s\n",__FUNCTION__,msg); getchar(); exit(-1); }
18
/*
19
#if defined(linux) || defined(__CYGWIN__)
20
#define ERROR(why, fmt) { printf("Error (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why); exit(-1); }
21
#define WARNING(why, fmt) { printf("Warning (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why); }
22
#else
23
*/
24
#define ERROR(why, fmt, ...) { printf("Error (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why,__VA_ARGS__ ); exit(-1); }
25
#define WARNING(why, fmt, ...) { printf("Warning (%s:%s line %d) : %s (" fmt ")\n", __FILE__, __FUNCTION__, __LINE__, why,__VA_ARGS__ ); }
26
//#endif
27
28
#define swap(a,b,c) { c=a; a=b; b=c; }
29
#define min(a,b) ( (a)<(b) ? (a):(b) )
30
#define max(a,b) ( (a)>(b) ? (a):(b) )
31
32
// color
33
struct
color
{
uchar
r
,
g
,
b
,
a
; };
34
struct
rgb
{
uchar
r
,
g
,
b
; };
35
36
const
color
37
black
={0x00,0x00,0x00,0xff},
cyan
={0x00,0xff,0xff,0xff},
38
red
={0xff,0x00,0x00,0xff},
magenta
={0xff,0x00,0xff,0xff},
39
green
={0x00,0xff,0x00,0xff},
yellow
={0xff,0xff,0xff,0xff},
40
blue
={0x00,0x00,0xff,0xff},
white
={0xff,0xff,0xff,0xff};
41
42
43
#endif
color::r
uchar r
Definition:
defUtil.h:33
black
const color black
Definition:
defUtil.h:37
blue
const color blue
Definition:
defUtil.h:40
defTypes.h
rgb::r
uchar r
Definition:
defUtil.h:34
color
Definition:
pgm.h:5
color::g
byte g
Definition:
pgm.h:5
error
const unsigned int error
Definition:
defUtil.h:13
red
const color red
Definition:
defUtil.h:38
color::a
uchar a
Definition:
defUtil.h:33
yellow
const color yellow
Definition:
defUtil.h:39
ErrCode
unsigned int ErrCode
Definition:
defUtil.h:12
green
const color green
Definition:
defUtil.h:39
cyan
const color cyan
Definition:
defUtil.h:37
success
const unsigned int success
Definition:
defUtil.h:14
color::b
byte b
Definition:
pgm.h:5
WriteConsole
void WriteConsole(const char *fmt,...)
rgb::g
unsigned char g
Definition:
definition.h:61
uchar
unsigned char uchar
Definition:
defTypes.h:5
white
const color white
Definition:
defUtil.h:40
magenta
const color magenta
Definition:
defUtil.h:38
rgb::b
unsigned char b
Definition:
definition.h:61
rgb
Definition:
definition.h:60
Généré le Dimanche 9 Novembre 2014 22:08:56 pour Pipeline graphique par
1.8.8