Skip to content

Commit

Permalink
Make one version of Fl_OpenGL_Display_Device::capture_gl_rectangle() …
Browse files Browse the repository at this point in the history
…the default one.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11698 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Apr 26, 2016
1 parent 25b4076 commit 2d83a11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/drivers/OpenGL/Fl_OpenGL_Display_Device.H
Expand Up @@ -3,7 +3,7 @@
//
// implementation of class Fl_Gl_Device_Plugin for the Fast Light Tool Kit (FLTK).
//
// Copyright 2010-2014 by Bill Spitzak and others.
// Copyright 2010-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
Expand All @@ -16,7 +16,6 @@
// http://www.fltk.org/str.php
//


#include <FL/Fl_Device.H>

class Fl_OpenGL_Graphics_Driver;
Expand All @@ -28,13 +27,12 @@ class Fl_RGB_Image;
This surface is needed as an interface between GL windows and the GL graphics driver.
*/
class FL_EXPORT Fl_OpenGL_Display_Device : public Fl_Surface_Device {
public:
Fl_OpenGL_Display_Device(Fl_OpenGL_Graphics_Driver *graphics_driver);
public:
static Fl_OpenGL_Display_Device *display_device();
static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window*, int, int, int, int);
};


//
// End of "$Id$".
//
19 changes: 7 additions & 12 deletions src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx
Expand Up @@ -16,11 +16,9 @@
// http://www.fltk.org/str.php
//

#include <config.h>
#include "../../config_lib.h"
#include <FL/Fl_Gl_Window.H>
#include <FL/Fl_Image.H>
#include <FL/Fl_Device.H>
#include <FL/gl.h>
#include <string.h>

Expand All @@ -42,7 +40,7 @@ Fl_OpenGL_Display_Device::Fl_OpenGL_Display_Device(Fl_OpenGL_Graphics_Driver *gr
#ifdef FL_CFG_GFX_QUARTZ

// convert BGRA to RGB and also exchange top and bottom
uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth)
static uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth)
{
uchar *newimg = new uchar[3*w*h];
uchar *to = newimg;
Expand Down Expand Up @@ -89,7 +87,12 @@ Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window* glw,
img->alloc_array = 1;
return img;
}
#elif defined(FL_CFG_GFX_GDI) || defined(FL_CFG_GFX_XLIB)

#else

#if defined(FL_PORTING)
# pragma message "FL_PORTING: check whether the default Fl_OpenGL_Display_Device::capture_gl_rectangle() works for your platform"
#endif

Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w, int h)
/* captures a rectangle of a Fl_Gl_Window window, and returns it as a RGB image
Expand Down Expand Up @@ -127,14 +130,6 @@ Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window *glw,
return img;
}

#elif defined(FL_PORTING)

# pragma message "FL_PORTING: implement Fl_OpenGL_Display_Device::capture_gl_rectangle() for your platform"
Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window* glw, int x, int y, int w, int h)
{
return NULL;
}

#endif
//
// End of "$Id$".
Expand Down

0 comments on commit 2d83a11

Please sign in to comment.