1 /* 2 Copyright (c) 2003 Andreas Robinson, All rights reserved. 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2 of the License, or (at your option) any later version. 8 */ 9 10 #ifndef __UC_ACCEL_H__ 11 #define __UC_ACCEL_H__ 12 13 #include "unichrome.h" 14 15 16 // 2D accelerator capabilites 17 18 #define UC_DRAWING_FLAGS_2D (DSDRAW_XOR) 19 20 #define UC_BLITTING_FLAGS_2D (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY) 21 22 #define UC_DRAWING_FUNCTIONS_2D (DFXL_DRAWLINE | \ 23 DFXL_DRAWRECTANGLE | \ 24 DFXL_FILLRECTANGLE) 25 26 #define UC_BLITTING_FUNCTIONS_2D (DFXL_BLIT) 27 28 29 // 3D accelerator capabilites 30 31 #ifdef UC_ENABLE_3D 32 33 #define UC_DRAWING_FLAGS_3D (DSDRAW_BLEND | DSDRAW_XOR) 34 35 #define UC_BLITTING_FLAGS_3D (DSBLIT_BLEND_ALPHACHANNEL | \ 36 DSBLIT_BLEND_COLORALPHA | \ 37 DSBLIT_COLORIZE | \ 38 DSBLIT_DEINTERLACE) 39 40 #define UC_DRAWING_FUNCTIONS_3D (DFXL_DRAWLINE | \ 41 DFXL_DRAWRECTANGLE | \ 42 DFXL_FILLRECTANGLE | \ 43 DFXL_FILLTRIANGLE) 44 45 #define UC_BLITTING_FUNCTIONS_3D (DFXL_BLIT | \ 46 DFXL_STRETCHBLIT | \ 47 DFXL_TEXTRIANGLES) 48 49 #else 50 51 #define UC_DRAWING_FLAGS_3D 0 52 #define UC_BLITTING_FLAGS_3D 0 53 #define UC_DRAWING_FUNCTIONS_3D 0 54 #define UC_BLITTING_FUNCTIONS_3D 0 55 56 #endif // UC_ENABLE_3D 57 58 59 // Functions 60 61 void uc_emit_commands ( void *drv, 62 void *dev ); 63 64 void uc_flush_texture_cache( void *drv, 65 void *dev ); 66 67 bool uc_fill_rectangle ( void *drv, 68 void *dev, 69 DFBRectangle *rect ); 70 71 bool uc_draw_rectangle ( void *drv, 72 void *dev, 73 DFBRectangle *rect ); 74 75 bool uc_draw_line ( void *drv, 76 void *dev, 77 DFBRegion *line ); 78 79 bool uc_blit ( void *drv, 80 void *dev, 81 DFBRectangle *rect, 82 int dx, 83 int dy ); 84 85 bool uc_fill_rectangle_3d ( void *drv, 86 void *dev, 87 DFBRectangle *rect ); 88 89 bool uc_draw_rectangle_3d ( void *drv, 90 void *dev, 91 DFBRectangle *rect ); 92 93 bool uc_draw_line_3d ( void *drv, 94 void *dev, 95 DFBRegion *line ); 96 97 bool uc_fill_triangle ( void *drv, 98 void *dev, 99 DFBTriangle *tri ); 100 101 bool uc_blit_3d ( void *drv, 102 void *dev, 103 DFBRectangle *rect, 104 int dx, 105 int dy ); 106 107 bool uc_stretch_blit ( void *drv, 108 void *dev, 109 DFBRectangle *srect, 110 DFBRectangle *drect ); 111 112 bool uc_texture_triangles ( void *drv, 113 void *dev, 114 DFBVertex *vertices, 115 int num, 116 DFBTriangleFormation formation ); 117 118 #endif // __UC_ACCEL_H__ 119 120