Fill in the begin/end counting on win32.

macos/v1.5.9
Eric Anholt 11 years ago
parent b128dd9b25
commit 4eaf4bfe21
  1. 6
      src/dispatch_common.c

@ -134,7 +134,7 @@ struct api {
* is trying to resolve, but given that it's basically just for * is trying to resolve, but given that it's basically just for
* informative error messages, we shouldn't need to care. * informative error messages, we shouldn't need to care.
*/ */
int begin_count; long begin_count;
}; };
static struct api api = { static struct api api = {
@ -420,7 +420,7 @@ PUBLIC void
epoxy_glBegin(GLenum primtype) epoxy_glBegin(GLenum primtype)
{ {
#ifdef _WIN32 #ifdef _WIN32
#warning missing locking InterlockedIncrement(&api.begin_count);
#else #else
pthread_mutex_lock(&api.mutex); pthread_mutex_lock(&api.mutex);
api.begin_count++; api.begin_count++;
@ -436,7 +436,7 @@ epoxy_glEnd(void)
epoxy_glEnd_unwrapped(); epoxy_glEnd_unwrapped();
#ifdef _WIN32 #ifdef _WIN32
#warning missing locking InterlockedDecrement(&api.begin_count);
#else #else
pthread_mutex_lock(&api.mutex); pthread_mutex_lock(&api.mutex);
api.begin_count--; api.begin_count--;

Loading…
Cancel
Save