1 /**************************************************************************
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
5 * Copyright 2010 LunarG, Inc.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sub license, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
16 * The above copyright notice and this permission notice (including the
17 * next paragraph) shall be included in all copies or substantial portions
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
28 **************************************************************************/
31 #ifndef EGLSCREEN_INCLUDED
32 #define EGLSCREEN_INCLUDED
35 #include "egltypedefs.h"
38 #ifdef EGL_MESA_screen_surface
41 #define _EGL_SCREEN_MAX_MODES 16
45 * Per-screen information.
46 * Note that an EGL screen doesn't have a size. A screen may be set to
47 * one of several display modes (width/height/scanrate). The screen
48 * then displays a drawing surface. The drawing surface must be at least
49 * as large as the display mode's resolution. If it's larger, the
50 * OriginX and OriginY fields control what part of the surface is visible
57 EGLScreenMESA Handle
; /* The public/opaque handle which names this object */
59 _EGLMode
*CurrentMode
;
60 _EGLSurface
*CurrentSurface
;
62 EGLint OriginX
, OriginY
; /**< Origin of scan-out region w.r.t. surface */
63 EGLint StepX
, StepY
; /**< Screen position/origin granularity */
66 _EGLMode
*Modes
; /**< array [NumModes] */
71 _eglInitScreen(_EGLScreen
*screen
, _EGLDisplay
*dpy
, EGLint num_modes
);
75 _eglLinkScreen(_EGLScreen
*screen
);
79 _eglLookupScreen(EGLScreenMESA screen
, _EGLDisplay
*dpy
);
83 * Return the handle of a linked screen.
85 static INLINE EGLScreenMESA
86 _eglGetScreenHandle(_EGLScreen
*screen
)
88 return (screen
) ? screen
->Handle
: (EGLScreenMESA
) 0;
93 _eglGetScreensMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLScreenMESA
*screens
, EGLint max_screens
, EGLint
*num_screens
);
97 _eglScreenPositionMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*scrn
, EGLint x
, EGLint y
);
101 _eglQueryScreenSurfaceMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
102 _EGLScreen
*scrn
, _EGLSurface
**surface
);
106 _eglQueryScreenModeMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*scrn
, _EGLMode
**m
);
110 _eglQueryScreenMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*scrn
, EGLint attribute
, EGLint
*value
);
113 #endif /* EGL_MESA_screen_surface */
116 #endif /* EGLSCREEN_INCLUDED */