7ee095d917b75dcdc0f0a76c19813c8dd6330e3d
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.
7 * Brian Paul <brian.e.paul@gmail.com>
8 * Philippe Houdoin <philippe.houdoin@free.fr>
10 #ifndef GLDISPATCHER_H
11 #define GLDISPATCHER_H
16 #include <SupportDefs.h>
20 #include "glapi/glapi.h"
25 // Private unimplemented copy constructors
26 BGLDispatcher(const BGLDispatcher
&);
27 BGLDispatcher
& operator=(const BGLDispatcher
&);
33 void SetCurrentContext(void* context
);
34 void* CurrentContext();
36 struct _glapi_table
* Table();
38 const struct _glapi_table
* dispatch
= NULL
);
39 status_t
SetTable(struct _glapi_table
* dispatch
);
42 const _glapi_proc
operator[](const char* functionName
);
43 const char* operator[](uint32 offset
);
45 const _glapi_proc
AddressOf(const char* functionName
);
46 uint32
OffsetOf(const char* functionName
);
52 BGLDispatcher::SetCurrentContext(void* context
)
54 _glapi_set_context(context
);
59 BGLDispatcher::CurrentContext()
61 return _glapi_get_context();
65 inline struct _glapi_table
*
66 BGLDispatcher::Table()
68 return _glapi_get_dispatch();
73 BGLDispatcher::TableSize()
75 return _glapi_get_dispatch_table_size();
79 inline const _glapi_proc
80 BGLDispatcher::operator[](const char* functionName
)
82 return _glapi_get_proc_address(functionName
);
87 BGLDispatcher::operator[](uint32 offset
)
89 return _glapi_get_proc_name((GLuint
) offset
);
93 inline const _glapi_proc
94 BGLDispatcher::AddressOf(const char* functionName
)
96 return _glapi_get_proc_address(functionName
);
101 BGLDispatcher::OffsetOf(const char* functionName
)
103 return (uint32
) _glapi_get_proc_offset(functionName
);
107 #endif // GLDISPATCHER_H