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();
37 status_t
SetTable(struct _glapi_table
* dispatch
);
40 const _glapi_proc
operator[](const char* functionName
);
41 const char* operator[](uint32 offset
);
43 const _glapi_proc
AddressOf(const char* functionName
);
44 uint32
OffsetOf(const char* functionName
);
50 BGLDispatcher::SetCurrentContext(void* context
)
52 _glapi_set_context(context
);
57 BGLDispatcher::CurrentContext()
59 return _glapi_get_context();
63 inline struct _glapi_table
*
64 BGLDispatcher::Table()
66 return _glapi_get_dispatch();
71 BGLDispatcher::TableSize()
73 return _glapi_get_dispatch_table_size();
77 inline const _glapi_proc
78 BGLDispatcher::operator[](const char* functionName
)
80 return _glapi_get_proc_address(functionName
);
85 BGLDispatcher::operator[](uint32 offset
)
87 return _glapi_get_proc_name((GLuint
) offset
);
91 inline const _glapi_proc
92 BGLDispatcher::AddressOf(const char* functionName
)
94 return _glapi_get_proc_address(functionName
);
99 BGLDispatcher::OffsetOf(const char* functionName
)
101 return (uint32
) _glapi_get_proc_offset(functionName
);
105 #endif // GLDISPATCHER_H