1848b8605Smrg/*
2848b8605Smrg * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3b8e80941Smrg * Copyright 2000-2015 Haiku, Inc. All Rights Reserved.
4848b8605Smrg * Distributed under the terms of the MIT License.
5848b8605Smrg *
6848b8605Smrg * Authors:
7848b8605Smrg *		Brian Paul <brian.e.paul@gmail.com>
8848b8605Smrg *		Philippe Houdoin <philippe.houdoin@free.fr>
9848b8605Smrg *		Alexander von Gluck IV <kallisti5@unixzen.com>
10848b8605Smrg */
11848b8605Smrg
12848b8605Smrg
13848b8605Smrg#include "glapi/glapi.h"
14848b8605Smrg#include "glapi/glapi_priv.h"
15848b8605Smrg
16b8e80941Smrg
17b8e80941Smrgextern "C" {
18848b8605Smrg/*
19848b8605Smrg * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints
20848b8605Smrg * (glAccum, glBegin, etc).
21848b8605Smrg * This code IS NOT USED if we're compiling on an x86 system and using
22848b8605Smrg * the glapi_x86.S assembly code.
23848b8605Smrg */
24848b8605Smrg#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
25848b8605Smrg
26848b8605Smrg#define KEYWORD1 PUBLIC
27848b8605Smrg#define KEYWORD2
28848b8605Smrg#define NAME(func) gl##func
29848b8605Smrg
30848b8605Smrg#define DISPATCH(func, args, msg)					\
31848b8605Smrg	const struct _glapi_table* dispatch;					\
32848b8605Smrg	dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
33848b8605Smrg	(dispatch->func) args
34848b8605Smrg
35848b8605Smrg#define RETURN_DISPATCH(func, args, msg) 				\
36848b8605Smrg	const struct _glapi_table* dispatch;					\
37848b8605Smrg	dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
38848b8605Smrg	return (dispatch->func) args
39848b8605Smrg
40848b8605Smrg#endif
41848b8605Smrg}
42848b8605Smrg
43848b8605Smrg
44848b8605Smrg/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching
45848b8605Smrg	C++ wrapper class
46848b8605Smrg */
47848b8605Smrg
48848b8605Smrg#include "GLDispatcher.h"
49848b8605Smrg
50848b8605SmrgBGLDispatcher::BGLDispatcher()
51848b8605Smrg{
52848b8605Smrg}
53848b8605Smrg
54848b8605Smrg
55848b8605SmrgBGLDispatcher::~BGLDispatcher()
56848b8605Smrg{
57848b8605Smrg}
58848b8605Smrg
59848b8605Smrg
60848b8605Smrgstatus_t
61848b8605SmrgBGLDispatcher::SetTable(struct _glapi_table* table)
62848b8605Smrg{
63848b8605Smrg	_glapi_set_dispatch(table);
64848b8605Smrg	return B_OK;
65848b8605Smrg}
66