/* * Copyright © 2008, 2009 Kristian Høgsberg * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of the copyright holders not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holders make no representations * about the suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _EAGLE_INTERNAL_H_ #define _EAGLE_INTERNAL_H_ /* GCC visibility */ #if defined(__GNUC__) && __GNUC__ >= 4 #define EAGLE_EXPORT __attribute__ ((visibility("default"))) #else #define EAGLE_EXPORT #endif #include #include #include #include #include #include "eagle.h" struct EGLDisplay { int next_surface_id; EGLBoolean initialized; int fd; const char *driverName; EGLConfig configs; int numConfigs; __DRIscreen *driScreen; void *driver; __DRIcoreExtension *core; __DRIdri2Extension *dri2; __DRIswapControlExtension *swapControl; __DRItexBufferExtension *texBuffer; int width, height; __DRI2flushExtension *flush; const struct EagleBackend *backend; }; struct EGLSurface { EGLDisplay display; uint32_t id; __DRIdrawable *driDrawable; uint32_t bufferWidth, bufferHeight; __DRIbuffer buffers[10]; int count; int depth; int width; int height; }; struct EGLContext { EGLDisplay display; __DRIcontext *driContext; EGLConfig config; EGLSurface drawSurface; EGLSurface readSurface; unsigned int id; }; struct EGLConfig { const __DRIconfig *driConfig; unsigned int id; }; /* This is somewhat arbitrary... */ struct EagleBackend { void (*getBuffers)(EGLSurface surface, uint32_t *attachments, int count); EGLBoolean (*destroySurface)(EGLDisplay display, EGLSurface surface); }; int eglInitDisplay(EGLDisplay display, const char *path, const char *driver); void eglInitSurface(EGLSurface surface, EGLDisplay display, EGLConfig fbconfig, int width, int height); EGLDisplay i915CreateDisplay(struct udev_device *device); EGLDisplay i965CreateDisplay(struct udev_device *device); EGLDisplay r300CreateDisplay(struct udev_device *device); #endif