X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Fgltrace.hpp;h=155f82760cd641139e5ddd4ef28c8923fe67fce3;hb=d493737765bed0fcbba908024d2314778c26b5c9;hp=db824bb315ffd5f1044b3752104b83e7de466fac;hpb=0ee878906f76cfe44ea6206112179600501efe52;p=apitrace diff --git a/wrappers/gltrace.hpp b/wrappers/gltrace.hpp index db824bb..155f827 100644 --- a/wrappers/gltrace.hpp +++ b/wrappers/gltrace.hpp @@ -28,6 +28,9 @@ #include "glimports.hpp" +#include +#include +#include namespace gltrace { @@ -39,6 +42,25 @@ enum Profile { PROFILE_ES2, }; +class Buffer { +public: + ~Buffer() + { + free(data); + } + + void resetData(const void *new_data, size_t new_size) + { + data = realloc(data, new_size); + size = new_size; + if (size) + memcpy(data, new_data, size); + } + + size_t size; + void *data; +}; + class Context { public: enum Profile profile; @@ -46,6 +68,7 @@ public: bool user_arrays_arb; bool user_arrays_nv; unsigned retain_count; + std::map buffers; Context(void) : profile(PROFILE_COMPAT), @@ -54,6 +77,12 @@ public: user_arrays_nv(false), retain_count(0) { } + + inline bool + needsShadowBuffers(void) + { + return profile == PROFILE_ES1 || profile == PROFILE_ES2; + } }; void