Merge branch 'master' of github.com:thepowersgang/acess2
[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] = @TRY_NAK[status] udi_gfx_get_engine_req(state_cb)
49                         {
50                                 // Shit to do if NAK happens
51                                 return ;
52                                 // break PIXFMT_NONE;
53                         }
54                         
55                         // TODO: Annotate udi_gfx_state_cb_t to note values are kept?
56                         state_cb->subsystem = i;
57                         state_cb->attribute = UDI_GFX_PROP_OPERATOR_INDEX;
58                         [count] = udi_gfx_get_engine_req(state_cb);
59                         for( int j = 0; j < count; j ++ )
60                         {
61                                 state_cb->attribute = j;
62                                 [operator, arg_1, arg_2, arg_3] = udi_gfx_engine_getop_req(state_cb);
63                                 Log_Debug("UDIGFX", "%i/%i: %i 0x%x 0x%x 0x%x",
64                                         i, j,
65                                         operator, arg_1, arg_2, arg_3);
66                         }
67                 }
68                 return;
69         default:
70                 // TODO: emit an error of some form?
71                 return;
72         }
73 }
74
75 // === UDI Bindings ===
76

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