From 35c8505a335b7e60e5f1763fd790de57ec6c5c2b Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Wed, 8 Sep 2010 09:32:42 +0000 Subject: [PATCH] Add an AddressOf() inline method, beside OffsetOf(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38577 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/opengl/GLDispatcher.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/kits/opengl/GLDispatcher.h b/src/kits/opengl/GLDispatcher.h index c97ba2270d..440c32115d 100644 --- a/src/kits/opengl/GLDispatcher.h +++ b/src/kits/opengl/GLDispatcher.h @@ -14,23 +14,24 @@ 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 *function_name); + + const _glapi_proc operator[](const char *functionName); const char * operator[](uint32 offset); - - uint32 OffsetOf(const char *function_name); + + const _glapi_proc AddressOf(const char *functionName); + uint32 OffsetOf(const char *functionName); }; // Inlines methods @@ -58,9 +59,9 @@ inline uint32 BGLDispatcher::TableSize() } -inline const _glapi_proc BGLDispatcher::operator[](const char *function_name) +inline const _glapi_proc BGLDispatcher::operator[](const char *functionName) { - return _glapi_get_proc_address(function_name); + return _glapi_get_proc_address(functionName); } @@ -70,9 +71,15 @@ inline const char * BGLDispatcher::operator[](uint32 offset) } -inline uint32 BGLDispatcher::OffsetOf(const char *function_name) +inline const _glapi_proc BGLDispatcher::AddressOf(const char *functionName) { - return (uint32) _glapi_get_proc_offset(function_name); + return _glapi_get_proc_address(functionName); +} + + +inline uint32 BGLDispatcher::OffsetOf(const char *functionName) +{ + return (uint32) _glapi_get_proc_offset(functionName); }