#include "egldisplay.h"
#include "egldriver.h"
#include "eglglobals.h"
+#include "egllog.h"
#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
unsigned k;
if ( bytes_per_pixel[index] == 0 ) {
- fprintf(stderr, "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.\n",
- __FUNCTION__, __LINE__, fb_type);
+ _eglLog(_EGL_INFO,
+ "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.",
+ __FUNCTION__, __LINE__, fb_type);
return GL_FALSE;
}
break;
default:
- fprintf(stderr, "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.\n",
- __FUNCTION__, __LINE__, fb_format);
+ _eglLog(_EGL_WARNING,
+ "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.",
+ __FUNCTION__, __LINE__, fb_format);
return GL_FALSE;
}
#include "egldisplay.h"
#include "egldriver.h"
#include "eglglobals.h"
+#include "egllog.h"
#include "eglmode.h"
#include "eglscreen.h"
#include "eglsurface.h"
/* use default */
}
else if (name[0] == ':' && (name[1] >= '0' && name[1] <= '9') && !name[2]) {
- printf("EGL: Use driver for screen: %s\n", name);
/* XXX probe hardware here to determine which driver to open */
driverName = "libEGLdri";
}
else if (name[0] == '!') {
/* use specified driver name */
driverName = name + 1;
- printf("EGL: Use driver named %s\n", driverName);
}
else {
/* Maybe display was returned by XOpenDisplay? */
- printf("EGL: can't parse display pointer\n");
+ _eglLog(_EGL_FATAL, "eglChooseDriver() bad name");
}
+ _eglLog(_EGL_INFO, "eglChooseDriver() choosing %s", driverName);
+
drv = _eglOpenDriver(dpy, driverName);
dpy->Driver = drv;
/* XXX also prepend a directory path??? */
sprintf(driverFilename, "%s.so", driverName);
+ _eglLog(_EGL_DEBUG, "dlopen(%s)", driverFilename);
lib = dlopen(driverFilename, RTLD_NOW);
if (!lib) {
- fprintf(stderr, "EGLdebug: Error opening %s: %s\n", driverFilename, dlerror());
+ _eglLog(_EGL_WARNING, "Could not open %s (%s)",
+ driverFilename, dlerror());
return NULL;
}
mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain");
if (!mainFunc) {
- fprintf(stderr, "_eglMain not found in %s", (char *) driverFilename);
+ _eglLog(_EGL_WARNING, "_eglMain not found in %s", driverFilename);
dlclose(lib);
return NULL;
}
{
void *handle = drv->LibHandle;
EGLBoolean b;
- fprintf(stderr, "EGL debug: Closing driver\n");
+
+ _eglLog(_EGL_INFO, "Closing driver");
/*
* XXX check for currently bound context/surfaces and delete them?