_EGLScreen *scrn;
EGLint i;
- disp->NumScreens = 1;
- disp->Screens = (_EGLScreen *) calloc(disp->NumScreens, sizeof(_EGLScreen));
- scrn = disp->Screens + 0;
- scrn->NumModes = 4;
- scrn->Modes = (_EGLMode *) calloc(scrn->NumModes, sizeof(_EGLMode));
- scrn->Modes[0].Width = 1600;
- scrn->Modes[0].Height = 1200;
- scrn->Modes[0].Depth = 32;
- scrn->Modes[0].RefreshRate = 72 * 1000;
- scrn->Modes[1].Width = 1280;
- scrn->Modes[1].Height = 1024;
- scrn->Modes[1].Depth = 32;
- scrn->Modes[1].RefreshRate = 72 * 1000;
- scrn->Modes[2].Width = 1280;
- scrn->Modes[2].Height = 1024;
- scrn->Modes[2].Depth = 16;
- scrn->Modes[2].RefreshRate = 72 * 1000;
- scrn->Modes[3].Width = 1024;
- scrn->Modes[3].Height = 768;
- scrn->Modes[3].Depth = 16;
- scrn->Modes[3].RefreshRate = 72 * 1000;
- for (i = 0; i < scrn->NumModes; i++)
- scrn->Modes[i].Handle = i + 1;
-
- /* Create list of visual configs - this is a silly example */
- disp->NumConfigs = 4;
- disp->Configs = (_EGLConfig *) calloc(disp->NumConfigs, sizeof(_EGLConfig));
- for (i = 0; i < disp->NumConfigs; i++) {
- _EGLConfig *config = disp->Configs + i;
- _eglInitConfig(config, i + 1);
- SET_CONFIG_ATTRIB(config, EGL_RED_SIZE, 8);
- SET_CONFIG_ATTRIB(config, EGL_GREEN_SIZE, 8);
- SET_CONFIG_ATTRIB(config, EGL_BLUE_SIZE, 8);
- SET_CONFIG_ATTRIB(config, EGL_ALPHA_SIZE, 8);
- SET_CONFIG_ATTRIB(config, EGL_BUFFER_SIZE, 32);
-
+ /* Create a screen */
+ scrn = _eglNewScreen();
+ _eglAddScreen(disp, scrn);
+
+ /* Create the screen's modes - silly example */
+ _eglAddMode(scrn, 1600, 1200, 32, 72 * 1000);
+ _eglAddMode(scrn, 1280, 1024, 32, 72 * 1000);
+ _eglAddMode(scrn, 1280, 1024, 16, 72 * 1000);
+ _eglAddMode(scrn, 1024, 768, 32, 72 * 1000);
+
+ /* Create the display's visual configs - silly example */
+ for (i = 0; i < 4; i++) {
+ _EGLConfig config;
+ _eglInitConfig(&config, i + 1);
+ SET_CONFIG_ATTRIB(&config, EGL_RED_SIZE, 8);
+ SET_CONFIG_ATTRIB(&config, EGL_GREEN_SIZE, 8);
+ SET_CONFIG_ATTRIB(&config, EGL_BLUE_SIZE, 8);
+ SET_CONFIG_ATTRIB(&config, EGL_ALPHA_SIZE, 8);
+ SET_CONFIG_ATTRIB(&config, EGL_BUFFER_SIZE, 32);
if (i & 1) {
- SET_CONFIG_ATTRIB(config, EGL_DEPTH_SIZE, 32);
+ SET_CONFIG_ATTRIB(&config, EGL_DEPTH_SIZE, 32);
}
if (i & 2) {
- SET_CONFIG_ATTRIB(config, EGL_STENCIL_SIZE, 8);
+ SET_CONFIG_ATTRIB(&config, EGL_STENCIL_SIZE, 8);
}
-
- SET_CONFIG_ATTRIB(config, EGL_SURFACE_TYPE,
+ SET_CONFIG_ATTRIB(&config, EGL_SURFACE_TYPE,
(EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT));
+ _eglAddConfig(disp, &config);
}
drv->Initialized = EGL_TRUE;
*/
EGLBoolean APIENTRY
-eglChooseModeMESA(EGLDisplay dpy, EGLint screen_number,
+eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen,
const EGLint *attrib_list, EGLModeMESA *modes,
EGLint modes_size, EGLint *num_modes)
{
_EGLDriver *drv = _eglLookupDriver(dpy);
if (drv)
- return drv->ChooseModeMESA(drv, dpy, screen_number, attrib_list, modes, modes_size, num_modes);
+ return drv->ChooseModeMESA(drv, dpy, screen, attrib_list, modes, modes_size, num_modes);
else
return EGL_FALSE;
}
EGLBoolean APIENTRY
-eglGetModesMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode)
+eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode)
{
_EGLDriver *drv = _eglLookupDriver(dpy);
if (drv)
- return drv->GetModesMESA(drv, dpy, screen_number, modes, mode_size, num_mode);
+ return drv->GetModesMESA(drv, dpy, screen, modes, mode_size, num_mode);
else
return EGL_FALSE;
}
}
-EGLSurface
-eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
-{
- return EGL_FALSE;
-}
-
-
EGLBoolean
-eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface)
+eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens)
{
- return EGL_FALSE;
-}
-
-
-EGLBoolean
-eglScreenModeMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA mode)
-{
- return EGL_FALSE;
+ _EGLDriver *drv = _eglLookupDriver(dpy);
+ if (drv)
+ return drv->GetScreensMESA(drv, dpy, screens, max_screens, num_screens);
+ else
+ return EGL_FALSE;
}
-EGLBoolean
-eglScreenAttribsMESA(EGLDisplay dpy, EGLint screen, const EGLint *attrib_list)
+EGLSurface
+eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
{
return EGL_FALSE;
}
EGLBoolean
-eglQueryDisplayMESA(EGLDisplay dpy, EGLint attribute, EGLint *value)
+eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface)
{
return EGL_FALSE;
}
EGLBoolean
-eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLint screen_number, EGLSurface *surface)
+eglScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA mode)
{
return EGL_FALSE;
}
EGLBoolean
-eglQueryScreenModeMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA *mode)
+eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface)
{
return EGL_FALSE;
}
EGLBoolean
-eglQueryScreenMESA( EGLDisplay dpy, EGLint screen_number, EGLint attribute, EGLint *value)
+eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value)
{
return EGL_FALSE;
}
+#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "eglconfig.h"
}
+/**
+ * Add the given _EGLConifg to the given display.
+ */
+_EGLConfig *
+_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config)
+{
+ _EGLConfig *newConfigs;
+ EGLint n;
+
+ n = display->NumConfigs;
+
+ newConfigs = (_EGLConfig *) realloc(display->Configs,
+ (n + 1) * sizeof(_EGLConfig));
+ if (newConfigs) {
+ display->Configs = newConfigs;
+ display->Configs[n] = *config; /* copy struct */
+ display->NumConfigs++;
+ return display->Configs + n;
+ }
+ else {
+ return NULL;
+ }
+}
+
+
/**
* Parse the attrib_list to fill in the fields of the given _egl_config
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config);
+extern _EGLConfig *
+_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config);
+
+
extern EGLBoolean
_eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list);
_EGLDriver *Driver;
EGLint NumScreens;
- _EGLScreen *Screens; /* array [NumScreens] */
+ _EGLScreen **Screens; /* array [NumScreens] */
EGLint NumConfigs;
_EGLConfig *Configs; /* array [NumConfigs] */
#include "egldriver.h"
#include "eglglobals.h"
#include "eglmode.h"
+#include "eglscreen.h"
#include "eglsurface.h"
drv->WaitNative = _eglWaitNative;
/* EGL_MESA_screen */
+ drv->ChooseModeMESA = _eglChooseModeMESA;
drv->GetModesMESA = _eglGetModesMESA;
drv->GetModeAttribMESA = _eglGetModeAttribMESA;
+ drv->GetScreensMESA = _eglGetScreensMESA;
+ drv->CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA;
+ drv->ShowSurfaceMESA = _eglShowSurfaceMESA;
+ drv->ScreenPositionMESA = _eglScreenPositionMESA;
+ drv->QueryScreenMESA = _eglQueryScreenMESA;
+ drv->QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
+ drv->QueryScreenModeMESA = _eglQueryScreenModeMESA;
}
/* EGL_MESA_screen extension */
-typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
-typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
+typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
+typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
-
+typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
+typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
+typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface);
+typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
+typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
+typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
+typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
ChooseModeMESA_t ChooseModeMESA;
GetModesMESA_t GetModesMESA;
GetModeAttribMESA_t GetModeAttribMESA;
+ GetScreensMESA_t GetScreensMESA;
+ CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA;
+ ShowSurfaceMESA_t ShowSurfaceMESA;
+ ScreenPositionMESA_t ScreenPositionMESA;
+ QueryScreenMESA_t QueryScreenMESA;
+ QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
+ QueryScreenModeMESA_t QueryScreenModeMESA;
};
_eglGlobal.Displays = _eglNewHashTable();
_eglGlobal.Contexts = _eglNewHashTable();
_eglGlobal.Surfaces = _eglNewHashTable();
+ _eglGlobal.FreeScreenHandle = 1;
_eglGlobal.CurrentContext = EGL_NO_CONTEXT;
_eglGlobal.LastError = EGL_SUCCESS;
_eglGlobal.Initialized = EGL_TRUE;
fprintf(stderr, "EGL Error 0x%x in %s\n", errCode, msg);
}
}
+
+
+/**
+ * Return a new screen handle/ID.
+ * NOTE: we never reuse these!
+ */
+EGLScreenMESA
+_eglAllocScreenHandle(void)
+{
+ EGLScreenMESA s = _eglGlobal.FreeScreenHandle;
+ _eglGlobal.FreeScreenHandle++;
+ return s;
+}
_EGLHashtable *Contexts;
_EGLHashtable *Surfaces;
+ EGLScreenMESA FreeScreenHandle;
+
EGLint LastError;
/* XXX this should be per-thread someday */
_eglError(EGLint errCode, const char *msg);
+extern EGLScreenMESA
+_eglAllocScreenHandle(void);
+
+
#endif /* EGLGLOBALS_INCLUDED */
+#include <assert.h>
+#include <stdlib.h>
#include "egldisplay.h"
#include "egldriver.h"
#include "eglmode.h"
#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
+/**
+ * Given an EGLModeMESA handle, return the corresponding _EGLMode object
+ * or null if non-existant.
+ */
_EGLMode *
_eglLookupMode(EGLDisplay dpy, EGLModeMESA mode)
{
const _EGLDisplay *disp = _eglLookupDisplay(dpy);
EGLint scrnum;
+ /* loop over all screens on the display */
for (scrnum = 0; scrnum < disp->NumScreens; scrnum++) {
- const _EGLScreen *scrn = disp->Screens + scrnum;
+ const _EGLScreen *scrn = disp->Screens[scrnum];
EGLint i;
+ /* search list of modes for handle */
for (i = 0; i < scrn->NumModes; i++) {
if (scrn->Modes[i].Handle == mode) {
return scrn->Modes + i;
}
}
}
+
return NULL;
}
+/**
+ * Add a new mode with the given attributes (width, height, depth, refreshRate)
+ * to the given screen.
+ * Assign a new mode ID/handle to the mode as well.
+ * \return pointer to the new _EGLMode
+ */
+_EGLMode *
+_eglAddMode(_EGLScreen *screen, EGLint width, EGLint height,
+ EGLint depth, EGLint refreshRate)
+{
+ EGLint n;
+ _EGLMode *newModes;
+
+ assert(screen);
+ assert(width > 0);
+ assert(height > 0);
+ assert(depth > 0);
+ assert(refreshRate > 0);
+
+ n = screen->NumModes;
+ newModes = (_EGLMode *) realloc(screen->Modes, (n+1) * sizeof(_EGLMode));
+ if (newModes) {
+ screen->Modes = newModes;
+ screen->Modes[n].Handle = n + 1;
+ screen->Modes[n].Width = width;
+ screen->Modes[n].Height = height;
+ screen->Modes[n].Depth = depth;
+ screen->Modes[n].RefreshRate = refreshRate;
+ screen->Modes[n].Stereo = EGL_FALSE;
+ screen->NumModes++;
+ return screen->Modes + n;
+ }
+ else {
+ return NULL;
+ }
+}
+
+
+
/**
* Search for the EGLMode that best matches the given attribute list.
*/
EGLBoolean
-_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
const EGLint *attrib_list, EGLModeMESA *modes,
EGLint modes_size, EGLint *num_modes)
{
* Return all possible modes for the given screen
*/
EGLBoolean
-_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes)
{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
EGLint i;
if (!scrn) {
#include "egltypedefs.h"
+
+/**
+ * Data structure which corresponds to an EGLModeMESA.
+ */
struct _egl_mode
{
- EGLConfig Handle; /* the public/opaque handle which names this mode */
+ EGLModeMESA Handle; /* the public/opaque handle which names this mode */
EGLint Width, Height; /* size in pixels */
EGLint Depth; /* bits per pixel */
EGLint RefreshRate; /* rate * 1000.0 */
_eglLookupMode(EGLDisplay dpy, EGLModeMESA mode);
+extern _EGLMode *
+_eglAddMode(_EGLScreen *screen, EGLint width, EGLint height,
+ EGLint depth, EGLint refreshRate);
+
+
extern EGLBoolean
-_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglChooseModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
const EGLint *attrib_list, EGLModeMESA *modes,
EGLint modes_size, EGLint *num_modes);
extern EGLBoolean
-_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglGetModesMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
* Ideas for screen management extension to EGL.
*
* Each EGLDisplay has one or more screens (CRTs, Flat Panels, etc).
- * The number of screens can be queried with eglQueryDisplay(EGL_SCREEN_COUNT).
+ * The screens' handles can be obtained with eglGetScreensMESA().
*
* A new kind of EGLSurface is possible- one which can be directly scanned
* out on a screen. Such a surface is created with eglCreateScreenSurface().
*
* To actually display a screen surface on a screen, the eglShowSurface()
* function is called.
- *
*/
#include <assert.h>
#include "eglscreen.h"
+/**
+ * Return a new _EGLScreen object.
+ */
+_EGLScreen *
+_eglNewScreen(void)
+{
+ return (_EGLScreen *) calloc(1, sizeof(_EGLScreen));
+}
+
+
+/**
+ * Given a public screen handle, return the internal _EGLScreen object.
+ */
_EGLScreen *
-_eglLookupScreen(EGLDisplay dpy, GLint screenNumber)
+_eglLookupScreen(EGLDisplay dpy, EGLScreenMESA screen)
{
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- if (!disp || screenNumber < 0 || screenNumber >= disp->NumScreens) {
+ EGLint i;
+ _EGLDisplay *display = _eglLookupDisplay(dpy);
+
+ if (!display)
return NULL;
+
+ for (i = 0; i < display->NumScreens; i++) {
+ if (display->Screens[i]->Handle == screen)
+ return display->Screens[i];
+ }
+ return NULL;
+}
+
+
+/**
+ * Add the given _EGLScreen to the display's list of screens.
+ */
+void
+_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen)
+{
+ EGLint n;
+
+ assert(display);
+ assert(screen);
+
+ screen->Handle = _eglAllocScreenHandle();
+ n = display->NumScreens;
+ display->Screens = realloc(display->Screens, (n+1) * sizeof(_EGLScreen *));
+ display->Screens[n] = screen;
+ display->NumScreens++;
+}
+
+
+
+EGLBoolean
+_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens,
+ EGLint max_screens, EGLint *num_screens)
+{
+ _EGLDisplay *display = _eglLookupDisplay(dpy);
+ EGLint n;
+
+ if (!display) {
+ _eglError(EGL_BAD_DISPLAY, "eglGetScreensMESA");
+ return EGL_FALSE;
+ }
+
+ if (display->NumScreens > max_screens) {
+ n = max_screens;
}
else {
- return disp->Screens + screenNumber;
+ n = display->NumScreens;
}
+
+ if (screens) {
+ EGLint i;
+ for (i = 0; i < n; i++)
+ screens[i] = display->Screens[i]->Handle;
+ }
+ if (num_screens)
+ *num_screens = n;
+
+ return EGL_TRUE;
}
* this with code that _really_ shows the surface.
*/
EGLBoolean
-_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
EGLSurface surface)
{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
_EGLMode *mode;
if (!scrn) {
* this with code that _really_ sets the mode.
*/
EGLBoolean
-_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
EGLModeMESA mode)
{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
if (!scrn) {
_eglError(EGL_BAD_SCREEN_MESA, "eglScreenModeMESA");
*/
EGLBoolean
_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLint screen_number, EGLint x, EGLint y)
+ EGLScreenMESA screen, EGLint x, EGLint y)
{
- _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
if (!scrn) {
_eglError(EGL_BAD_SCREEN_MESA, "eglScreenPositionMESA");
return EGL_FALSE;
}
-EGLBoolean
-_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLint attribute, EGLint *value)
-{
- const _EGLDisplay *display = _eglLookupDisplay(dpy);
- switch (attribute) {
- case EGL_SCREEN_COUNT_MESA:
- *value = display->NumScreens;
- break;
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglQueryDisplayMESA");
- return EGL_FALSE;
- }
- return EGL_TRUE;
-}
-
-
/**
* Query a screen's current surface.
*/
EGLBoolean
_eglQueryScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLint screen_number, EGLSurface *surface)
+ EGLScreenMESA screen, EGLSurface *surface)
{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
if (scrn->CurrentSurface)
*surface = scrn->CurrentSurface->Handle;
else
* Query a screen's current mode.
*/
EGLBoolean
-_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
EGLModeMESA *mode)
{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
if (scrn->CurrentMode)
*mode = scrn->CurrentMode->Handle;
else
EGLBoolean
-_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number,
+_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
EGLint attribute, EGLint *value)
{
- const _EGLScreen *scrn = _eglLookupScreen(dpy, screen_number);
+ const _EGLScreen *scrn = _eglLookupScreen(dpy, screen);
if (!scrn) {
_eglError(EGL_BAD_SCREEN_MESA, "eglQueryScreenMESA");
struct _egl_screen
{
+ EGLScreenMESA Handle; /* The public/opaque handle which names this object */
+
_EGLMode *CurrentMode;
_EGLSurface *CurrentSurface;
EGLint OriginX, OriginY;
extern _EGLScreen *
-_eglLookupScreen(EGLDisplay dpy, GLint screenNumber);
+_eglNewScreen(void);
+
+
+extern _EGLScreen *
+_eglLookupScreen(EGLDisplay dpy, EGLScreenMESA screen);
+
+
+extern void
+_eglAddScreen(_EGLDisplay *display, _EGLScreen *screen);
+
+
+extern EGLBoolean
+_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
extern EGLSurface
extern EGLBoolean
-_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen, EGLSurface surface);
+_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface);
extern EGLBoolean
-_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number, EGLModeMESA mode);
+_eglScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA mode);
extern EGLBoolean
-_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number, EGLint x, EGLint y);
+_eglScreenPositionMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
extern EGLBoolean
extern EGLBoolean
_eglQueryScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy,
- EGLint screen_number, EGLSurface *surface);
+ EGLScreenMESA screen, EGLSurface *surface);
extern EGLBoolean
-_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number, EGLModeMESA *mode);
+_eglQueryScreenModeMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
extern EGLBoolean
-_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint screen_number, EGLint attribute, EGLint *value);
+_eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
extern void