summaryrefslogtreecommitdiff
path: root/src/drivers/PicoSDL
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-01-23 01:33:47 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-01-23 18:12:47 +0100
commit04ccc8cc46c45b81e6138bec0b48a188c4ffe406 (patch)
tree3ad8604f5d433dc6b6c294c28549a58dd57efcbd /src/drivers/PicoSDL
parentb275ff07158e80d1744ddb2f6c51094a87cf079a (diff)
Remove experimental platforms Android, Pico, SDL (PR #376)
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule" https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
Diffstat (limited to 'src/drivers/PicoSDL')
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Copy_Surface.cxx1
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H118
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx68
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Image_Surface.cxx1
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H38
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx135
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.H1
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx30
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H51
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx104
10 files changed, 0 insertions, 547 deletions
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Copy_Surface.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Copy_Surface.cxx
deleted file mode 100644
index 8b1378917..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Copy_Surface.cxx
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H
deleted file mode 100644
index eb8944286..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H
+++ /dev/null
@@ -1,118 +0,0 @@
-
-//
-// Definition of the Pico minimal SDL graphics driver
-// for the Fast Light Tool Kit (FLTK).
-//
-// 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-/**
- \file Fl_PicoSDL_Graphics_Driver.H
- \brief Definition of Pico minimal graphics driver.
- */
-
-#ifndef FL_PICOSDL_GRAPHICS_DRIVER_H
-#define FL_PICOSDL_GRAPHICS_DRIVER_H
-
-#include "../Pico/Fl_Pico_Graphics_Driver.H"
-
-
-/**
- \brief The Pico minimal SDL graphics class.
-
- This class is implemented as a base class for minimal core SDL drivers.
- */
-class Fl_PicoSDL_Graphics_Driver : public Fl_Pico_Graphics_Driver {
-protected:
- // CGContextRef gc_;
-public:
- // virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
- // virtual void *gc() {return gc_;}
- // char can_do_alpha_blending();
- //
- // // --- bitmap stuff
- // Fl_Bitmask create_bitmask(int w, int h, const uchar *array);
- // void delete_bitmask(Fl_Bitmask bm);
- // void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
- // void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
- // void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
- // void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
- // void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
- // void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
- // void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
- // void cache(Fl_Pixmap *img);
- // void cache(Fl_Bitmap *img);
- // void cache(Fl_RGB_Image *img);
- // void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_);
- // void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
- // void draw_CGImage(CGImageRef cgimg, int x, int y, int w, int h, int srcx, int srcy, int sw, int sh);
- //protected:
- // // --- implementation is in src/fl_rect.cxx which includes src/cfg_gfx/quartz_rect.cxx
- void point(int x, int y);
- // void rect(int x, int y, int w, int h);
- void rectf(int x, int y, int w, int h);
- void line(int x, int y, int x1, int y1);
- // void line(int x, int y, int x1, int y1, int x2, int y2);
- void xyline(int x, int y, int x1) { line(x, y, x1, y); }
- // void xyline(int x, int y, int x1, int y2);
- // void xyline(int x, int y, int x1, int y2, int x3);
- void yxline(int x, int y, int y1) { line(x, y, x, y1); }
- // void yxline(int x, int y, int y1, int x2);
- // void yxline(int x, int y, int y1, int x2, int y3);
- // void loop(int x0, int y0, int x1, int y1, int x2, int y2);
- // void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
- // void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
- // void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
- // // --- clipping
- // void push_clip(int x, int y, int w, int h);
- // int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
- // int not_clipped(int x, int y, int w, int h);
- // void push_no_clip();
- // void pop_clip();
- // void restore_clip();
- // // --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
- // void begin_complex_polygon();
- // void transformed_vertex(double xf, double yf);
- // void vertex(double x, double y);
- // void end_points();
- // void end_line();
- // void end_loop();
- // void end_polygon();
- // void end_complex_polygon();
- // void gap();
- // void circle(double x, double y, double r);
- // // --- implementation is in src/fl_arc.cxx which includes src/cfg_gfx/xxx_arc.cxx if needed
- // // using void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double end);
- // // --- implementation is in src/fl_arci.cxx which includes src/cfg_gfx/xxx_arci.cxx
- // void arc(int x, int y, int w, int h, double a1, double a2);
- // void pie(int x, int y, int w, int h, double a1, double a2);
- // // --- implementation is in src/fl_line_style.cxx which includes src/cfg_gfx/xxx_line_style.cxx
- // void line_style(int style, int width=0, char* dashes=0);
- // // --- implementation is in src/fl_color.cxx which includes src/cfg_gfx/xxx_color.cxx
- // void color(Fl_Color c);
- // Fl_Color color() { return color_; }
- // void color(uchar r, uchar g, uchar b);
- // // --- implementation is in src/fl_font.cxx which includes src/cfg_gfx/xxx_font.cxx
- // void draw(const char *str, int n, int x, int y);
- // void draw(const char *str, int n, float x, float y);
- // void draw(int angle, const char *str, int n, int x, int y);
- // void rtl_draw(const char *str, int n, int x, int y);
- // void font(Fl_Font face, Fl_Fontsize fsize);
- // double width(const char *str, int n);
- // double width(unsigned int c);
- // void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
- // int height();
- // int descent();
-};
-
-#endif // FL_PICOSDL_GRAPHICS_DRIVER_H
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx
deleted file mode 100644
index 0257e1f4c..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2018 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include <config.h>
-#include "Fl_PicoSDL_Graphics_Driver.H"
-
-#include "Fl_PicoSDL_Screen_Driver.H"
-#include <FL/platform.H>
-#include "../../Fl_Window_Driver.H"
-
-#include <FL/Fl.H>
-#define __APPLE__
-#include <SDL2/SDL.h>
-#undef __APPLE__
-
-extern Window fl_window;
-
-
-/*
- By linking this module, the following static method will instantiate the
- PicoSDL Graphics driver as the main display driver.
- */
-Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver()
-{
- return new Fl_PicoSDL_Graphics_Driver();
-}
-
-
-void Fl_PicoSDL_Graphics_Driver::rectf(int x, int y, int w, int h)
-{
- uchar r, g, b;
- Fl::get_color(Fl_Graphics_Driver::color(), r, g, b);
- SDL_SetRenderDrawColor((SDL_Renderer*)fl_window, r, g, b, SDL_ALPHA_OPAQUE);
- SDL_Rect rect = {x, y, w, h};
- SDL_RenderFillRect((SDL_Renderer*)fl_window, &rect);
-}
-
-
-void Fl_PicoSDL_Graphics_Driver::line(int x, int y, int x1, int y1)
-{
- uchar r, g, b;
- Fl::get_color(Fl_Graphics_Driver::color(), r, g, b);
- SDL_SetRenderDrawColor((SDL_Renderer*)fl_window, r, g, b, SDL_ALPHA_OPAQUE);
- SDL_RenderDrawLine((SDL_Renderer*)fl_window, x, y, x1, y1);
-}
-
-
-void Fl_PicoSDL_Graphics_Driver::point(int x, int y)
-{
- uchar r, g, b;
- Fl::get_color(Fl_Graphics_Driver::color(), r, g, b);
- SDL_SetRenderDrawColor((SDL_Renderer*)fl_window, r, g, b, SDL_ALPHA_OPAQUE);
- SDL_RenderDrawPoint((SDL_Renderer*)fl_window, x, y);
-}
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Image_Surface.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Image_Surface.cxx
deleted file mode 100644
index 8b1378917..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Image_Surface.cxx
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H
deleted file mode 100644
index 54b47a182..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// Definition of SDL Screen interface based on Pico
-// for the Fast Light Tool Kit (FLTK).
-//
-// 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-/**
- \file Fl_PicoSDL_Screen_Driver.H
- \brief Definition of SDL Screen interface based on Pico.
- */
-
-#ifndef FL_PICOSDL_SCREEN_DRIVER_H
-#define FL_PICOSDL_SCREEN_DRIVER_H
-
-#include "../Pico/Fl_Pico_Screen_Driver.H"
-
-
-class FL_EXPORT Fl_PicoSDL_Screen_Driver : public Fl_Pico_Screen_Driver
-{
-public:
- Fl_PicoSDL_Screen_Driver();
- virtual ~Fl_PicoSDL_Screen_Driver();
- virtual double wait(double time_to_wait);
-};
-
-
-#endif // FL_PICOSDL_SCREEN_DRIVER_H
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx
deleted file mode 100644
index 58759a7ad..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// Definition of SDL Screen interface based on Pico
-//
-// Copyright 1998-2018 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include <config.h>
-#include "Fl_PicoSDL_Screen_Driver.H"
-
-#include <FL/platform.H>
-#include "../../Fl_Window_Driver.H"
-
-#define __APPLE__
-#include <SDL2/SDL.h>
-#undef __APPLE__
-
-
-// FIXME: does that have to be here?
-Window fl_window;
-
-
-Fl_Screen_Driver* Fl_Screen_Driver::newScreenDriver()
-{
- return new Fl_PicoSDL_Screen_Driver();
-}
-
-
-Fl_PicoSDL_Screen_Driver::Fl_PicoSDL_Screen_Driver()
-{
-}
-
-
-Fl_PicoSDL_Screen_Driver::~Fl_PicoSDL_Screen_Driver()
-{
-}
-
-
-double Fl_PicoSDL_Screen_Driver::wait(double time_to_wait)
-{
- Fl::flush();
- SDL_Event e;
- Fl_Window *window = Fl::first_window();
- if (SDL_PollEvent(&e)) {
- switch (e.type) {
- case SDL_QUIT:
- exit(0);
- case SDL_WINDOWEVENT:
- switch (e.window.event) {
- case SDL_WINDOWEVENT_EXPOSED:
- case SDL_WINDOWEVENT_SHOWN:
- {
- if ( !window ) break;;
- Fl_Window_Driver *wd = window->driver();
- Fl_X *i = Fl_X::i(Fl::first_window());
- wd->wait_for_expose_value = 0;
- if ( i->region ) {
- fl_graphics_driver->XDestroyRegion(i->region);
- i->region = 0;
- }
- window->clear_damage(FL_DAMAGE_ALL);
- wd->flush();
- window->clear_damage();
- wd->wait_for_expose_value = 0;
- }
- break;
- }
- case SDL_MOUSEBUTTONDOWN:
- if (!window) break;
- Fl::e_is_click = e.button.clicks;
- Fl::e_x = e.button.x;
- Fl::e_y = e.button.y;
- Fl::e_x_root = e.button.x + window->x();
- Fl::e_y_root = e.button.y + window->y();
- switch (e.button.button) {
- case SDL_BUTTON_LEFT: Fl::e_keysym = FL_Button+FL_LEFT_MOUSE; Fl::e_state |= FL_BUTTON1; break;
- case SDL_BUTTON_MIDDLE: Fl::e_keysym = FL_Button+FL_MIDDLE_MOUSE; Fl::e_state |= FL_BUTTON2; break;
- case SDL_BUTTON_RIGHT: Fl::e_keysym = FL_Button+FL_RIGHT_MOUSE; Fl::e_state |= FL_BUTTON3; break;
- }
- Fl::handle(FL_PUSH, window);
- break;
- case SDL_MOUSEBUTTONUP:
- if (!window) break;
- Fl::e_is_click = e.button.clicks;
- Fl::e_x = e.button.x;
- Fl::e_y = e.button.y;
- Fl::e_x_root = e.button.x + window->x();
- Fl::e_y_root = e.button.y + window->y();
- switch (e.button.button) {
- case SDL_BUTTON_LEFT: Fl::e_keysym = FL_Button+FL_LEFT_MOUSE; Fl::e_state &= ~FL_BUTTON1; break;
- case SDL_BUTTON_MIDDLE: Fl::e_keysym = FL_Button+FL_MIDDLE_MOUSE; Fl::e_state &= ~FL_BUTTON2; break;
- case SDL_BUTTON_RIGHT: Fl::e_keysym = FL_Button+FL_RIGHT_MOUSE; Fl::e_state &= ~FL_BUTTON3; break;
- }
- Fl::handle(FL_RELEASE, window);
- break;
- case SDL_MOUSEMOTION: // SDL_BUTTON_LMASK
- if (!window) break;
- Fl::e_is_click = e.motion.state;
- Fl::e_x = e.motion.x;
- Fl::e_y = e.motion.y;
- Fl::e_x_root = e.motion.x + window->x();
- Fl::e_y_root = e.motion.y + window->y();
- if (e.motion.state & SDL_BUTTON_LMASK) Fl::e_state |= FL_BUTTON1; else Fl::e_state &= ~FL_BUTTON1;
- if (e.motion.state & SDL_BUTTON_MMASK) Fl::e_state |= FL_BUTTON2; else Fl::e_state &= ~FL_BUTTON2;
- if (e.motion.state & SDL_BUTTON_RMASK) Fl::e_state |= FL_BUTTON3; else Fl::e_state &= ~FL_BUTTON3;
- if ((e.motion.state & (SDL_BUTTON_LMASK|SDL_BUTTON_MMASK|SDL_BUTTON_RMASK)) == 0 )
- Fl::handle(FL_MOVE, window);
- else
- Fl::handle(FL_DRAG, window);
- break;
- case SDL_MOUSEWHEEL:
- break;
- case SDL_KEYDOWN: // full keyboard support is a lot more complex
- case SDL_KEYUP:
- if (e.type==SDL_KEYDOWN) Fl::e_number = FL_KEYDOWN; else Fl::e_number = FL_KEYUP;
- if (!window) break;
- if (e.key.keysym.sym==SDLK_ESCAPE) {
- Fl::e_keysym = FL_Escape;
- Fl::handle(Fl::e_number, window);
- }
- break;
- }
- }
- return 0.0;
-}
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.H
deleted file mode 100644
index 8b1378917..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.H
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx
deleted file mode 100644
index d6d60b31b..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System routines for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include <config.h>
-#include "../../Fl_System_Driver.H"
-//#include "Fl_PicoSDL_System_Driver.h"
-
-
-/*
- By linking this module, the following static method will instantiate the
- PicoSDL Graphics driver as the main display driver.
- */
-Fl_System_Driver *Fl_System_Driver::newSystemDriver()
-{
- return new Fl_System_Driver();
-}
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H
deleted file mode 100644
index 8714285dc..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// Definition of SDL Window interface
-// for the Fast Light Tool Kit (FLTK).
-//
-// 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-/**
- \file Fl_PicoSDL_Window_Driver.H
- \brief Definition of SDL Window interface.
- */
-
-#ifndef FL_PICOSDL_WINDOW_DRIVER_H
-#define FL_PICOSDL_WINDOW_DRIVER_H
-
-#include "../Pico/Fl_Pico_Window_Driver.H"
-
-#define __APPLE__
-#include <SDL2/SDL.h>
-#undef __APPLE__
-
-
-class FL_EXPORT Fl_PicoSDL_Window_Driver : public Fl_Pico_Window_Driver
-{
- SDL_Window *pNativeWindow;
- SDL_Texture *pNativeTexture;
-public:
- Fl_PicoSDL_Window_Driver(Fl_Window *win);
- virtual ~Fl_PicoSDL_Window_Driver();
-
- virtual void show();
- virtual Fl_X *makeWindow();
- virtual void make_current();
- virtual void draw_end();
-
- // --- window management
-// virtual void flush();
-};
-
-
-#endif // FL_PICOSDL_WINDOW_DRIVER_H
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
deleted file mode 100644
index f1014370f..000000000
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// Definition of SDL Window interface based on SDL
-//
-// Copyright 1998-2018 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
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include <config.h>
-#include "Fl_PicoSDL_Window_Driver.H"
-
-#include <FL/platform.H>
-#include <FL/Fl.H>
-#include <FL/Fl_Window.H>
-
-
-Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *win)
-{
- return new Fl_PicoSDL_Window_Driver(win);
-}
-
-
-Fl_PicoSDL_Window_Driver::Fl_PicoSDL_Window_Driver(Fl_Window *win)
-: Fl_Pico_Window_Driver(win)
-{
-}
-
-
-Fl_PicoSDL_Window_Driver::~Fl_PicoSDL_Window_Driver()
-{
-}
-
-
-Fl_X *Fl_PicoSDL_Window_Driver::makeWindow()
-{
- Fl_Group::current(0);
- if (parent() && !Fl_X::i(pWindow->window())) {
- pWindow->set_visible();
- return 0L;
- }
- Window parent;
- if (this->parent()) {
- parent = fl_xid(pWindow->window());
- } else {
- parent = 0;
- }
- Fl_X *x = new Fl_X;
- other_xid = 0;
- x->w = pWindow;
- x->region = 0;
- if (!pWindow->force_position()) {
- pNativeWindow = SDL_CreateWindow(pWindow->label(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w(), h(), 0);
- } else {
- pNativeWindow = SDL_CreateWindow(pWindow->label(), pWindow->x(), pWindow->y(), pWindow->w(), pWindow->h(), 0);
- }
- x->xid = SDL_CreateRenderer(pNativeWindow, -1, SDL_RENDERER_ACCELERATED);
- pNativeTexture = SDL_CreateTexture((SDL_Renderer*)x->xid, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_TARGET, w(), h());
- x->next = Fl_X::first;
- wait_for_expose_value = 0;
- pWindow->i = x;
- Fl_X::first = x;
-
- pWindow->set_visible();
- pWindow->redraw();
- pWindow->flush();
- int old_event = Fl::e_number;
- pWindow->handle(Fl::e_number = FL_SHOW);
- Fl::e_number = old_event;
-
- return x;
-}
-
-
-void Fl_PicoSDL_Window_Driver::draw_end()
-{
- Fl_X *i = Fl_X::i(pWindow);
- SDL_SetRenderTarget((SDL_Renderer*)pWindow->i->xid, 0L);
- //SDL_RenderClear((SDL_Renderer*)i->xid);
- SDL_RenderCopy((SDL_Renderer*)i->xid, pNativeTexture, 0L, 0L);
- SDL_RenderPresent((SDL_Renderer*)i->xid);
-}
-
-
-void Fl_PicoSDL_Window_Driver::make_current()
-{
- fl_window = pWindow->i->xid;
- SDL_SetRenderTarget((SDL_Renderer*)pWindow->i->xid, pNativeTexture);
-}
-
-
-void Fl_PicoSDL_Window_Driver::show() {
- if (!shown()) {
- makeWindow();
- }
-}