VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/dlm/dlm_calllist.c@ 54905

Last change on this file since 54905 was 54905, checked in by vboxsync, 10 years ago

Host 3D: Chromium server: add Expando SPU and DLM module in order to record and save OpenGL Display Lists (currently disabled).

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette