You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

115 lines
4.0 KiB

  1. #ifndef _CUCUL_PP_H
  2. #define _CUCUL_PP_H
  3. #include <stdio.h> // BUFSIZ
  4. #include <stdarg.h> // va_*
  5. #include "config.h"
  6. #include "cucul.h"
  7. class Cucul {
  8. friend class Caca;
  9. public:
  10. Cucul();
  11. Cucul(int width, int height);
  12. ~Cucul();
  13. /* Ugly, I know */
  14. class Font {
  15. friend class Cucul;
  16. protected:
  17. cucul_font *font;
  18. };
  19. class Sprite {
  20. friend class Cucul;
  21. protected:
  22. cucul_sprite *sprite;
  23. };
  24. class Dither {
  25. friend class Cucul;
  26. protected:
  27. cucul_dither *dither;
  28. };
  29. class Buffer {
  30. friend class Cucul;
  31. protected:
  32. cucul_buffer *buffer;
  33. };
  34. void set_size(unsigned int w, unsigned int h);
  35. unsigned int get_width(void);
  36. unsigned int get_height(void);
  37. void set_color(unsigned int f, unsigned int b);
  38. char const * get_color_name (unsigned int color);
  39. void printf ( int x , int y , char const * format,...);
  40. void putchar (int x, int y, char c);
  41. void putstr (int x, int y, char *str);
  42. void clear ();
  43. void blit ( int, int, Cucul* c1, Cucul* c2);
  44. void invert ();
  45. void flip ();
  46. void flop ();
  47. void rotate ();
  48. void draw_line ( int, int, int, int, char const *);
  49. void draw_polyline ( int const x[], int const y[], int, char const *);
  50. void draw_thin_line ( int, int, int, int);
  51. void draw_thin_polyline ( int const x[], int const y[], int);
  52. void draw_circle ( int, int, int, char const *);
  53. void draw_ellipse ( int, int, int, int, char const *);
  54. void draw_thin_ellipse ( int, int, int, int);
  55. void fill_ellipse ( int, int, int, int, char const *);
  56. void draw_box ( int, int, int, int, char const *);
  57. void draw_thin_box ( int, int, int, int);
  58. void fill_box ( int, int, int, int, char const *);
  59. void draw_triangle ( int, int, int, int, int, int, char const *);
  60. void draw_thin_triangle ( int, int, int, int, int, int);
  61. void fill_triangle ( int, int, int, int, int, int, char const *);
  62. int rand (int, int);
  63. unsigned int sqrt (unsigned int);
  64. Sprite * load_sprite (char const *);
  65. int get_sprite_frames (Cucul::Sprite const *);
  66. int get_sprite_width (Cucul::Sprite const *, int);
  67. int get_sprite_height (Cucul::Sprite const *, int);
  68. int get_sprite_dx (Cucul::Sprite const *, int);
  69. int get_sprite_dy (Cucul::Sprite const *, int);
  70. void draw_sprite ( int, int, Cucul::Sprite const *, int);
  71. void free_sprite (Cucul::Sprite*);
  72. Dither * create_dither (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  73. void set_dither_palette (Cucul::Dither *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
  74. void set_dither_brightness (Cucul::Dither *, float);
  75. void set_dither_gamma (Cucul::Dither *, float);
  76. void set_dither_contrast (Cucul::Dither *, float);
  77. void set_dither_invert (Cucul::Dither *, int);
  78. void set_dither_antialias (Cucul::Dither *, char const *);
  79. char const *const * get_dither_antialias_list (Cucul::Dither const *);
  80. void set_dither_color (Cucul::Dither *, char const *);
  81. char const *const * get_dither_color_list (Cucul::Dither const *);
  82. void set_dither_charset (Cucul::Dither *, char const *);
  83. char const *const * get_dither_charset_list (Cucul::Dither const *);
  84. void set_dither_mode (Cucul::Dither *, char const *);
  85. char const *const * get_dither_mode_list (Cucul::Dither const *);
  86. void dither_bitmap ( int, int, int, int, Cucul::Dither const *, void *);
  87. void free_dither (Cucul::Dither *);
  88. Font * load_font (void const *, unsigned int);
  89. char const *const * get_font_list (void);
  90. unsigned int get_font_width (Font *);
  91. unsigned int get_font_height (Font *);
  92. void render_canvas ( Font *, unsigned char *, unsigned int, unsigned int, unsigned int);
  93. void free_font (Font *);
  94. Buffer * create_export ( char const *);
  95. char const *const * get_export_list (void);
  96. protected:
  97. cucul_t *get_cucul_t();
  98. private:
  99. cucul_t *qq;
  100. };
  101. #endif /* _CUCUL_PP_H */