diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-06-21 14:17:29 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-06-21 14:50:18 +0200 |
commit | cfc1e95bda0e150b3de225c3572bb1004dad070e (patch) | |
tree | e672e2607613ac012f0cfe3414a33b129bae52b2 /client/x11/red_window.cpp | |
parent | ae4436215cb113a02eac73c6afd368166090967c (diff) | |
download | spice-cfc1e95bda0e150b3de225c3572bb1004dad070e.tar.gz spice-cfc1e95bda0e150b3de225c3572bb1004dad070e.tar.xz spice-cfc1e95bda0e150b3de225c3572bb1004dad070e.zip |
Make opengl optional, disabled by default
The OpenGL renderer isn't really useful right now, its not quite up
to date, its not really faster than software and it only supports a limited
subset of drivers. So, lets disable it for now.
Long term opengl rendering of the 2d part of spice is important if we want
to combine 2d and 3d rendering (say if spice adds opengl support in the
protocol). But until then this is isn't useful for normal use.
Diffstat (limited to 'client/x11/red_window.cpp')
-rw-r--r-- | client/x11/red_window.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp index 7e69b428..5a0886ac 100644 --- a/client/x11/red_window.cpp +++ b/client/x11/red_window.cpp @@ -22,23 +22,26 @@ #include <X11/Xatom.h> #include <X11/XKBlib.h> +#ifdef USE_OGL #include <GL/gl.h> #include <GL/glu.h> #include <GL/glx.h> #include <GL/glext.h> +#endif // USE_OGL #include <stdio.h> #include "red_window.h" #include "utils.h" -#include "gl_utils.h" #include "debug.h" #include "platform.h" #include "x_platform.h" #include "pixels_source_p.h" #include <spice/protocol.h> #include "region.h" +#ifdef USE_OGL +#include "gl_utils.h" #include "red_pixmap_gl.h" -#include "red_pixmap_gl.h" +#endif // USE_OGL #include "x_icon.h" @@ -1008,6 +1011,7 @@ void RedWindow_p::wait_for_unmap() } } +#ifdef USE_OGL void RedWindow_p::set_glx(int width, int height) { if (_glcont_copy) { @@ -1025,6 +1029,7 @@ void RedWindow_p::set_glx(int width, int height) GLC_ERROR_TEST_FINISH; } } +#endif // USE_OGL void RedWindow_p::set_minmax(PixelsSource_p& pix_source, int width, int height) { @@ -1053,7 +1058,9 @@ Cursor RedWindow_p::create_invisible_cursor(Window window) RedWindow_p::RedWindow_p() : _win (None) +#ifdef USE_OGL , _glcont_copy (NULL) +#endif // USE_OGL , _icon (NULL) , _focused (false) , _ignore_foucs (false) @@ -1083,10 +1090,12 @@ void RedWindow_p::destroy(RedWindow& red_window, PixelsSource_p& pix_source) XFreeCursor(x_display, _invisible_cursor); _invisible_cursor = None; XDeleteContext(x_display, window, user_data_context); +#ifdef USE_OGL if (_glcont_copy) { glXDestroyContext(x_display, _glcont_copy); _glcont_copy = NULL; } +#endif // USE_OGL XDestroyWindow(x_display, window); XFreeColormap(x_display, _colormap); XFreeGC(x_display, pix_source.x_drawable.gc); @@ -1895,6 +1904,7 @@ bool RedWindow::get_mouse_anchor_point(SpicePoint& pt) return true; } +#ifdef USE_OGL RedGlContext RedWindow::create_context_gl() { if (XPlatform::get_fbconfig()[_screen]) { @@ -1926,16 +1936,6 @@ void RedWindow::untouch_context() glXMakeCurrent(x_display, 0, 0); } -int RedWindow::get_screen_num() -{ - return _screen; -} - -RedDrawable::Format RedWindow::get_format() -{ - return XPlatform::get_screen_format(_screen); -} - void RedWindow::set_type_gl() { PixelsSource_p *pix_source = (PixelsSource_p*)get_opaque(); @@ -1972,6 +1972,17 @@ void RedWindow::set_render_fbo(GLuint fbo) pix_source->x_drawable.rendertype = RENDER_TYPE_FBO; pix_source->x_drawable.fbo = fbo; } +#endif // USE_OGL + +int RedWindow::get_screen_num() +{ + return _screen; +} + +RedDrawable::Format RedWindow::get_format() +{ + return XPlatform::get_screen_format(_screen); +} void RedWindow::on_focus_in() { |