From 18b2da68d0ae157778bab38d6a90f71e5bb95da2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 12 Jul 2014 21:17:51 +0300 Subject: Add functions to get ARB or EXT OpenGL functions. --- src/render/mglfunctions.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/render/mglfunctions.h') diff --git a/src/render/mglfunctions.h b/src/render/mglfunctions.h index 569f4aac4..23e3bea6d 100644 --- a/src/render/mglfunctions.h +++ b/src/render/mglfunctions.h @@ -45,6 +45,28 @@ logger->log("assigned function: " #func); \ } +#define assignFunction3(func, ext) \ + { \ + m##func = reinterpret_cast(getFunction(#func#ext)); \ + if (m##func == nullptr) \ + { \ + logger->log("function not found: " #func#ext); \ + m##func = reinterpret_cast(getFunction(#func)); \ + if (m##func == nullptr) \ + logger->log("function not found: " #func); \ + else \ + logger->log("assigned function: " #func); \ + } \ + else \ + { \ + logger->log("assigned function: " #func#ext); \ + } \ + } + +#define assignFunctionARB(func) assignFunction3(func, ARB) + +#define assignFunctionEXT(func) assignFunction3(func, EXT) + #define assignFunction2(func, name) \ { \ m##func = reinterpret_cast(getFunction(name)); \ -- cgit v1.2.3-70-g09d2