From 6a007660fb7bac51f01ef0b9466bfcc6ade7389b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 14 May 2023 00:55:54 -0700 Subject: Implement direct functions for context state --- al/direct_defs.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 al/direct_defs.h (limited to 'al/direct_defs.h') diff --git a/al/direct_defs.h b/al/direct_defs.h new file mode 100644 index 00000000..555e9565 --- /dev/null +++ b/al/direct_defs.h @@ -0,0 +1,35 @@ +#ifndef AL_DIRECT_DEFS_H +#define AL_DIRECT_DEFS_H + +#define DECL_FUNC(R, Name) \ +R AL_API Name(void) START_API_FUNC \ +{ \ + return Name##Direct(GetContextRef().get()); \ +} END_API_FUNC + +#define DECL_FUNC1(R, Name, T1) \ +R AL_API Name(T1 a) START_API_FUNC \ +{ \ + return Name##Direct(GetContextRef().get(), a); \ +} END_API_FUNC + +#define DECL_FUNC2(R, Name, T1, T2) \ +R AL_API Name(T1 a, T2 b) START_API_FUNC \ +{ \ + return Name##Direct(GetContextRef().get(), a, b); \ +} END_API_FUNC + + +#define DECL_FUNCEXT(R, Name,Ext) \ +R AL_API Name##Ext(void) START_API_FUNC \ +{ \ + return Name##Direct##Ext(GetContextRef().get()); \ +} END_API_FUNC + +#define DECL_FUNCEXT2(R, Name,Ext, T1, T2) \ +R AL_API Name##Ext(T1 a, T2 b) START_API_FUNC \ +{ \ + return Name##Direct##Ext(GetContextRef().get(), a, b); \ +} END_API_FUNC + +#endif /* AL_DIRECT_DEFS_H */ -- cgit v1.2.3