<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src</tt></b></td></tr>
<tr><td><tt><a href="#file1">display.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr class="alt" style=";" ><td><tt>drivers/<a href="#file2">gl_fbo.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+11</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-3</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr><td><tt>       /<a href="#file3">video_egl.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+8</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr class="alt" style=";" ><td><tt>       /<a href="#file4">video_gl.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+16</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-9</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr><td><tt>       /<a href="#file5">video_gl.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr class="alt" style=";" ><td><tt>       /<a href="#file6">video_glx.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+6</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr><td><tt>       /<a href="#file7">video_gtk.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+2</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr class="alt" style=";" ><td><tt>       /<a href="#file8">video_nsgl.m</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+1</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr><td><tt>       /<a href="#file9">video_osx.m</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr class="alt" style=";" ><td><tt>pvr2/<a href="#file10">glrender.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+7</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">204dae47ab7a -> b8ab59d39756</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+54</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-19</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >10 modified files</small><br />
<div class="tasklist" style="padding:4px;border:1px dashed #000000;margin-top:1em;" ><ul>
<li><a href="#task1">TODO: get from config info */</a></li>
<li><a href="#task2">FIXME: Find a non-fixed-func way to do this */</a></li>
</ul></div>
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Support depth component 16 as well as 24 (add capability flag for the available bits)
Put remaining TODOs inside HAVE_OPENGL_FIXEDFUNC blocks
Add swap-buffer calls for EGL (does not appear to support rendering directly
to front-buffer)
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>display.h</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/display.h
+++ lxdream/src/display.h
@@ -110,6 +110,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 struct display_capabilities {
     gboolean has_gl;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    int depth_bits;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     int stencil_bits; /* 0 = no stencil buffer */
 };
 
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>gl_fbo.c</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/gl_fbo.c
+++ lxdream/src/drivers/gl_fbo.c
@@ -59,6 +59,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > };
 
 static GLint gl_fbo_max_attachments = 0;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static GLint gl_fbo_depth_component;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static gboolean gl_fbo_have_packed_stencil = FALSE;
 static struct gl_fbo_info fbo[MAX_FRAMEBUFFERS];
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -103,6 +104,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         gl_fbo_have_packed_stencil = FALSE;
         WARN( "Packed depth stencil not available - disabling shadow volumes" );
     }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( driver->capabilities.depth_bits >= 24 ) {
+        gl_fbo_depth_component = GL_DEPTH_COMPONENT24;
+    } else {
+        gl_fbo_depth_component = GL_DEPTH_COMPONENT16;
+    }
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     driver->create_render_buffer = gl_fbo_create_render_buffer;
     driver->destroy_render_buffer = gl_fbo_destroy_render_buffer;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -151,7 +157,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                                      GL_RENDERBUFFER, fbo[bufno].depth_id);
     } else {
         glBindRenderbuffer(GL_RENDERBUFFER, fbo[bufno].depth_id);
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        glRenderbufferStorage(GL_RENDERBUFFER, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GL_DEPTH_COMPONENT24</span>, width, height);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        glRenderbufferStorage(GL_RENDERBUFFER, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gl_fbo_depth_component</span>, width, height);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
                                      GL_RENDERBUFFER, fbo[bufno].depth_id);
         /* In theory you could attach a separate stencil buffer. In practice this 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -331,6 +337,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     gl_fbo_detach();
     gl_display_render_buffer( buffer );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( display_driver->swap_buffers )
+        display_driver->swap_buffers();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 static void gl_fbo_load_frame_buffer( frame_buffer_t frame, render_buffer_t buffer )
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -343,6 +351,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     gl_fbo_detach();
     gl_display_blank( colour );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( display_driver->swap_buffers )
+        display_driver->swap_buffers();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 void gl_fbo_detach()
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -353,8 +363,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glDrawBuffer( GL_FRONT );
     glReadBuffer( GL_FRONT );
 #endif
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    if( display_driver->swap_buffers )
-        display_driver->swap_buffers();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }    
 
 static gboolean gl_fbo_read_render_buffer( unsigned char *target, render_buffer_t buffer, 
</pre></div>
<hr /><a name="file3" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_egl.c</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_egl.c
+++ lxdream/src/drivers/video_egl.c
@@ -122,7 +122,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
     if( gl_fbo_is_supported() ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        display_gl_driver.capabilities.has_gl = TRUE;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        display_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >e</span>gl_driver.capabilities.has_gl = TRUE;
<a name="task1" />+        display_egl_driver.capabilities.depth_bits = 16; /* <span class="task" style="background-color:#ffff00;" >TODO</span>: get from config info */
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         gl_fbo_init(&display_egl_driver);
         gl_vbo_init(&display_egl_driver);
         fbo_created = TRUE;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -131,6 +132,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         video_egl_clear_window();
         return FALSE;
     }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    gl_set_video_size(width, height, 0);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     pvr2_setup_gl_context();
     INFO( "Initialised EGL %d.%d\n", major, minor );
     return TRUE;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -154,6 +156,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     eglTerminate(display);
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static void video_egl_swap_buffers()
+{
+    eglSwapBuffers(display, surface);
+}
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 
 /**
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -164,5 +170,5 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         NULL, NULL, NULL,
         NULL, NULL, NULL, NULL,
         gl_load_frame_buffer, gl_display_render_buffer, gl_display_blank,
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >NULL</span>, gl_read_render_buffer, NULL, NULL
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >video_egl_swap_buffers</span>, gl_read_render_buffer, NULL, NULL
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > };
</pre></div>
<hr /><a name="file4" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_gl.c</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_gl.c
+++ lxdream/src/drivers/video_gl.c
@@ -44,12 +44,18 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     struct video_vertex invert_view[4];
 } video_box;
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void gl_set_video_size( uint32_t width, uint32_t height )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void gl_set_video_size( uint32_t width, uint32_t height<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >, int flipped</span> )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     video_width = width;
     video_height = height;
 
     int x1=0,y1=0,x2=video_width,y2=video_height;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    int top = 0, bottom = 1;
+
+    if( flipped ) {
+        top = 1;
+        bottom = 0;
+    }
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     int ah = video_width * 0.75;
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -80,17 +86,17 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
     video_box.video_view[0].x = x1; video_box.video_view[0].y = y1;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    video_box.video_view[0].u = 0; video_box.video_view[0].v = 0;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    video_box.video_view[0].u = top; video_box.video_view[0].v = top;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     video_box.video_view[1].x = x2; video_box.video_view[1].y = y1;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    video_box.video_view[1].u = 1; video_box.video_view[1].v = 0;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    video_box.video_view[1].u = bottom; video_box.video_view[1].v = top;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     video_box.video_view[2].x = x1; video_box.video_view[2].y = y2;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    video_box.video_view[2].u = 0; video_box.video_view[2].v = 1;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    video_box.video_view[2].u = top; video_box.video_view[2].v = bottom;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     video_box.video_view[3].x = x2; video_box.video_view[3].y = y2;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    video_box.video_view[3].u = 1; video_box.video_view[3].v = 1;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    video_box.video_view[3].u = bottom; video_box.video_view[3].v = bottom;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     memcpy( &video_box.invert_view, &video_box.video_view, sizeof(video_box.video_view) );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    video_box.invert_view[0].v = 1; video_box.invert_view[1].v = 1;
-    video_box.invert_view[2].v = 0; video_box.invert_view[3].v = 0;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    video_box.invert_view[0].v = bottom; video_box.invert_view[1].v = bottom;
+    video_box.invert_view[2].v = top; video_box.invert_view[3].v = top;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     defineOrthoMatrix(video_box.viewMatrix, video_width, video_height, 0, 65535);
 }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -175,6 +181,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     /* Set video box tex alpha to 1 */
     video_box.video_view[0].a = video_box.video_view[1].a = video_box.video_view[2].a = video_box.video_view[3].a = 1;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    video_box.invert_view[0].a = video_box.invert_view[1].a = video_box.invert_view[2].a = video_box.invert_view[3].a = 1;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     /* Reset display parameters */
     gl_framebuffer_setup();
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -186,8 +193,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     glDrawArrays(GL_TRIANGLE_STRIP, inverted ? 12 : 8, 4);
     glDisable(GL_TEXTURE_2D);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    gl_framebuffer_cleanup();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glFlush();
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    gl_framebuffer_cleanup();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id )
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -221,8 +228,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
     glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
     glDrawArrays(GL_TRIANGLE_STRIP, 8, 4);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    gl_framebuffer_cleanup();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glFlush();
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    gl_framebuffer_cleanup();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 /**
</pre></div>
<hr /><a name="file5" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_gl.h</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_gl.h
+++ lxdream/src/drivers/video_gl.h
@@ -28,7 +28,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /**
  * Set the video size used by the frame blits
  */
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void gl_set_video_size( uint32_t width, uint32_t height );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void gl_set_video_size( uint32_t width, uint32_t height<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >, int flipped</span> );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 /**
  * Generic GL routine to draw the given frame buffer into a texture
</pre></div>
<hr /><a name="file6" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_glx.c</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_glx.c
+++ lxdream/src/drivers/video_glx.c
@@ -41,6 +41,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static gboolean glx_fbconfig_supported = FALSE;
 static gboolean glx_pbuffer_supported = FALSE;
 static GLuint glx_pbuffer_texture = 0; 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static int glx_depth_bits = 0;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 static void video_glx_swap_buffers( void );
 static void video_glx_print_info( FILE *out );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -119,6 +120,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > //    glx_fbconfig_supported = FALSE;
     if( glx_fbconfig_supported ) {
         int nelem;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        glx_depth_bits = 24;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         int fb_attribs[] = { GLX_DRAWABLE_TYPE, 
                 GLX_PBUFFER_BIT|GLX_WINDOW_BIT, 
                 GLX_RENDER_TYPE, GLX_RGBA_BIT, 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -130,6 +132,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         if( configs == NULL || nelem == 0 ) {
             /* Try a 16-bit depth buffer and see if it helps */
             fb_attribs[5] = 16;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            glx_depth_bits = 16;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             configs = glXChooseFBConfig( display, screen, fb_attribs, &nelem );
             if( nelem > 0 ) {
                 WARN( "Using a 16-bit depth buffer - expect video glitches" );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -148,10 +151,12 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
     if( !glx_fbconfig_supported ) {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        glx_depth_bits = 24;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         int attribs[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, 0 };
         glx_visual = glXChooseVisual( display, screen, attribs );
         if( glx_visual == NULL ) {
             /* Try the 16-bit fallback here too */
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            glx_depth_bits = 16;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             attribs[2] = 16;
             glx_visual = glXChooseVisual( display, screen, attribs );
             if( glx_visual != NULL ) {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -234,6 +239,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     driver->swap_buffers = video_glx_swap_buffers;
     driver->print_info = video_glx_print_info;
     driver->capabilities.has_gl = TRUE;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    driver->capabilities.depth_bits = glx_depth_bits;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( gl_fbo_is_supported() ) { // First preference
         gl_fbo_init(driver);
     } else if( glx_pbuffer_supported ) {
</pre></div>
<hr /><a name="file7" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_gtk.c</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_gtk.c
+++ lxdream/src/drivers/video_gtk.c
@@ -144,7 +144,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 gboolean video_gtk_resize_callback(GtkWidget *widget, GdkEventConfigure *event, gpointer data )
 {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    gl_set_video_size(event->width, event->height);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    gl_set_video_size(event->width, event->height<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >, 0</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     pvr2_draw_frame();
     return TRUE;
 }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -278,7 +278,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         return FALSE;
     }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    gl_set_video_size(gtk_video_drawable->allocation.width, gtk_video_drawable->allocation.height);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    gl_set_video_size(gtk_video_drawable->allocation.width, gtk_video_drawable->allocation.height<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >, 0</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #ifdef HAVE_OSMESA
     video_gdk_init_driver( &display_gtk_driver );
 #else
</pre></div>
<hr /><a name="file8" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_nsgl.m</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_nsgl.m
+++ lxdream/src/drivers/video_nsgl.m
@@ -42,6 +42,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     [pool release];
     driver->swap_buffers = video_nsgl_swap_buffers;
     driver->capabilities.has_gl = TRUE;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    driver->capabilities.depth_bits = 24;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( gl_fbo_is_supported() ) {
         gl_fbo_init(driver);
     } else {
</pre></div>
<hr /><a name="file9" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>video_osx.m</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_osx.m
+++ lxdream/src/drivers/video_osx.m
@@ -120,7 +120,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     NSSize size = [self frame].size;
     if( video_width != size.width || video_height != size.height ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        gl_set_video_size(size.width, size.height);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        gl_set_video_size(size.width, size.height<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >, 0</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         video_nsgl_update();
     }
     pvr2_draw_frame();
</pre></div>
<hr /><a name="file10" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>glrender.c</b></big> <small id="info" style="color: #888888;" >204dae47ab7a -> b8ab59d39756</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glrender.c
+++ lxdream/src/pvr2/glrender.c
@@ -73,12 +73,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 static void drawrect2d( uint32_t tile_bounds[], float z )
 {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" ><a name="task2" />+    /* <span class="task" style="background-color:#ffff00;" >FIXME</span>: Find a non-fixed-func way to do this */
+#ifdef HAVE_OPENGL_FIXEDFUNC
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glBegin( GL_TRIANGLE_STRIP );
     glVertex3f( tile_bounds[0], tile_bounds[2], z );
     glVertex3f( tile_bounds[1], tile_bounds[2], z );
     glVertex3f( tile_bounds[0], tile_bounds[3], z );
     glVertex3f( tile_bounds[1], tile_bounds[3], z );
     glEnd();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#endif
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 static void pvr2_scene_load_textures()
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -116,8 +119,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         if( !glsl_load_shaders( ) ) {
             WARN( "Unable to load GL shaders" );
         } else {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            INFO( "Shaders loaded successfully" );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             have_shaders = TRUE;
         }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    } else {
+        INFO( "Shaders not supported" );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
 #ifdef APPLE_BUILD
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -172,9 +178,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >  */
 static void render_set_tsp_context( uint32_t poly1, uint32_t poly2 )
 {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#ifdef HAVE_OPENGL_FIXEDFUNC
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glShadeModel( POLY1_SHADE_MODEL(poly1) );
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-#ifdef HAVE_OPENGL_FIXEDFUNC
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( !have_shaders ) {
         if( POLY1_TEXTURED(poly1) ) {
             if( POLY2_TEX_BLEND(poly2) == 2 )
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>