gl-util.h: Add GL ID != operator and TEXFBO::clear
TEXFBO::clear resets the struct into its state right after creation, nulling all IDs inside so they're invaid.
This commit is contained in:
parent
1767b200c7
commit
0af5e9d66c
|
@ -42,6 +42,10 @@ struct ID \
|
|||
{ \
|
||||
return gl == o.gl; \
|
||||
} \
|
||||
bool operator!=(const ID &o) const \
|
||||
{ \
|
||||
return !(*this == o); \
|
||||
} \
|
||||
};
|
||||
|
||||
/* 2D Texture */
|
||||
|
@ -236,6 +240,13 @@ struct TEXFBO
|
|||
FBO::del(obj.fbo);
|
||||
TEX::del(obj.tex);
|
||||
}
|
||||
|
||||
static inline void clear(TEXFBO &obj)
|
||||
{
|
||||
obj.tex = TEX::ID(0);
|
||||
obj.fbo = FBO::ID(0);
|
||||
obj.width = obj.height = 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // GLUTIL_H
|
||||
|
|
Loading…
Reference in New Issue