1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

Add this half-finished (okay, 5%-finished) driver.

This commit is contained in:
Alcaro 2015-10-11 09:50:01 +02:00
parent 1f40c2a6d1
commit f4a5cbbe5b
4 changed files with 85 additions and 1 deletions

View File

@ -703,6 +703,12 @@ ifeq ($(HAVE_XVIDEO), 1)
DEFINES += $(XVIDEO_CFLAGS)
endif
ifeq ($(HAVE_XSHM), 1)
OBJ += gfx/drivers/xshm.o
LIBS += $(XSHM_LIBS)
DEFINES += $(XSHM_CFLAGS)
endif
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o

74
gfx/drivers/xshm.c Normal file
View File

@ -0,0 +1,74 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "../../driver.h"
#include "../../general.h"
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <math.h>
#include "../video_viewport.h"
#include "../video_monitor.h"
#include "../font_renderer_driver.h"
#include <retro_inline.h>
#include "../common/x11_common.h"
#include <stdlib.h>
/*#include <sys/ipc.h>*/
#include <sys/shm.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XShm.h>
typedef struct xshm
{
Display* display;
int screen;
Window parentwindow;
Window wndw;
unsigned int width;
unsigned int height;
unsigned int pitch;
videoformat bpp;
XShmSegmentInfo shmInfo;
XImage* image;
GC gc;
} xshm_t;
video_driver_t video_xshm = {
NULL,/*xshm_init,*/
NULL,/*xshm_frame,*/
NULL,/*xshm_set_nonblock_state,*/
NULL,/*xshm_alive,*/
NULL,/*xshm_focus,*/
NULL,/*xshm_suppress_screensaver,*/
NULL,/*xshm_has_windowed,*/
NULL,/*xshm_set_shader,*/
NULL,/*xshm_free,*/
"xshm",
NULL, /* set_viewport */
NULL,/*xshm_set_rotation,*/
NULL,/*xshm_viewport_info,*/
NULL,/*xshm_read_viewport,*/
NULL, /* read_frame_raw */
#ifdef HAVE_OVERLAY
NULL, /* overlay_interface */
#endif
NULL/*xshm_get_poke_interface*/
};

View File

@ -204,6 +204,7 @@ extern video_driver_t video_omap;
extern video_driver_t video_exynos;
extern video_driver_t video_dispmanx;
extern video_driver_t video_sunxi;
extern video_driver_t video_xshm;
extern video_driver_t video_null;
enum rarch_display_type

View File

@ -353,7 +353,7 @@ fi
check_pkgconf FREETYPE freetype2
check_pkgconf X11 x11
[ "$HAVE_X11" = "no" ] && HAVE_XEXT=no && HAVE_XF86VM=no && HAVE_XINERAMA=no
[ "$HAVE_X11" = "no" ] && HAVE_XEXT=no && HAVE_XF86VM=no && HAVE_XINERAMA=no && HAVE_XSHM=no
check_pkgconf WAYLAND wayland-egl
@ -377,6 +377,9 @@ if [ "$HAVE_UDEV" != "no" ]; then
fi
fi
#this one is broken (XShm.h requires some other X headers first), but xshm itself doesn't work either, so it's okay
check_header XSHM X11/extensions/XShm.h
check_header PARPORT linux/parport.h
check_header PARPORT linux/ppdev.h