if test x"$enable_dri3" = xyes; then
dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
fi
+ fi
+ if test x"$dri_platform" = xapple ; then
+ DEFINES="$DEFINES -DGLX_USE_APPLEGL"
+ fi
fi
# add xf86vidmode if available
src/gbm/main/gbm.pc
src/glsl/Makefile
src/glx/Makefile
+ src/glx/apple/Makefile
src/glx/tests/Makefile
src/gtest/Makefile
src/loader/Makefile
SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
endif
-SUBDIRS=. tests
+SUBDIRS =
if HAVE_XF86VIDMODE
EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
glx_query.c \
glxhash.c
+libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la
+
if HAVE_DRISW
libglx_la_SOURCES += \
drisw_glx.c
if HAVE_APPLEDRI
libglx_la_SOURCES += \
applegl_glx.c
-endif
-libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la
+SUBDIRS += apple
+libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
+endif
GL_LIBS = \
libglx.la \
lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
+SUBDIRS += . tests
+
include $(top_srcdir)/install-lib-links.mk
+++ /dev/null
-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
--- /dev/null
+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
#include <GL/gl.h>
+#include "main/glheader.h"
#include "glapi.h"
#include "glapitable.h"
#include "main/dispatch.h"
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)
{
#include <stdbool.h>
#include <GL/gl.h>
-#include <GL/glxint.h>
#include <X11/Xlib.h>
#define XP_NO_X_HEADERS
#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;
#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;
break;
}
- __ogl_framework_api->DrawBuffersARB(n, buf);
+ __ogl_framework_api->DrawBuffers(n, buf);
}
else {
__ogl_framework_api->DrawBuffer(mode);
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);
}
}
#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;
+++ /dev/null
-/*
- * (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;
-}
#include <dlfcn.h>
#include "glxclient.h"
-#include "apple_glx_context.h"
-#include "apple_glx.h"
-#include "apple_cgl.h"
+#include "apple/apple_glx_context.h"
+#include "apple/apple_glx.h"
+#include "apple/apple_cgl.h"
#include "glx_error.h"
static void
#ifdef GLX_USE_APPLEGL
#include <pthread.h>
-#include "apple_glx_drawable.h"
+#include "apple/apple_glx_drawable.h"
#endif
#include "glx_error.h"
#ifdef GLX_DIRECT_RENDERING
#ifdef GLX_USE_APPLEGL
-#include "apple_glx_context.h"
-#include "apple_glx.h"
+#include "apple/apple_glx_context.h"
+#include "apple/apple_glx.h"
#else
#include <sys/time.h>
#ifdef XF86VIDMODE
#endif
#include "glxclient.h"
-#ifdef GLX_USE_APPLEGL
-#include <stdlib.h>
-
-#include "apple_glx.h"
-#include "apple_glx_context.h"
-#endif
#include "glapi.h"
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#ifdef GLX_USE_APPLEGL
-#include "apple_glx.h"
-#include "apple_visual.h"
+#include "apple/apple_glx.h"
+#include "apple/apple_visual.h"
#endif
#include "glxextensions.h"
#include "glapi.h"
#include "glxclient.h"
+#ifndef GLX_USE_APPLEGL
+
extern struct _glapi_table *__glXNewIndirectAPI(void);
/*
return psc;
}
+
+#endif
* Silicon Graphics, Inc.
*/
+#ifndef GLX_USE_APPLEGL
+
#include "packrender.h"
#include "indirect.h"
#include "indirect_size.h"
__GLX_PUT_LONG(4, cap);
__GLX_END(8);
}
+
+#endif
#include "indirect.h"
#include "indirect_vertex_array.h"
+#ifndef GLX_USE_APPLEGL
/*****************************************************************************/
trueStride,
(const char *) pointer + offsets[3]);
}
+
+#endif
AM_CPPFLAGS += \
-DMAPI_MODE_BRIDGE \
-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
-glapi_GLAPI_sources =
+glapi_GLAPI_sources = $(GLAPI_UTIL_SOURCES)
glapi_ASM_sources =
glapi_MAPI_sources = $(MAPI_BRIDGE_FILES)
else
AM_CPPFLAGS += \
-DMAPI_MODE_UTIL
-glapi_GLAPI_sources = $(GLAPI_SOURCES)
+glapi_GLAPI_sources = $(GLAPI_SOURCES) $(GLAPI_UTIL_SOURCES)
glapi_ASM_sources = $(GLAPI_ASM_SOURCES)
glapi_MAPI_sources = $(MAPI_UTIL_FILES)
endif
# src/mapi/glapi/Makefile.sources
+GLAPI_UTIL_SOURCES = \
+ glapi_gentable.c
+
GLAPI_SOURCES = \
glapi_dispatch.c \
glapi_entrypoint.c \
- glapi_gentable.c \
glapi_getproc.c \
glapi_nop.c \
glapi.c \
#include "glapi.h"
#include <assert.h>
+#ifndef GLX_USE_APPLEGL
/**
* No-op function used to initialize functions that have no GLX protocol
print """
return (struct _glapi_table *) table;
}
+
+#endif
"""
return