The proper way to do it seemed to be to add displays to the list, the only current one being EGL_DEFAULT_DISPLAY (0). I've defined two more: EGL_INTERLACED_DISPLAY, and EGL_PROGRESSIVE_DISPLAY. Default is the normal 480x272 LCD display. Interlaced is for composite or component-interlaced output. Progressive is for component-progressive output. If you ask for interlaced or progressive and you don't have the dve manager or a cable or the wrong cable, you get a return of EGL_NO_DISPLAY, otherwise you get "LCD ", "LCDV" (which is just LCD with the addition of the DVE manager), "LACED", or "PROG". In case you were wondering, default used to return "foo" as the display.
So an example would be:
Code: Select all
EGLCHK(dpy = eglGetDisplay(EGL_PROGRESSIVE_DISPLAY));
if (dpy == (EGLDisplay)EGL_NO_DISPLAY)
return 0;
EGLCHK(eglInitialize(dpy, NULL, NULL));
psp_log("EGL vendor \"%s\"\n", eglQueryString(dpy, EGL_VENDOR));
psp_log("EGL version \"%s\"\n", eglQueryString(dpy, EGL_VERSION));
psp_log("EGL extensions \"%s\"\n", eglQueryString(dpy, EGL_EXTENSIONS));
EGLCHK(eglChooseConfig(dpy, attrib_list, &config, 1, &num_configs));
if (num_configs == 0) {
__pspgl_log("eglChooseConfig returned 0 configurations");
return 0;
}
psp_log("eglChooseConfige() returned config 0x%04x\n", (unsigned int) config);
EGLCHK(ctx = eglCreateContext(dpy, config, NULL, NULL));
EGLCHK(surface = eglCreateWindowSurface(dpy, config, 0, NULL));
EGLCHK(eglMakeCurrent(dpy, surface, surface, ctx));
EGLCHK(eglGetConfigAttrib(dpy, config, EGL_WIDTH, &width));
EGLCHK(eglGetConfigAttrib(dpy, config, EGL_HEIGHT, &height));
Code: Select all
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(720, 480);
if (!glutCreateWindow( __FILE__ ))
return 0;
http://www.mediafire.com/download.php?15lhaqwxl4m
A couple things you'll notice right off: progressive seems to be just as fast as the LCD; second, interlaced is clearly slower. It can't be helped. You have to render the display, then copy the alternate fields into the proper place in the frame buffer for an interlaced output. Because of this copying, I plan to enable the single buffer mode inside EGL so that you can just use the front buffer. It currently uses double buffering, even though it doesn't matter due to the copy. The frame buffer for the interlaced output is currently allocated from heap memory so that you don't have a buffer you can't render to cluttering up the vram. Would it be faster to keep it in vram? I might have to experiment with that sometime.
So if some folks would try this out the demos and give a little feedback, I can move on to providing the libs/includes and altered source. After PSPGL seems okay, I plan to go back to looking at TV support in SDL.