| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/GL/internal/dri_interface.h
Go to the documentation of this file.

    00001 /*
    00002  * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
    00003  * (C) Copyright IBM Corporation 2004
    00004  * All Rights Reserved.
    00005  *
    00006  * Permission is hereby granted, free of charge, to any person obtaining a
    00007  * copy of this software and associated documentation files (the "Software"),
    00008  * to deal in the Software without restriction, including without limitation
    00009  * on the rights to use, copy, modify, merge, publish, distribute, sub
    00010  * license, and/or sell copies of the Software, and to permit persons to whom
    00011  * the Software is furnished to do so, subject to the following conditions:
    00012  *
    00013  * The above copyright notice and this permission notice (including the next
    00014  * paragraph) shall be included in all copies or substantial portions of the
    00015  * Software.
    00016  *
    00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00018  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00019  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
    00020  * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
    00021  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
    00022  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
    00023  * USE OR OTHER DEALINGS IN THE SOFTWARE.
    00024  */
    00025
    00038 #ifndef DRI_INTERFACE_H
    00039 #define DRI_INTERFACE_H
    00040
    00041 #include <GL/internal/glcore.h>
    00042 #include <drm.h>
    00043
    00051 typedef struct __DRIdisplayRec  __DRIdisplay;
    00052 typedef struct __DRIscreenRec   __DRIscreen;
    00053 typedef struct __DRIcontextRec  __DRIcontext;
    00054 typedef struct __DRIdrawableRec __DRIdrawable;
    00055 typedef struct __DRIdriverRec   __DRIdriver;
    00056 typedef struct __DRIframebufferRec __DRIframebuffer;
    00057 typedef struct __DRIversionRec     __DRIversion;
    00058 typedef struct __DRIinterfaceMethodsRec  __DRIinterfaceMethods;
    00059 typedef unsigned long __DRIid;
    00060 typedef void __DRInativeDisplay;
    00076 typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
    00077
    00085 typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
    00086
    00092 typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
    00100
    00101 typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
    00102     __DRIscreen *psc, const __GLcontextModes * modes,
    00103     const __DRIversion * ddx_version, const __DRIversion * dri_version,
    00104     const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
    00105     void * pSAREA, int fd, int internal_api_version,
    00106     const __DRIinterfaceMethods * interface,
    00107     __GLcontextModes ** driver_modes);
    00108 typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
    00109 extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
    00110
    00111
    00116 extern const char __driConfigOptions[];
    00117
    00130 struct __DRIversionRec {
    00131     int    major;
    00132     int    minor;
    00133     int    patch;
    00134 };
    00135
    00136
    00137 typedef void (*__DRIfuncPtr)(void);
    00138
    00139 struct __DRIinterfaceMethodsRec {
    00143     __DRIfuncPtr (*getProcAddress)( const char * proc_name );
    00144
    00148     __GLcontextModes * (*createContextModes)(unsigned count,
    00149         size_t minimum_bytes_per_struct);
    00150
    00157     void (*destroyContextModes)( __GLcontextModes * modes );
    00158
    00162     __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
    00163
    00164
    00182     GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
    00183
    00187     GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
    00188         int configID, void * contextID, drm_context_t * hw_context );
    00189
    00193     GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
    00194         __DRIid context );
    00195
    00199     GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
    00200         __DRIid drawable, drm_drawable_t * hHWDrawable );
    00201
    00205     GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
    00206         __DRIid drawable );
    00207
    00212     GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
    00213         __DRIid draw, unsigned int * index, unsigned int * stamp,
    00214         int * x, int * y, int * width, int * height,
    00215         int * numClipRects, drm_clip_rect_t ** pClipRects,
    00216         int * backX, int * backY,
    00217         int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
    00228     int (*getUST)(int64_t * ust);
    00229
    00237     GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
    00238         int32_t * numerator, int32_t * denominator);
    00240 };
    00241
    00242
    00255 struct __DRIframebufferRec {
    00256     unsigned char *base;
    00262     int size;
    00263     int stride;
    00264     int width;
    00265     int height;
    00266     int dev_priv_size;
    00267     void *dev_priv;
    00268 };
    00269
    00270
    00275 struct __DRIscreenRec {
    00279     void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
    00280
    00285     void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
    00286                                         __DRIid draw, __DRIdrawable *pdraw,
    00287                                         int renderType, const int *attrs);
    00288
    00292     __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw,
    00293                                               void *drawablePrivate);
    00294
    00300     void *private;
    00301
    00308     int (*getMSC)( void *screenPrivate, int64_t *msc );
    00309
    00318     void *screenConfigs;
    00319
    00326     void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
    00327                                      GLfloat readfreq, GLfloat writefreq,
    00328                                      GLfloat priority);
    00329
    00330     void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
    00331
    00332     GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
    00341     void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
    00342                                         int render_type,
    00343                                         void *sharedPrivate, __DRIcontext *pctx);
    00344 };
    00345
    00350 struct __DRIcontextRec {
    00354     void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
    00355
    00361     void *private;
    00362
    00368     const __GLcontextModes * mode;
    00369
    00375     GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
    00376                                   __DRIid read, __DRIcontext *ctx);
    00377
    00383     GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
    00384                                     __DRIid read, __DRIcontext *ctx);
    00385 };
    00386
    00393 struct __DRIdrawableRec {
    00397     void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
    00398
    00402     void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
    00403
    00409     void *private;
    00410
    00416     int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
    00417
    00423     int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
    00424                              int64_t target_sbc,
    00425                              int64_t * msc, int64_t * sbc );
    00426
    00435     int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
    00436                              int64_t target_msc, int64_t divisor, int64_t remainder,
    00437                              int64_t * msc, int64_t * sbc );
    00438
    00448     int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
    00449                                        int64_t target_msc,
    00450                                        int64_t divisor, int64_t remainder);
    00451
    00457     int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable);
    00458
    00464     int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
    00465                                        int64_t * sbc, int64_t * missedFrames,
    00466                                        float * lastMissedUsage, float * usage );
    00467
    00474     unsigned swap_interval;
    00475 };
    00476
    00477 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines