From e0c20725c8c7b516ed500b570fcf134534efd6b3 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Thu, 21 Apr 2011 13:06:37 +0200 Subject: s/USE_OGL/USE_OPENGL This is more explicit about what it does, and not much longer --- client/x11/pixels_source_p.h | 20 ++++++++++---------- client/x11/platform.cpp | 24 ++++++++++++------------ client/x11/red_drawable.cpp | 28 ++++++++++++++-------------- client/x11/red_window.cpp | 24 ++++++++++++------------ client/x11/red_window_p.h | 16 ++++++++-------- client/x11/x_platform.h | 4 ++-- 6 files changed, 58 insertions(+), 58 deletions(-) (limited to 'client/x11') diff --git a/client/x11/pixels_source_p.h b/client/x11/pixels_source_p.h index b1b5261c..8892c581 100644 --- a/client/x11/pixels_source_p.h +++ b/client/x11/pixels_source_p.h @@ -19,26 +19,26 @@ #define _H_PIXELE_SOURSR_P #include -#ifdef USE_OGL +#ifdef USE_OPENGL #include -#endif // USE_OGL +#endif // USE_OPENGL #include #include // required by Xshm.h, but not included by it #include #include "red_window.h" -#ifdef USE_OGL +#ifdef USE_OPENGL #include "red_pixmap_gl.h" -#endif // USE_OGL +#endif // USE_OPENGL #include "pixman_utils.h" enum { PIXELS_SOURCE_TYPE_INVALID, PIXELS_SOURCE_TYPE_X_DRAWABLE, PIXELS_SOURCE_TYPE_PIXMAP, -#ifdef USE_OGL +#ifdef USE_OPENGL PIXELS_SOURCE_TYPE_GL_TEXTURE, PIXELS_SOURCE_TYPE_GL_DRAWABLE, -#endif // USE_OGL +#endif // USE_OPENGL }; struct PixelsSource_p { @@ -56,17 +56,17 @@ struct PixelsSource_p { int screen; GC gc; int width, height; -#ifdef USE_OGL +#ifdef USE_OPENGL RenderType rendertype; union { GLXPbuffer pbuff; GLuint fbo; }; RedGlContext context; -#endif // USE_OGL +#endif // USE_OPENGL } x_drawable; -#ifdef USE_OGL +#ifdef USE_OPENGL struct { RenderType rendertype; Win win; @@ -80,7 +80,7 @@ struct PixelsSource_p { }; RedGlContext context; } gl; -#endif // USE_OGL +#endif // USE_OPENGL }; }; diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index 37df809c..7c310580 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -78,9 +78,9 @@ static Display* x_display = NULL; static bool x_shm_avail = false; static XVisualInfo **vinfo = NULL; static RedDrawable::Format *screen_format = NULL; -#ifdef USE_OGL +#ifdef USE_OPENGL static GLXFBConfig **fb_config = NULL; -#endif // USE_OGL +#endif // USE_OPENGL static XIM x_input_method = NULL; static XIC x_input_context = NULL; @@ -510,12 +510,12 @@ RedDrawable::Format XPlatform::get_screen_format(int screen) return screen_format[screen]; } -#ifdef USE_OGL +#ifdef USE_OPENGL GLXFBConfig** XPlatform::get_fbconfig() { return fb_config; } -#endif // USE_OGL +#endif // USE_OPENGL XIC XPlatform::get_input_context() { @@ -2884,7 +2884,7 @@ static void cleanup(void) delete vinfo; vinfo = NULL; } -#ifdef USE_OGL +#ifdef USE_OPENGL if (fb_config) { for (i = 0; i < ScreenCount(x_display); ++i) { if (fb_config[i]) { @@ -2894,7 +2894,7 @@ static void cleanup(void) delete fb_config; fb_config = NULL; } -#endif // USE_OGL +#endif // USE_OPENGL } static void quit_handler(int sig) @@ -3057,10 +3057,10 @@ static XVisualInfo* get_x_vis_info(int screen) void Platform::init() { -#ifdef USE_OGL +#ifdef USE_OPENGL int err, ev; int threads_enable; -#endif // USE_OGL +#endif // USE_OPENGL int major, minor; Bool pixmaps; @@ -3068,7 +3068,7 @@ void Platform::init() setlocale(LC_ALL, ""); -#ifdef USE_OGL +#ifdef USE_OPENGL threads_enable = XInitThreads(); #else XInitThreads(); @@ -3087,7 +3087,7 @@ void Platform::init() memset(vinfo, 0, sizeof(XVisualInfo *) * ScreenCount(x_display)); screen_format = new RedDrawable::Format[ScreenCount(x_display)]; memset(screen_format, 0, sizeof(RedDrawable::Format) * ScreenCount(x_display)); -#ifdef USE_OGL +#ifdef USE_OPENGL fb_config = new GLXFBConfig *[ScreenCount(x_display)]; memset(fb_config, 0, sizeof(GLXFBConfig *) * ScreenCount(x_display)); @@ -3122,13 +3122,13 @@ void Platform::init() } } } else -#else // !USE_OGL +#else // !USE_OPENGL { for (int i = 0; i < ScreenCount(x_display); ++i) { vinfo[i] = get_x_vis_info(i); } } -#endif // USE_OGL +#endif // USE_OPENGL for (int i = 0; i < ScreenCount(x_display); ++i) { if (vinfo[i] == NULL) { diff --git a/client/x11/red_drawable.cpp b/client/x11/red_drawable.cpp index 3712dfd7..d6cce920 100644 --- a/client/x11/red_drawable.cpp +++ b/client/x11/red_drawable.cpp @@ -25,7 +25,7 @@ #include "x_platform.h" #include "utils.h" -#ifdef USE_OGL +#ifdef USE_OPENGL #include "gl_utils.h" #include #include @@ -136,7 +136,7 @@ static inline void copy_to_gldrawable_from_pixmap(const RedDrawable_p* dest, glXMakeCurrent(XPlatform::get_display(), pbuffer, context); } } -#endif // USE_OGL +#endif // USE_OPENGL static inline void copy_to_drawable_from_drawable(const RedDrawable_p* dest, const SpiceRect& area, @@ -274,7 +274,7 @@ static inline void copy_to_x_drawable(const RedDrawable_p* dest, } } -#ifdef USE_OGL +#ifdef USE_OPENGL static inline void copy_to_gl_drawable(const RedDrawable_p* dest, const SpiceRect& area, const SpicePoint& offset, @@ -292,7 +292,7 @@ static inline void copy_to_gl_drawable(const RedDrawable_p* dest, THROW("invalid source type %d", source->type); } } -#endif // USE_OGL +#endif // USE_OPENGL static inline void copy_to_pixmap_from_drawable(const RedDrawable_p* dest, const SpiceRect& area, @@ -323,7 +323,7 @@ static inline void copy_to_pixmap_from_pixmap(const RedDrawable_p* dest, area.bottom - area.top); } -#ifdef USE_OGL +#ifdef USE_OPENGL static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest, const SpiceRect& area, const SpicePoint& offset, @@ -367,7 +367,7 @@ static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest, glXMakeCurrent(XPlatform::get_display(), win, context); } } -#endif // USE_OGL +#endif // USE_OPENGL static inline void copy_to_pixmap(const RedDrawable_p* dest, const SpiceRect& area, @@ -376,11 +376,11 @@ static inline void copy_to_pixmap(const RedDrawable_p* dest, int src_x, int src_y) { switch (source->type) { -#ifdef USE_OGL +#ifdef USE_OPENGL case PIXELS_SOURCE_TYPE_GL_TEXTURE: copy_to_pixmap_from_gltexture(dest, area, offset, source, src_x, src_y); break; -#endif // USE_OGL +#endif // USE_OPENGL case PIXELS_SOURCE_TYPE_X_DRAWABLE: copy_to_pixmap_from_drawable(dest, area, offset, source, src_x, src_y); break; @@ -397,12 +397,12 @@ void RedDrawable::copy_pixels(const PixelsSource& src, int src_x, int src_y, con PixelsSource_p* source = (PixelsSource_p*)src.get_opaque(); RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); switch (dest->source.type) { -#ifdef USE_OGL +#ifdef USE_OPENGL case PIXELS_SOURCE_TYPE_GL_DRAWABLE: copy_to_gl_drawable(dest, area, _origin, source, src_x + src._origin.x, src_y + src._origin.y); break; -#endif // USE_OGL +#endif // USE_OPENGL case PIXELS_SOURCE_TYPE_X_DRAWABLE: copy_to_x_drawable(dest, area, _origin, source, src_x + src._origin.x, src_y + src._origin.y); @@ -654,7 +654,7 @@ static inline void fill_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb area.right - area.left, area.bottom - area.top); } -#ifdef USE_OGL +#ifdef USE_OPENGL static inline void fill_gl_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, const SpicePoint& offset) { @@ -688,7 +688,7 @@ static inline void fill_gl_drawable(RedDrawable_p* dest, const SpiceRect& area, glColor3f(1, 1, 1); } -#endif // USE_OGL +#endif // USE_OPENGL static inline void fill_pixmap(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, const SpicePoint& offset) @@ -706,11 +706,11 @@ void RedDrawable::fill_rect(const SpiceRect& area, rgb32_t color) { RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); switch (dest->source.type) { -#ifdef USE_OGL +#ifdef USE_OPENGL case PIXELS_SOURCE_TYPE_GL_DRAWABLE: fill_gl_drawable(dest, area, color, _origin); break; -#endif // USE_OGL +#endif // USE_OPENGL case PIXELS_SOURCE_TYPE_X_DRAWABLE: fill_drawable(dest, area, color, _origin); break; diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp index 8af22261..9f4da602 100644 --- a/client/x11/red_window.cpp +++ b/client/x11/red_window.cpp @@ -25,12 +25,12 @@ #include #include -#ifdef USE_OGL +#ifdef USE_OPENGL #include #include #include #include -#endif // USE_OGL +#endif // USE_OPENGL #include #include "red_window.h" @@ -41,10 +41,10 @@ #include "pixels_source_p.h" #include #include "region.h" -#ifdef USE_OGL +#ifdef USE_OPENGL #include "gl_utils.h" #include "red_pixmap_gl.h" -#endif // USE_OGL +#endif // USE_OPENGL #include "x_icon.h" @@ -1066,7 +1066,7 @@ void RedWindow_p::wait_for_unmap() } } -#ifdef USE_OGL +#ifdef USE_OPENGL void RedWindow_p::set_glx(int width, int height) { if (_glcont_copy) { @@ -1086,7 +1086,7 @@ void RedWindow_p::set_glx(int width, int height) GLC_ERROR_TEST_FINISH; } } -#endif // USE_OGL +#endif // USE_OPENGL void RedWindow_p::set_minmax(PixelsSource_p& pix_source) { @@ -1127,9 +1127,9 @@ Cursor RedWindow_p::create_invisible_cursor(Window window) RedWindow_p::RedWindow_p() : _win (None) , _show_pos_valid (false) -#ifdef USE_OGL +#ifdef USE_OPENGL , _glcont_copy (NULL) -#endif // USE_OGL +#endif // USE_OPENGL , _icon (NULL) , _focused (false) , _ignore_foucs (false) @@ -1167,12 +1167,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 +#ifdef USE_OPENGL if (_glcont_copy) { glXDestroyContext(x_display, _glcont_copy); _glcont_copy = NULL; } -#endif // USE_OGL +#endif // USE_OPENGL XDestroyWindow(x_display, window); XFreeColormap(x_display, _colormap); XFreeGC(x_display, pix_source.x_drawable.gc); @@ -2075,7 +2075,7 @@ bool RedWindow::get_mouse_anchor_point(SpicePoint& pt) return true; } -#ifdef USE_OGL +#ifdef USE_OPENGL RedGlContext RedWindow::create_context_gl() { if (XPlatform::get_fbconfig()[_screen]) { @@ -2148,7 +2148,7 @@ void RedWindow::set_render_fbo(GLuint fbo) pix_source->x_drawable.rendertype = RENDER_TYPE_FBO; pix_source->x_drawable.fbo = fbo; } -#endif // USE_OGL +#endif // USE_OPENGL int RedWindow::get_screen_num() { diff --git a/client/x11/red_window_p.h b/client/x11/red_window_p.h index 6f05a905..6f94d261 100644 --- a/client/x11/red_window_p.h +++ b/client/x11/red_window_p.h @@ -18,17 +18,17 @@ #ifndef _H_RED_WINDOW_P #define _H_RED_WINDOW_P -#ifdef USE_OGL +#ifdef USE_OPENGL #include -#endif // USE_OGL +#endif // USE_OPENGL #include #include typedef Window Win; -#ifdef USE_OGL +#ifdef USE_OPENGL typedef GLXContext RedGlContext; typedef GLXPbuffer RedPbuffer; -#endif // USE_OGL +#endif // USE_OPENGL class RedWindow; class Icon; @@ -54,9 +54,9 @@ public: static void win_proc(XEvent& event); static Cursor create_invisible_cursor(Window window); -#ifdef USE_OGL +#ifdef USE_OPENGL void set_glx(int width, int height); -#endif // USE_OGL +#endif // USE_OPENGL static void handle_key_press_event(RedWindow& red_window, XKeyEvent* event); protected: @@ -67,9 +67,9 @@ protected: bool _expect_parent; SpicePoint _show_pos; bool _show_pos_valid; -#ifdef USE_OGL +#ifdef USE_OPENGL GLXContext _glcont_copy; -#endif // USE_OGL +#endif // USE_OPENGL Icon* _icon; bool _focused; bool _ignore_foucs; diff --git a/client/x11/x_platform.h b/client/x11/x_platform.h index c535652a..93debdcc 100644 --- a/client/x11/x_platform.h +++ b/client/x11/x_platform.h @@ -29,9 +29,9 @@ public: static XVisualInfo** get_vinfo(); static RedDrawable::Format get_screen_format(int screen); static XIC get_input_context(); -#ifdef USE_OGL +#ifdef USE_OPENGL static GLXFBConfig** get_fbconfig(); -#endif // USE_OGL +#endif // USE_OPENGL typedef void (*win_proc_t)(XEvent& event); static void set_win_proc(Window win, win_proc_t proc); -- cgit