1 | /* $Id: dlm_calllist.c 56566 2015-06-20 08:10:59Z vboxsync $ */
|
---|
2 | #if 0
|
---|
3 |
|
---|
4 | #include <stdio.h>
|
---|
5 | #include "cr_spu.h"
|
---|
6 | #include "cr_dlm.h"
|
---|
7 | #include "cr_mem.h"
|
---|
8 | #include "cr_error.h"
|
---|
9 | #include "dlm.h"
|
---|
10 | #include <VBox/VBoxUhgsmi.h>
|
---|
11 | /* The headers and structures are still auto-generated */
|
---|
12 | #include "dlm_generated.h"
|
---|
13 |
|
---|
14 | /* The CallList functions have a special implementation. They aren't commonly
|
---|
15 | * listed as state-changers, but they can cause state to change.
|
---|
16 | */
|
---|
17 |
|
---|
18 | static void DLM_APIENTRY executeCallList(DLMInstanceList *x, SPUDispatchTable *dispatchTable)
|
---|
19 | {
|
---|
20 | struct instanceCallList *instance = (struct instanceCallList *)x;
|
---|
21 | dispatchTable->CallList(instance->list);
|
---|
22 | }
|
---|
23 | void DLM_APIENTRY crDLMCompileCallList( GLuint list )
|
---|
24 | {
|
---|
25 | struct instanceCallList *instance;
|
---|
26 | instance = crCalloc(sizeof(struct instanceCallList));
|
---|
27 | if (!instance) {
|
---|
28 | crdlm_error(__LINE__, __FILE__, GL_OUT_OF_MEMORY,
|
---|
29 | "out of memory adding CallList to display list");
|
---|
30 | return;
|
---|
31 | }
|
---|
32 | /* Put in the parameters */
|
---|
33 | instance->list = list;
|
---|
34 |
|
---|
35 | /* Add to the display list correctly */
|
---|
36 | crdlm_add_to_list((DLMInstanceList *)instance, executeCallList);
|
---|
37 | }
|
---|
38 |
|
---|
39 | /*** CallLists ***/
|
---|
40 | static void DLM_APIENTRY executeCallLists(DLMInstanceList *x, SPUDispatchTable *dispatchTable)
|
---|
41 | {
|
---|
42 | struct instanceCallLists *instance = (struct instanceCallLists *)x;
|
---|
43 | dispatchTable->CallLists(instance->n, instance->type, instance->lists);
|
---|
44 | }
|
---|
45 | void DLM_APIENTRY crDLMCompileCallLists( GLsizei n, GLenum type, const GLvoid * lists )
|
---|
46 | {
|
---|
47 | struct instanceCallLists *instance;
|
---|
48 | instance = crCalloc(sizeof(struct instanceCallLists) + crdlm_pointers_CallLists(NULL, n, type, lists));
|
---|
49 | if (!instance) {
|
---|
50 | crdlm_error(__LINE__, __FILE__, GL_OUT_OF_MEMORY,
|
---|
51 | "out of memory adding CallLists to display list");
|
---|
52 | return;
|
---|
53 | }
|
---|
54 | instance->n = n;
|
---|
55 | instance->type = type;
|
---|
56 | if (lists == NULL) {
|
---|
57 | instance->lists = NULL;
|
---|
58 | }
|
---|
59 | else {
|
---|
60 | instance->lists = instance->listsData;
|
---|
61 | }
|
---|
62 | (void) crdlm_pointers_CallLists(instance, n, type, lists);
|
---|
63 |
|
---|
64 | crdlm_add_to_list((DLMInstanceList *)instance, executeCallLists);
|
---|
65 | }
|
---|
66 |
|
---|
67 | #endif
|
---|