VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_dispatch.h@ 58529

最後變更 在這個檔案從58529是 15532,由 vboxsync 提交於 16 年 前

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 2.1 KB
 
1#ifndef CR_DISPATCH_H
2#define CR_DISPATCH_H
3
4#include "spu_dispatch_table.h"
5
6#include <iprt/cdefs.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12/**
13 * This structure offers a set of layers for controlling the
14 * dispatch table. The top layer is always the active layer,
15 * and controls the dispatch table. Utilities may push new
16 * layers onto the stack, or pop layers off, to control how
17 * dispatches are made. A utility may keep track of the
18 * layer it created, and change it as needed, if dynamic
19 * control of dispatch tables is needed.
20 */
21
22typedef struct crDispatchLayer {
23 SPUDispatchTable *dispatchTable;
24 void (*changedCallback)(SPUDispatchTable *changedTable, void *callbackParm);
25 void *callbackParm;
26 struct crDispatchLayer *next, *prev;
27} crDispatchLayer;
28
29/** This has to be saved and restored for each graphics context */
30typedef struct {
31 crDispatchLayer *topLayer;
32 crDispatchLayer *bottomLayer;
33} crCurrentDispatchInfo;
34
35/**
36 * These are already called from appropriate opengl_stub
37 * routines, so SPUs or utilities shouldn't have to
38 * worry about them, as long as they let their
39 * parent routines for NewContext and MakeCurrent
40 * execute before they try to use any of the
41 * dispatch utilities.
42 */
43DECLEXPORT(void) crDispatchInit(SPUDispatchTable *defaultTable);
44DECLEXPORT(void) crInitDispatchInfo(crCurrentDispatchInfo *info);
45DECLEXPORT(void) crSetCurrentDispatchInfo(crCurrentDispatchInfo *info);
46
47/**
48 * SPUs and utilities are expected to use these routines
49 * to modify dispatch tables. They should only be called
50 * once the current dispatch info is set (i.e., after
51 * the opengl_stub routine for MakeCurrent has a chance
52 * to run).
53 */
54DECLEXPORT(crDispatchLayer) *crNewDispatchLayer(SPUDispatchTable *newTable,
55 void (*changedCallback)(SPUDispatchTable *changedTable, void *callbackParm),
56 void *callbackParm);
57DECLEXPORT(void) crChangeDispatchLayer(crDispatchLayer *layer,
58 SPUDispatchTable *changedTable);
59DECLEXPORT(void) crFreeDispatchLayer(crDispatchLayer *layer);
60
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* CR_DISPATCH_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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