mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Perform evil experiments (run this driver in a completely different program)
This commit is contained in:
parent
cc6fe3159f
commit
3f105fe71f
@ -14,6 +14,8 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define _XOPEN_SOURCE 600 // TODO: this doesn't really belong here.
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -62,14 +64,20 @@ static void *xshm_gfx_init(const video_info_t *video,
|
|||||||
const input_driver_t **input, void **input_data)
|
const input_driver_t **input, void **input_data)
|
||||||
{
|
{
|
||||||
xshm_t* xshm = (xshm_t*)malloc(sizeof(xshm_t));
|
xshm_t* xshm = (xshm_t*)malloc(sizeof(xshm_t));
|
||||||
|
Window parent;
|
||||||
|
|
||||||
XInitThreads();
|
XInitThreads();
|
||||||
|
|
||||||
xshm->display = XOpenDisplay(NULL);
|
xshm->display = XOpenDisplay(NULL);
|
||||||
|
|
||||||
|
#ifdef RARCH_INTERNAL
|
||||||
|
parent = DefaultRootWindow(xshm->display);
|
||||||
|
#else
|
||||||
|
parent = video->parent;
|
||||||
|
#endif
|
||||||
XSetWindowAttributes attributes;
|
XSetWindowAttributes attributes;
|
||||||
attributes.border_pixel=0;
|
attributes.border_pixel=0;
|
||||||
xshm->wndw = XCreateWindow(xshm->display, DefaultRootWindow(xshm->display)/*xshm->parentwindow*/,
|
xshm->wndw = XCreateWindow(xshm->display, parent,
|
||||||
0, 0, video->width, video->height,
|
0, 0, video->width, video->height,
|
||||||
0, 24, CopyFromParent, NULL, CWBorderPixel, &attributes);
|
0, 24, CopyFromParent, NULL, CWBorderPixel, &attributes);
|
||||||
XSetWindowBackground(xshm->display, xshm->wndw, 0);
|
XSetWindowBackground(xshm->display, xshm->wndw, 0);
|
||||||
@ -91,8 +99,8 @@ static void *xshm_gfx_init(const video_info_t *video,
|
|||||||
xshm->width = video->width;
|
xshm->width = video->width;
|
||||||
xshm->height = video->height;
|
xshm->height = video->height;
|
||||||
|
|
||||||
*input = NULL;
|
if (input) *input = NULL;
|
||||||
*input_data = NULL;
|
if (input_data) *input_data = NULL;
|
||||||
|
|
||||||
return xshm;
|
return xshm;
|
||||||
}
|
}
|
||||||
@ -102,7 +110,7 @@ static bool xshm_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
unsigned pitch, const char *msg)
|
unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
xshm_t* xshm = (xshm_t*)data;
|
xshm_t* xshm = (xshm_t*)data;
|
||||||
int x, y;
|
int y;
|
||||||
|
|
||||||
for (y=0;y<height;y++)
|
for (y=0;y<height;y++)
|
||||||
{
|
{
|
||||||
|
@ -123,6 +123,10 @@ typedef struct video_info
|
|||||||
|
|
||||||
/* Use 32bit RGBA rather than native RGB565/XBGR1555. */
|
/* Use 32bit RGBA rather than native RGB565/XBGR1555. */
|
||||||
bool rgb32;
|
bool rgb32;
|
||||||
|
|
||||||
|
#ifndef RARCH_INTERNAL
|
||||||
|
uintptr_t parent;
|
||||||
|
#endif
|
||||||
} video_info_t;
|
} video_info_t;
|
||||||
|
|
||||||
#define FONT_COLOR_RGBA(r, g, b, a) (((unsigned)(r) << 24) | ((g) << 16) | ((b) << 8) | ((a) << 0))
|
#define FONT_COLOR_RGBA(r, g, b, a) (((unsigned)(r) << 24) | ((g) << 16) | ((b) << 8) | ((a) << 0))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user