ManaPlus
Macros
mglfunctions.h File Reference

(986a3bf)

#include "logger.h"

Go to the source code of this file.

Macros

#define getFunction(name)
 
#define assignFunction(func)
 
#define assignFunction3(func, ext)
 
#define assignFunctionARB(func)   assignFunction3(func, ARB)
 
#define assignFunctionEXT(func)   assignFunction3(func, EXT)
 
#define assignFunction2(func, name)
 
#define assignFunctionEmu2(func, name)
 
#define emulateFunction(func)
 

Macro Definition Documentation

◆ assignFunction

#define assignFunction (   func)
Value:
{ \
m##func = reinterpret_cast<func##_t>(getFunction(#func)); \
if (m##func == nullptr) \
logger->log("function not found: " #func); \
else \
logger->log("assigned function: " #func); \
}
#define getFunction(name)
Definition: mglfunctions.h:42

Definition at line 46 of file mglfunctions.h.

◆ assignFunction2

#define assignFunction2 (   func,
  name 
)
Value:
{ \
m##func = reinterpret_cast<func##_t>(getFunction(name)); \
if (m##func == nullptr) \
logger->log(std::string("function not found: ") + name); \
else \
logger->log(std::string("assigned function: ") + name); \
}

Definition at line 77 of file mglfunctions.h.

◆ assignFunction3

#define assignFunction3 (   func,
  ext 
)
Value:
{ \
m##func = reinterpret_cast<func##_t>(getFunction(#func#ext)); \
if (m##func == nullptr) \
{ \
logger->log("function not found: " #func#ext); \
m##func = reinterpret_cast<func##_t>(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); \
} \
}

Definition at line 55 of file mglfunctions.h.

◆ assignFunctionARB

#define assignFunctionARB (   func)    assignFunction3(func, ARB)

Definition at line 73 of file mglfunctions.h.

◆ assignFunctionEmu2

#define assignFunctionEmu2 (   func,
  name 
)
Value:
{ \
m##func = reinterpret_cast<func##_t>(getFunction(name)); \
if (m##func == nullptr) \
{ \
m##func = emu##func; \
logger->log(std::string("emulated function: ") + name); \
} \
else \
{ \
logger->log(std::string("assigned function: ") + name); \
} \
}

Definition at line 86 of file mglfunctions.h.

◆ assignFunctionEXT

#define assignFunctionEXT (   func)    assignFunction3(func, EXT)

Definition at line 75 of file mglfunctions.h.

◆ emulateFunction

#define emulateFunction (   func)
Value:
m##func = emu##func; \
logger->log("emulated function: " #func)

Definition at line 100 of file mglfunctions.h.

◆ getFunction

#define getFunction (   name)
Value:
glXGetProcAddress(\
reinterpret_cast<const GLubyte*>(name))

Definition at line 42 of file mglfunctions.h.