Search
lxdream.org :: lxdream/src/drivers/video_gl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_gl.c
changeset 1298:d0eb2307b847
prev1282:9f445c5e252b
next1299:645ccec8dfb0
author nkeynes
date Wed Feb 04 08:38:23 2015 +1000 (5 years ago)
permissions -rw-r--r--
last change Fix assorted compile warnings reported by Clang
file annotate diff log raw
1.1 --- a/src/drivers/video_gl.c Tue Mar 27 08:23:52 2012 +1000
1.2 +++ b/src/drivers/video_gl.c Wed Feb 04 08:38:23 2015 +1000
1.3 @@ -433,7 +433,7 @@
1.4 return TRUE;
1.5 }
1.6
1.7 -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id )
1.8 +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id )
1.9 {
1.10 int size = frame->width * frame->height;
1.11 uint32_t tmp[size];
1.12 @@ -442,7 +442,6 @@
1.13 glBindTexture( GL_TEXTURE_2D, tex_id );
1.14 glTexSubImage2D( GL_TEXTURE_2D, 0, 0,0, frame->width, frame->height, GL_RGBA, type, tmp );
1.15 gl_check_error("gl_load_frame_buffer:glTexSubImage2DBGRA");
1.16 - return TRUE;
1.17 }
1.18
1.19 #else
1.20 @@ -466,7 +465,7 @@
1.21 return TRUE;
1.22 }
1.23
1.24 -gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id )
1.25 +void gl_frame_buffer_to_tex( frame_buffer_t frame, int tex_id )
1.26 {
1.27 GLenum type = colour_formats[frame->colour_format].type;
1.28 GLenum format = colour_formats[frame->colour_format].format;
1.29 @@ -478,10 +477,14 @@
1.30 glTexSubImage2DBGRA( 0, 0,0,
1.31 frame->width, frame->height, format, type, frame->data, FALSE );
1.32 glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
1.33 - return TRUE;
1.34 }
1.35 #endif
1.36
1.37 +static void gl_load_frame_buffer( frame_buffer_t frame, render_buffer_t render )
1.38 +{
1.39 + gl_frame_buffer_to_tex( frame, render->tex_id );
1.40 +}
1.41 +
1.42
1.43 gboolean gl_init_driver( display_driver_t driver, gboolean need_fbo )
1.44 {
1.45 @@ -494,9 +497,9 @@
1.46 }
1.47
1.48 /* Use SL shaders if available */
1.49 - gboolean have_shaders = glsl_init(driver);
1.50 + glsl_init(driver);
1.51 #ifndef HAVE_OPENGL_FIXEDFUNC
1.52 - if( !have_shaders ) { /* Shaders are required if we don't have fixed-functionality */
1.53 + if( !driver->has_sl ) { /* Shaders are required if we don't have fixed-functionality */
1.54 gl_fbo_shutdown();
1.55 return FALSE;
1.56 }
.