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 1244:6b54ef5ed413
prev1240:190df8a791ca
next1246:887f7b0ac7f3
author nkeynes
date Tue Feb 28 18:22:52 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Add a GL-only video driver for android usage (since the Java code is
responsible for creating the context)
file annotate diff log raw
1.1 --- a/src/drivers/video_gl.c Tue Feb 28 17:25:26 2012 +1000
1.2 +++ b/src/drivers/video_gl.c Tue Feb 28 18:22:52 2012 +1000
1.3 @@ -244,3 +244,29 @@
1.4 glPixelStorei( GL_PACK_ROW_LENGTH, 0 );
1.5 return TRUE;
1.6 }
1.7 +
1.8 +static gboolean video_gl_init();
1.9 +
1.10 +/**
1.11 + * Minimal GL driver (assuming that the GL context is already set up externally)
1.12 + * This requires FBO support (since otherwise we have no way to get a render buffer)
1.13 + */
1.14 +struct display_driver display_gl_driver = {
1.15 + "gl", N_("OpenGL driver"), video_gl_init, NULL,
1.16 + NULL, NULL, NULL,
1.17 + NULL, NULL, NULL, NULL,
1.18 + gl_load_frame_buffer, gl_display_render_buffer, gl_display_blank,
1.19 + NULL, gl_read_render_buffer, NULL, NULL
1.20 +};
1.21 +
1.22 +static gboolean video_gl_init()
1.23 +{
1.24 + if( gl_fbo_is_supported() ) {
1.25 + display_gl_driver.capabilities.has_gl = TRUE;
1.26 + gl_fbo_init(&display_gl_driver);
1.27 + gl_vbo_init(&display_gl_driver);
1.28 + return TRUE;
1.29 + } else {
1.30 + return FALSE;
1.31 + }
1.32 +}
.