Modules/UDI - Non-compiling gfx translation layer (needs heaps of algos)
[tpg/acess2.git] / KernelLand / Modules / Interfaces / UDI / trans / gfx.udic
1 /*
2  * Acess2 UDI Layer
3  * - By John Hodge (thePowersGang)
4  *
5  * trans/gfx.c
6  * - Graphics interface
7  */
8 #define DEBUG   1
9 #define UDI_VERSION 0x101
10 #define UDI_GFX_VERSION 0x101
11 #include <udi.h>
12 #include <udi_gfx.h>
13 #include <acess.h>
14 #include <api_drv_video.h>
15
16 // === TYPES ===
17 typedef struct rdata_s
18 {
19         
20 } rdata_t;
21
22 // === CODE ===
23 void usage_ind(udi_usage_cb_t *cb, udi_ubit8_t resource_level)
24 {
25         // Set up structures that don't need interegating the card to do
26         
27 }
28
29 @GFX_CLIENT channel_event_ind(udi_channel_event_cb_t *cb)
30 {
31         udi_gfx_bind_cb_t       *bind_cb = cb->params.parent_bound.bind_cb;
32         switch(cb->event)
33         {
34         case UDI_CHANNEL_CLOSED:
35                 return;
36         case UDI_CHANNEL_BOUND:
37                 [sockets, engines, status] = udi_gfx_bind_req(bind_cb);
38                 if( status != UDI_OK ) {
39                         return;
40                 }
41                 // allocate a CB
42                 [new_cb] = udi_cb_alloc(bind_cb, ACESSGFX_CB_STATE);
43                 udi_gfx_state_cb_t *state_cb = new_cb;
44                 for( int i = 0; i < engines; i ++ )
45                 {
46                         state_cb->subsystem = i;
47                         state_cb->attribute = UDI_GFX_PROP_PIXELFORMAT;
48                         [pixfmt] = udi_gfx_get_engine_req(state_cb);
49                         
50                         // TODO: Annotate udi_gfx_state_cb_t to note values are kept?
51                         state_cb->subsystem = i;
52                         state_cb->attribute = UDI_GFX_PROP_OPERATOR_INDEX;
53                         [count] = udi_gfx_get_engine_req(state_cb);
54                         for( int j = 0; j < count; j ++ )
55                         {
56                                 state_cb->attribute = j;
57                                 [operator, arg_1, arg_2, arg_3] = udi_gfx_engine_getop_req(state_cb);
58                                 Log_Debug("UDIGFX", "%i/%i: %i 0x%x 0x%x 0x%x",
59                                         i, j,
60                                         operator, arg_1, arg_2, arg_3);
61                         }
62                 }
63                 return;
64         default:
65                 // TODO: emit an error of some form?
66                 return;
67         }
68 }
69
70 // === UDI Bindings ===
71

UCC git Repository :: git.ucc.asn.au