summaryrefslogtreecommitdiff
path: root/Source/DirectFB/gfxdrivers/cle266/uc_accel.h
blob: fb6e111b83ccdb10133410c2f361384ef341deba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
   Copyright (c) 2003 Andreas Robinson, All rights reserved.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
*/

#ifndef __UC_ACCEL_H__
#define __UC_ACCEL_H__

#include "unichrome.h"


// 2D accelerator capabilites

#define UC_DRAWING_FLAGS_2D        (DSDRAW_XOR)

#define UC_BLITTING_FLAGS_2D       (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY)

#define UC_DRAWING_FUNCTIONS_2D    (DFXL_DRAWLINE      | \
                                    DFXL_DRAWRECTANGLE | \
                                    DFXL_FILLRECTANGLE)

#define UC_BLITTING_FUNCTIONS_2D   (DFXL_BLIT)


// 3D accelerator capabilites

#ifdef UC_ENABLE_3D

#define UC_DRAWING_FLAGS_3D        (DSDRAW_BLEND | DSDRAW_XOR)

#define UC_BLITTING_FLAGS_3D       (DSBLIT_BLEND_ALPHACHANNEL | \
                                    DSBLIT_BLEND_COLORALPHA   | \
                                    DSBLIT_COLORIZE           | \
                                    DSBLIT_DEINTERLACE)

#define UC_DRAWING_FUNCTIONS_3D    (DFXL_DRAWLINE      | \
                                    DFXL_DRAWRECTANGLE | \
                                    DFXL_FILLRECTANGLE | \
                                    DFXL_FILLTRIANGLE)

#define UC_BLITTING_FUNCTIONS_3D   (DFXL_BLIT        | \
                                    DFXL_STRETCHBLIT | \
                                    DFXL_TEXTRIANGLES)

#else

#define UC_DRAWING_FLAGS_3D        0
#define UC_BLITTING_FLAGS_3D       0
#define UC_DRAWING_FUNCTIONS_3D    0
#define UC_BLITTING_FUNCTIONS_3D   0

#endif // UC_ENABLE_3D


// Functions

void uc_emit_commands      ( void         *drv,
                             void         *dev );

void uc_flush_texture_cache( void         *drv,
                             void         *dev );

bool uc_fill_rectangle     ( void         *drv,
                             void         *dev,
                             DFBRectangle *rect );

bool uc_draw_rectangle     ( void         *drv,
                             void         *dev,
                             DFBRectangle *rect );

bool uc_draw_line          ( void         *drv,
                             void         *dev,
                             DFBRegion    *line );

bool uc_blit               ( void         *drv,
                             void         *dev,
                             DFBRectangle *rect,
                             int           dx,
                             int           dy );

bool uc_fill_rectangle_3d  ( void         *drv,
                             void         *dev,
                             DFBRectangle *rect );

bool uc_draw_rectangle_3d  ( void         *drv,
                             void         *dev,
                             DFBRectangle *rect );

bool uc_draw_line_3d       ( void         *drv,
                             void         *dev,
                             DFBRegion    *line );

bool uc_fill_triangle      ( void         *drv,
                             void         *dev,
                             DFBTriangle  *tri );

bool uc_blit_3d            ( void         *drv,
                             void         *dev,
                             DFBRectangle *rect,
                             int           dx,
                             int           dy );

bool uc_stretch_blit       ( void         *drv,
                             void         *dev,
                             DFBRectangle *srect,
                             DFBRectangle *drect );

bool uc_texture_triangles  ( void         *drv,
                             void         *dev,
                             DFBVertex    *vertices,
                             int           num,
                             DFBTriangleFormation formation );

#endif // __UC_ACCEL_H__