2018-11-16 00:42:29 +01:00
|
|
|
/*****************************************************************************\
|
|
|
|
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
|
|
|
This file is licensed under the Snes9x License.
|
|
|
|
For further information, consult the LICENSE file in the root directory.
|
|
|
|
\*****************************************************************************/
|
|
|
|
|
2010-09-25 17:46:12 +02:00
|
|
|
#ifndef __GTK_DISPLAY_DRIVER_XV_H
|
|
|
|
#define __GTK_DISPLAY_DRIVER_XV_H
|
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
2010-09-25 17:46:12 +02:00
|
|
|
#include <X11/extensions/XShm.h>
|
|
|
|
#include <X11/extensions/Xvlib.h>
|
|
|
|
|
|
|
|
#include "gtk_s9x.h"
|
|
|
|
#include "gtk_display_driver.h"
|
|
|
|
|
2018-11-02 21:47:31 +01:00
|
|
|
const uint32 FOURCC_YUY2 = 0x32595559;
|
2010-09-25 17:46:12 +02:00
|
|
|
|
|
|
|
class S9xXVDisplayDriver : public S9xDisplayDriver
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
S9xXVDisplayDriver (Snes9xWindow *window, Snes9xConfig *config);
|
|
|
|
void refresh (int width, int height);
|
2018-11-02 21:52:26 +01:00
|
|
|
int init ();
|
|
|
|
void deinit ();
|
|
|
|
void clear_buffers ();
|
2018-05-05 00:12:22 +02:00
|
|
|
void update (int width, int height, int yoffset);
|
2018-11-02 21:52:26 +01:00
|
|
|
uint16 *get_next_buffer ();
|
|
|
|
uint16 *get_current_buffer ();
|
2010-09-25 17:46:12 +02:00
|
|
|
void push_buffer (uint16 *src);
|
2018-11-02 21:52:26 +01:00
|
|
|
void *get_parameters () { return NULL; }
|
2018-05-13 18:02:52 +02:00
|
|
|
void save (const char *filename) { }
|
2018-11-02 21:52:26 +01:00
|
|
|
static int query_availability ();
|
2010-09-25 17:46:12 +02:00
|
|
|
|
|
|
|
private:
|
2018-11-02 21:52:26 +01:00
|
|
|
void clear ();
|
2010-09-25 17:46:12 +02:00
|
|
|
void update_image_size (int width, int height);
|
2010-09-26 11:19:15 +02:00
|
|
|
void resize_window (int width, int height);
|
|
|
|
void create_window (int width, int height);
|
2010-09-25 17:46:12 +02:00
|
|
|
|
|
|
|
Display *display;
|
|
|
|
Window xwindow;
|
|
|
|
Colormap xcolormap;
|
2010-09-26 11:19:15 +02:00
|
|
|
XVisualInfo *vi;
|
2010-09-25 17:46:12 +02:00
|
|
|
GdkWindow *gdk_window;
|
|
|
|
|
|
|
|
XvImage *xv_image;
|
|
|
|
int xv_portid;
|
|
|
|
XShmSegmentInfo shm;
|
|
|
|
|
|
|
|
int output_window_width;
|
|
|
|
int output_window_height;
|
|
|
|
int last_known_width;
|
|
|
|
int last_known_height;
|
|
|
|
int desired_width;
|
|
|
|
int desired_height;
|
|
|
|
int format;
|
|
|
|
int bpp;
|
|
|
|
int bytes_per_pixel;
|
|
|
|
int rshift, gshift, bshift;
|
|
|
|
|
|
|
|
uint8 y_table[65536];
|
|
|
|
uint8 u_table[65536];
|
|
|
|
uint8 v_table[65536];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __GTK_DISPLAY_DRIVER_XV_H */
|