mesa: shrink gl_vertex_array
[mesa.git] / src / glx / apple / apple_glx_pbuffer.c
index 2817cda23b7b445af4f1979c23f5998607370115..8c94d2010f41182d615b0e0df146fc266b0fc68a 100644 (file)
 #include "apple_glx_context.h"
 #include "apple_glx_drawable.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <pthread.h>
 #include <assert.h>
 #include "apple_glx.h"
 #include "glxconfig.h"
 #include "apple_cgl.h"
+#include "util/debug.h"
 
 /* mesa defines in glew.h, Apple in glext.h.
  * Due to namespace nightmares, just do it here.
@@ -84,8 +86,7 @@ pbuffer_make_current(struct apple_glx_context *ac,
    }
 
    if (!ac->made_current) {
-      glViewport(0, 0, pbuf->width, pbuf->height);
-      glScissor(0, 0, pbuf->width, pbuf->height);
+      apple_glapi_oglfw_viewport_scissor(0, 0, pbuf->width, pbuf->height);
       ac->made_current = true;
    }
 
@@ -209,7 +210,7 @@ get_max_size(int *widthresult, int *heightresult)
 
       err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
       if (kCGLNoError != err) {
-         if (getenv("LIBGL_DIAGNOSTIC")) {
+         if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
             printf("choose_pixel_format error in %s: %s\n", __func__,
                    apple_cgl.error_string(err));
          }
@@ -221,7 +222,7 @@ get_max_size(int *widthresult, int *heightresult)
       err = apple_cgl.create_context(pfobj, NULL, &newcontext);
 
       if (kCGLNoError != err) {
-         if (getenv("LIBGL_DIAGNOSTIC")) {
+         if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
             printf("create_context error in %s: %s\n", __func__,
                    apple_cgl.error_string(err));
          }