1 /**************************************************************************
3 * Copyright 2008 VMware, Inc.
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
34 #include "c99_compat.h"
36 #include "egltypedefs.h"
39 #ifdef EGL_MESA_screen_surface
42 #define _EGL_SCREEN_MAX_MODES 16
46 * Per-screen information.
47 * Note that an EGL screen doesn't have a size. A screen may be set to
48 * one of several display modes (width/height/scanrate). The screen
49 * then displays a drawing surface. The drawing surface must be at least
50 * as large as the display mode's resolution. If it's larger, the
51 * OriginX and OriginY fields control what part of the surface is visible
58 EGLScreenMESA Handle
; /* The public/opaque handle which names this object */
60 _EGLMode
*CurrentMode
;
61 _EGLSurface
*CurrentSurface
;
63 EGLint OriginX
, OriginY
; /**< Origin of scan-out region w.r.t. surface */
64 EGLint StepX
, StepY
; /**< Screen position/origin granularity */
67 _EGLMode
*Modes
; /**< array [NumModes] */
72 _eglInitScreen(_EGLScreen
*screen
, _EGLDisplay
*dpy
, EGLint num_modes
);
76 _eglLinkScreen(_EGLScreen
*screen
);
80 _eglLookupScreen(EGLScreenMESA screen
, _EGLDisplay
*dpy
);
84 * Return the handle of a linked screen.
86 static inline EGLScreenMESA
87 _eglGetScreenHandle(_EGLScreen
*screen
)
89 return (screen
) ? screen
->Handle
: (EGLScreenMESA
) 0;
94 _eglGetScreensMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLScreenMESA
*screens
, EGLint max_screens
, EGLint
*num_screens
);
98 _eglScreenPositionMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*scrn
, EGLint x
, EGLint y
);
102 _eglQueryScreenSurfaceMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
103 _EGLScreen
*scrn
, _EGLSurface
**surface
);
107 _eglQueryScreenModeMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*scrn
, _EGLMode
**m
);
111 _eglQueryScreenMESA(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLScreen
*scrn
, EGLint attribute
, EGLint
*value
);
114 #endif /* EGL_MESA_screen_surface */
117 #endif /* EGLSCREEN_INCLUDED */