summaryrefslogtreecommitdiff
path: root/client/x11/red_window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/x11/red_window.cpp')
-rw-r--r--client/x11/red_window.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index 7e69b42..5a0886a 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()
{