4 #include "VVGL_Defines.hpp" 9 #include "VVGL_Time.hpp" 10 #include "VVGL_Range.hpp" 11 #include "VVGL_StringUtils.hpp" 30 class GLTexToTexCopier;
33 struct GLCachedAttrib;
35 class GLTexToCPUCopier;
36 class GLCPUToTexCopier;
107 inline const string GLVersionToString(
const GLVersion & v) {
switch (v) {
case GLVersion_Unknown:
return string(
"Unknown");
case GLVersion_2:
return string(
"2");
case GLVersion_ES:
return string(
"ES");
case GLVersion_ES2:
return string(
"ES2");
case GLVersion_ES3:
return string(
"ES3");
case GLVersion_33:
return string(
"3.3");
case GLVersion_4:
return string(
"4"); }
return string(
"err"); }
126 GLColor(
const float & inR,
const float & inG,
const float & inB,
const float & inA) { r=inR;g=inG;b=inB;a=inA; }
127 bool operator==(
const GLColor & n)
const {
return (this->r==n.r && this->g==n.g && this->b==n.b && this->a==n.a); }
128 bool operator!=(
const GLColor & n)
const {
return !(*
this==n); }
135 int __ASDFQWERZXCV__=glGetError(); \ 136 if (__ASDFQWERZXCV__!=0){ \ 137 std::string humanReadable("???"); \ 138 switch(__ASDFQWERZXCV__){ \ 139 case 0x0: humanReadable=std::string("no error"); break; \ 140 case 0x500: humanReadable=std::string("invalid enum"); break; \ 141 case 0x501: humanReadable=std::string("invalid value"); break; \ 142 case 0x502: humanReadable=std::string("invalid operation"); break; \ 143 case 0x503: humanReadable=std::string("stack overflow"); break; \ 144 case 0x504: humanReadable=std::string("stack underflow"); break; \ 145 case 0x505: humanReadable=std::string("out of memory"); break; \ 146 case 0x506: humanReadable=std::string("invalid framebuffer"); break; \ 147 case 0x507: humanReadable=std::string("context lost"); break; \ 148 case 0x8031: humanReadable=std::string("table too large"); break; \ 151 std::cout<<"\tglGetError() returned "<<__ASDFQWERZXCV__<<" ("<<humanReadable<<") in "<<__LINE__<<" of "<<__FILE__<<endl; \ 160 inline void VVUnpackFourCC_toChar(
unsigned long fourCC,
char *destCharPtr) {
if (destCharPtr==
nullptr)
return;
for (
int i=0; i<4; ++i) destCharPtr[i] = (char)((fourCC >> ((3-i)*8)) & 0xFF); }
170 #if defined(VVGL_SDK_QT) 172 #include <QCoreApplication> 181 template <
typename FTYPE>
182 static void perform_async(FTYPE && inFunc, QObject * inObj=qApp)
184 struct Event :
public QEvent
186 using Fun =
typename std::decay<FTYPE>::type;
188 Event(Fun && declInFunc) : QEvent(QEvent::None), varFunc(
std::move(declInFunc)) {}
189 Event(
const Fun & declInFunc) : QEvent(QEvent::None), varFunc(declInFunc) {}
190 ~Event() { this->varFunc(); }
192 QCoreApplication::postEvent(inObj,
new Event(std::forward<FTYPE>(inFunc)));
shared_ptr< GLCachedAttrib > GLCachedAttribRef
A GLCachedAttribRef is a shared pointer around a GLCachedAttrib.
Definition: VVGL_Base.hpp:70
This struct describes an RGBA color.
Definition: VVGL_Base.hpp:116
shared_ptr< GLCPUToTexCopier > GLCPUToTexCopierRef
A GLCPUToTexCopierRef is a shared pointer around a GLCPUToTexCopier.
Definition: VVGL_Base.hpp:85
shared_ptr< GLScene > GLSceneRef
A GLSceneRef is a shared pointer around a GLScene.
Definition: VVGL_Base.hpp:65
Definition: GLBuffer.hpp:13
const string GLVersionToString(const GLVersion &v)
Returns a std::string describing the passed GLVersion.
Definition: VVGL_Base.hpp:107
shared_ptr< GLBuffer > GLBufferRef
Very common- GLBufferRef is a shared pointer around a GLBuffer.
Definition: VVGL_Base.hpp:44
shared_ptr< GLTexToTexCopier > GLTexToTexCopierRef
A GLTexToTexCopierRef is a shared pointer around a GLTexToTexCopier.
Definition: VVGL_Base.hpp:54
shared_ptr< GLTexToCPUCopier > GLTexToCPUCopierRef
A GLTexToCPUCopierRef is a shared pointer around a GLTexToCPUCopier.
Definition: VVGL_Base.hpp:80
shared_ptr< GLCachedUni > GLCachedUniRef
A GLCachedUniRef is a shared pointer around a GLCachedUni.
Definition: VVGL_Base.hpp:75
shared_ptr< GLBufferPool > GLBufferPoolRef
A GLBufferPoolRef is a shared pointer around a GLBufferPool.
Definition: VVGL_Base.hpp:49
GLVersion
This enum is used to describe the GL environment of a GL context, which is determined at runtime...
Definition: VVGL_Base.hpp:94
shared_ptr< GLContext > GLContextRef
A GLContextRef is a shared pointer around a GLContext.
Definition: VVGL_Base.hpp:60