Usermode/AxWin4 - Added text rendering (very hacky using VGA font)
[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]:[NAK,status] = udi_gfx_get_engine_req(state_cb);
49                         if(NAK) {
50                                 // Shit to do if NAK happens
51                                 return ;
52                         }
53                         else {
54                         }
55                         
56                         // TODO: Annotate udi_gfx_state_cb_t to note values are kept?
57                         state_cb->subsystem = i;
58                         state_cb->attribute = UDI_GFX_PROP_OPERATOR_INDEX;
59                         [count] = udi_gfx_get_engine_req(state_cb);
60                         for( int j = 0; j < count; j ++ )
61                         {
62                                 state_cb->attribute = j;
63                                 [operator, arg_1, arg_2, arg_3] = udi_gfx_engine_getop_req(state_cb);
64                                 Log_Debug("UDIGFX", "%i/%i: %i 0x%x 0x%x 0x%x",
65                                         i, j,
66                                         operator, arg_1, arg_2, arg_3);
67                         }
68                 }
69                 return;
70         default:
71                 // TODO: emit an error of some form?
72                 return;
73         }
74 }
75
76 // === UDI Bindings ===
77

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