2 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000-2012 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>
21 #include "glapi/glapi.h"
27 // Private unimplemented copy constructors
28 BGLDispatcher(const BGLDispatcher
&);
29 BGLDispatcher
& operator=(const BGLDispatcher
&);
35 void SetCurrentContext(void* context
);
36 void* CurrentContext();
38 struct _glapi_table
* Table();
40 const struct _glapi_table
* dispatch
= NULL
);
41 status_t
SetTable(struct _glapi_table
* dispatch
);
44 const _glapi_proc
operator[](const char* functionName
);
45 const char* operator[](uint32 offset
);
47 const _glapi_proc
AddressOf(const char* functionName
);
48 uint32
OffsetOf(const char* functionName
);
54 BGLDispatcher::SetCurrentContext(void* context
)
56 _glapi_set_context(context
);
61 BGLDispatcher::CurrentContext()
63 return _glapi_get_context();
67 inline struct _glapi_table
*
68 BGLDispatcher::Table()
70 return _glapi_get_dispatch();
75 BGLDispatcher::TableSize()
77 return _glapi_get_dispatch_table_size();
81 inline const _glapi_proc
82 BGLDispatcher::operator[](const char* functionName
)
84 return _glapi_get_proc_address(functionName
);
89 BGLDispatcher::operator[](uint32 offset
)
91 return _glapi_get_proc_name((GLuint
) offset
);
95 inline const _glapi_proc
96 BGLDispatcher::AddressOf(const char* functionName
)
98 return _glapi_get_proc_address(functionName
);
103 BGLDispatcher::OffsetOf(const char* functionName
)
105 return (uint32
) _glapi_get_proc_offset(functionName
);
109 #endif // GLDISPATCHER_H