summaryrefslogtreecommitdiffstats
path: root/src/glx/apple
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/apple')
-rw-r--r--src/glx/apple/Makefile131
-rw-r--r--src/glx/apple/Makefile.am33
-rw-r--r--src/glx/apple/apple_glapi.c1
-rw-r--r--src/glx/apple/apple_glx.c2
-rw-r--r--src/glx/apple/apple_glx.h1
-rw-r--r--src/glx/apple/apple_xgl_api_read.c1
-rw-r--r--src/glx/apple/apple_xgl_api_stereo.c7
-rw-r--r--src/glx/apple/apple_xgl_api_viewport.c1
-rw-r--r--src/glx/apple/glxreply.c134
9 files changed, 40 insertions, 271 deletions
diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
deleted file mode 100644
index 91a72189253..00000000000
--- a/src/glx/apple/Makefile
+++ /dev/null
@@ -1,131 +0,0 @@
-TOP = ../../..
-top_builddir = $(TOP)
-# This can be a filthy lie. But it doesn't currently build out-of-tree
-# anyway, so it's no worse than what we've got now.
-top_srcdir = $(TOP)
-
-include $(TOP)/configs/current
-
-#CC=gcc
-#GL_CFLAGS=-Wall -ggdb3 -Os -DHAVE_PTHREAD -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
-#GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
-
-TCLSH=tclsh8.5
-MKDIR=mkdir
-INSTALL=install
-LN=ln
-RM=rm
-
-#INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
-
-#COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
-
-#The directory with the final binaries.
-BUILD_DIR=builds
-
-default: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
-
-SOURCES = \
- apple_cgl.c \
- apple_glx.c \
- apple_glx_context.c \
- apple_glx_drawable.c \
- apple_glx_log.c \
- apple_glx_pbuffer.c \
- apple_glx_pixmap.c \
- apple_glx_surface.c \
- apple_visual.c \
- apple_glapi.c \
- apple_xgl_api_read.c \
- apple_xgl_api_stereo.c \
- apple_xgl_api_viewport.c \
- appledri.c \
- ../create_context.c \
- ../clientattrib.c \
- ../compsize.c \
- ../glxconfig.c \
- glx_empty.c \
- ../glx_error.c \
- ../glx_pbuffer.c \
- ../glx_query.c \
- ../glxcmds.c \
- ../glxcurrent.c \
- ../glxext.c \
- ../glxextensions.c \
- ../glxhash.c \
- glxreply.c \
- ../pixel.c \
- ../xfont.c \
- ../applegl_glx.c
-
-include $(TOP)/src/mesa/Makefile.sources
-
-# override GLAPI_LIB
-GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
-
-LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation
-
-OBJECTS = $(SOURCES:.c=.o)
-
-INCLUDES = -I. -Iinclude -I..\
- -I$(TOP)/include \
- -I$(TOP)/include/GL/internal \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mapi \
- -I$(TOP)/src/mapi/glapi \
- $(LIBDRM_CFLAGS) \
- $(DRI2PROTO_CFLAGS) \
- $(X11_INCLUDES)
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
-
-##### TARGETS #####
-
-default: depend $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
-
-# Make libGL
-$(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT): $(OBJECTS) $(GLAPI_LIB) Makefile
- $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major 1 -minor 2 $(MKLIB_OPTIONS) \
- -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
- $(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB)
-
-$(GLAPI_LIB):
- @$(MAKE) -C $(TOP)/src/mapi/glapi
-
-depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile
- rm -f depend
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \
- $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES)
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find $(TOP)/include`
-
-install_headers: include/GL/gl.h
- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
- $(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL
-
-install_libraries: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
- $(MAKE) -C $(TOP)/src/mesa install-libgl
-
-install: install_libraries
-
-# Remove .o and backup files
-clean:
- -rm -f *.o *.a *~
- -rm -f *.c~ *.h~
- -rm -f *.dylib
- -rm -f include/GL/gl.h
- -rm -f *.o *~
- -rm -f depend depend.bak
-
--include depend
diff --git a/src/glx/apple/Makefile.am b/src/glx/apple/Makefile.am
new file mode 100644
index 00000000000..894ab5b3c78
--- /dev/null
+++ b/src/glx/apple/Makefile.am
@@ -0,0 +1,33 @@
+noinst_LTLIBRARIES = libappleglx.la
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/glx \
+ -I$(top_srcdir)/src/mesa \
+ -I$(top_builddir)/src/mesa \
+ -I$(top_srcdir)/src/mapi \
+ -I$(top_srcdir)/src/mapi/glapi \
+ -I$(top_builddir)/src/mapi/glapi \
+ $(VISIBILITY_CFLAGS) \
+ $(SHARED_GLAPI_CFLAGS) \
+ $(DEFINES) \
+ $(X11_INCLUDES)
+
+libappleglx_la_SOURCES = \
+ apple_cgl.c \
+ apple_glapi.c \
+ apple_glx.c \
+ apple_glx_context.c \
+ apple_glx_drawable.c \
+ apple_glx_log.c \
+ apple_glx_pbuffer.c \
+ apple_glx_pixmap.c \
+ apple_glx_surface.c \
+ apple_visual.c \
+ apple_xgl_api_read.c \
+ apple_xgl_api_stereo.c \
+ apple_xgl_api_viewport.c \
+ appledri.c \
+ glx_empty.c
+
+libappleglx_la_LDFLAGS = -lXplugin -framework ApplicationServices -framework CoreFoundation
diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c
index c9327814d98..4d19f7f6a3e 100644
--- a/src/glx/apple/apple_glapi.c
+++ b/src/glx/apple/apple_glapi.c
@@ -38,6 +38,7 @@
#include <GL/gl.h>
+#include "main/glheader.h"
#include "glapi.h"
#include "glapitable.h"
#include "main/dispatch.h"
diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c
index 4e2aa33e59f..3b570882572 100644
--- a/src/glx/apple/apple_glx.c
+++ b/src/glx/apple/apple_glx.c
@@ -43,8 +43,6 @@
static bool initialized = false;
static int dri_event_base = 0;
-const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
int
apple_get_dri_event_base(void)
{
diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h
index 0967f1812a0..7d94f8873db 100644
--- a/src/glx/apple/apple_glx.h
+++ b/src/glx/apple/apple_glx.h
@@ -32,7 +32,6 @@
#include <stdbool.h>
#include <GL/gl.h>
-#include <GL/glxint.h>
#include <X11/Xlib.h>
#define XP_NO_X_HEADERS
diff --git a/src/glx/apple/apple_xgl_api_read.c b/src/glx/apple/apple_xgl_api_read.c
index 612f5f7b01f..4a9a20d3477 100644
--- a/src/glx/apple/apple_xgl_api_read.c
+++ b/src/glx/apple/apple_xgl_api_read.c
@@ -37,6 +37,7 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
+#include "main/glheader.h"
#include "glapitable.h"
extern struct _glapi_table * __ogl_framework_api;
diff --git a/src/glx/apple/apple_xgl_api_stereo.c b/src/glx/apple/apple_xgl_api_stereo.c
index c9ed684b279..4b21aaf79ef 100644
--- a/src/glx/apple/apple_xgl_api_stereo.c
+++ b/src/glx/apple/apple_xgl_api_stereo.c
@@ -40,6 +40,7 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
+#include "main/glheader.h"
#include "glapitable.h"
extern struct _glapi_table * __ogl_framework_api;
@@ -75,7 +76,7 @@ __applegl_glDrawBuffer(GLenum mode)
break;
}
- __ogl_framework_api->DrawBuffersARB(n, buf);
+ __ogl_framework_api->DrawBuffers(n, buf);
}
else {
__ogl_framework_api->DrawBuffer(mode);
@@ -116,9 +117,9 @@ __applegl_glDrawBuffers(GLsizei n, const GLenum * bufs)
newbuf[outi++] = GL_FRONT_RIGHT;
}
- __ogl_framework_api->DrawBuffersARB(outi, newbuf);
+ __ogl_framework_api->DrawBuffers(outi, newbuf);
}
else {
- __ogl_framework_api->DrawBuffersARB(n, bufs);
+ __ogl_framework_api->DrawBuffers(n, bufs);
}
}
diff --git a/src/glx/apple/apple_xgl_api_viewport.c b/src/glx/apple/apple_xgl_api_viewport.c
index 8f914b425f2..281c90c6bbd 100644
--- a/src/glx/apple/apple_xgl_api_viewport.c
+++ b/src/glx/apple/apple_xgl_api_viewport.c
@@ -30,6 +30,7 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
+#include "main/glheader.h"
#include "glapitable.h"
extern struct _glapi_table * __ogl_framework_api;
diff --git a/src/glx/apple/glxreply.c b/src/glx/apple/glxreply.c
deleted file mode 100644
index 240caa738f9..00000000000
--- a/src/glx/apple/glxreply.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * (C) Copyright Apple Inc. 2008
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <GL/gl.h>
-#include "glxclient.h"
-#include <GL/glxproto.h>
-
-CARD32
-__glXReadReply(Display * dpy, size_t size, void *dest,
- GLboolean reply_is_always_array)
-{
- xGLXSingleReply reply;
-
- (void) _XReply(dpy, (xReply *) & reply, 0, False);
- if (size != 0) {
- if ((reply.length > 0) || reply_is_always_array) {
- const GLint bytes = (reply_is_always_array)
- ? (4 * reply.length) : (reply.size * size);
- const GLint extra = 4 - (bytes & 3);
-
- _XRead(dpy, dest, bytes);
- if (extra < 4) {
- _XEatData(dpy, extra);
- }
- }
- else {
- (void) memcpy(dest, &(reply.pad3), size);
- }
- }
-
- return reply.retval;
-}
-
-void
-__glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim,
- GLint width, GLint height, GLint depth, GLenum format,
- GLenum type, void *dest, GLboolean dimensions_in_reply)
-{
- xGLXSingleReply reply;
- GLint size;
-
- (void) _XReply(dpy, (xReply *) & reply, 0, False);
-
- if (dimensions_in_reply) {
- width = reply.pad3;
- height = reply.pad4;
- depth = reply.pad5;
-
- if ((height == 0) || (max_dim < 2)) {
- height = 1;
- }
- if ((depth == 0) || (max_dim < 3)) {
- depth = 1;
- }
- }
-
- size = reply.length * 4;
- if (size != 0) {
- void *buf = malloc(size);
-
- if (buf == NULL) {
- _XEatData(dpy, size);
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- }
- else {
- const GLint extra = 4 - (size & 3);
-
- _XRead(dpy, buf, size);
- if (extra < 4) {
- _XEatData(dpy, extra);
- }
-
- __glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest);
- free(buf);
- }
- }
-}
-
-#if 0
-GLubyte *
-__glXSetupSingleRequest(struct glx_context * gc, GLint sop, GLint cmdlen)
-{
- xGLXSingleReq *req;
- Display *const dpy = gc->currentDpy;
-
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- LockDisplay(dpy);
- GetReqExtra(GLXSingle, cmdlen, req);
- req->reqType = gc->majorOpcode;
- req->contextTag = gc->currentContextTag;
- req->glxCode = sop;
- return (GLubyte *) (req) + sz_xGLXSingleReq;
-}
-#endif
-
-GLubyte *
-__glXSetupVendorRequest(struct glx_context * gc, GLint code, GLint vop,
- GLint cmdlen)
-{
- xGLXVendorPrivateReq *req;
- Display *const dpy = gc->currentDpy;
-
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivate, cmdlen, req);
- req->reqType = gc->majorOpcode;
- req->glxCode = code;
- req->vendorCode = vop;
- req->contextTag = gc->currentContextTag;
- return (GLubyte *) (req) + sz_xGLXVendorPrivateReq;
-}