diff options
author | marha <marha@users.sourceforge.net> | 2014-01-10 23:39:19 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-01-10 23:39:19 +0100 |
commit | aaeb8bf497c82efabc4f9b27c319042c0e72d816 (patch) | |
tree | 0df2c4a5b027a07dd1e3bf8707c72f25fe71b4f1 /mesalib/src/hgl/GLDispatcher.h | |
parent | be6e384aa4b97dc81b88ab5b04328c161828e760 (diff) | |
download | vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.tar.gz vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.tar.bz2 vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.zip |
randrproto libfontenc mesa xserver git update 10 Jan 2014
xserver commit a92c6406e7f6c0b74fb1cb9361ad904facc0f722
libfontenc commit 0037a42107b952c9d903719615747e760e4e7247
randrproto commit 1755cbe0f501a86afe515f92bb24e417a1866092
mesa commit 532b1fecd93fd30d3b1b101b55fd2c6e074088ad
Diffstat (limited to 'mesalib/src/hgl/GLDispatcher.h')
-rw-r--r-- | mesalib/src/hgl/GLDispatcher.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/mesalib/src/hgl/GLDispatcher.h b/mesalib/src/hgl/GLDispatcher.h new file mode 100644 index 000000000..44bca8ce5 --- /dev/null +++ b/mesalib/src/hgl/GLDispatcher.h @@ -0,0 +1,109 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Brian Paul <brian.e.paul@gmail.com> + * Philippe Houdoin <philippe.houdoin@free.fr> + */ +#ifndef GLDISPATCHER_H +#define GLDISPATCHER_H + + +#include <BeBuild.h> +#include <GL/gl.h> +#include <SupportDefs.h> + +#include "glheader.h" + +extern "C" { +#include "glapi/glapi.h" +} + + +class BGLDispatcher +{ + // Private unimplemented copy constructors + BGLDispatcher(const BGLDispatcher &); + BGLDispatcher & operator=(const BGLDispatcher &); + + public: + BGLDispatcher(); + ~BGLDispatcher(); + + void SetCurrentContext(void* context); + void* CurrentContext(); + + struct _glapi_table* Table(); + status_t CheckTable( + const struct _glapi_table* dispatch = NULL); + status_t SetTable(struct _glapi_table* dispatch); + uint32 TableSize(); + + const _glapi_proc operator[](const char* functionName); + const char* operator[](uint32 offset); + + const _glapi_proc AddressOf(const char* functionName); + uint32 OffsetOf(const char* functionName); +}; + + +// Inlines methods +inline void +BGLDispatcher::SetCurrentContext(void* context) +{ + _glapi_set_context(context); +} + + +inline void* +BGLDispatcher::CurrentContext() +{ + return _glapi_get_context(); +} + + +inline struct _glapi_table* +BGLDispatcher::Table() +{ + return _glapi_get_dispatch(); +} + + +inline uint32 +BGLDispatcher::TableSize() +{ + return _glapi_get_dispatch_table_size(); +} + + +inline const _glapi_proc +BGLDispatcher::operator[](const char* functionName) +{ + return _glapi_get_proc_address(functionName); +} + + +inline const char* +BGLDispatcher::operator[](uint32 offset) +{ + return _glapi_get_proc_name((GLuint) offset); +} + + +inline const _glapi_proc +BGLDispatcher::AddressOf(const char* functionName) +{ + return _glapi_get_proc_address(functionName); +} + + +inline uint32 +BGLDispatcher::OffsetOf(const char* functionName) +{ + return (uint32) _glapi_get_proc_offset(functionName); +} + + +#endif // GLDISPATCHER_H |