• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3  * Copyright 2000-2015 Haiku, Inc. All Rights Reserved.
4  * Distributed under the terms of the MIT License.
5  *
6  * Authors:
7  *		Brian Paul <brian.e.paul@gmail.com>
8  *		Philippe Houdoin <philippe.houdoin@free.fr>
9  *		Alexander von Gluck IV <kallisti5@unixzen.com>
10  */
11 
12 
13 #include "glapi/glapi.h"
14 #include "glapi/glapi_priv.h"
15 
16 
17 extern "C" {
18 /*
19  * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints
20  * (glAccum, glBegin, etc).
21  * This code IS NOT USED if we're compiling on an x86 system and using
22  * the glapi_x86.S assembly code.
23  */
24 #if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
25 
26 #define KEYWORD1 PUBLIC
27 #define KEYWORD2
28 #define NAME(func) gl##func
29 
30 #define DISPATCH(func, args, msg)					\
31 	const struct _glapi_table* dispatch;					\
32 	dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
33 	(dispatch->func) args
34 
35 #define RETURN_DISPATCH(func, args, msg) 				\
36 	const struct _glapi_table* dispatch;					\
37 	dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
38 	return (dispatch->func) args
39 
40 #endif
41 }
42 
43 
44 /* NOTE: this file portion implement a thin OpenGL entrypoints dispatching
45 	C++ wrapper class
46  */
47 
48 #include "GLDispatcher.h"
49 
BGLDispatcher()50 BGLDispatcher::BGLDispatcher()
51 {
52 }
53 
54 
~BGLDispatcher()55 BGLDispatcher::~BGLDispatcher()
56 {
57 }
58 
59 
60 status_t
SetTable(struct _glapi_table * table)61 BGLDispatcher::SetTable(struct _glapi_table* table)
62 {
63 	_glapi_set_dispatch(table);
64 	return B_OK;
65 }
66