2010-09-25 17:46:12 +02:00
|
|
|
#ifndef __GTK_DISPLAY_DRIVER_H
|
|
|
|
#define __GTK_DISPLAY_DRIVER_H
|
|
|
|
|
|
|
|
#include "gtk_s9x.h"
|
|
|
|
|
|
|
|
class S9xDisplayDriver
|
|
|
|
{
|
|
|
|
public:
|
2014-02-05 10:22:07 +01:00
|
|
|
virtual ~S9xDisplayDriver() {}
|
2010-09-25 17:46:12 +02:00
|
|
|
virtual void refresh (int width, int height) = 0;
|
|
|
|
virtual int init (void) = 0;
|
|
|
|
virtual void deinit (void) = 0;
|
|
|
|
virtual void clear_buffers (void) = 0;
|
2018-05-05 00:12:22 +02:00
|
|
|
virtual void update (int width, int height, int yoffset) = 0;
|
2010-09-25 17:46:12 +02:00
|
|
|
virtual uint16 *get_next_buffer (void) = 0;
|
|
|
|
virtual uint16 *get_current_buffer (void) = 0;
|
|
|
|
virtual void push_buffer (uint16 *src) = 0;
|
|
|
|
virtual void reconfigure (int width, int height) = 0;
|
|
|
|
|
|
|
|
/* Namespaced sizing constants */
|
2011-01-23 23:25:46 +01:00
|
|
|
static const int image_width = 1024;
|
2010-09-25 17:46:12 +02:00
|
|
|
static const int image_height = 478;
|
|
|
|
static const int image_bpp = 2;
|
|
|
|
static const int scaled_max_width = 1024;
|
|
|
|
static const int scaled_max_height = 956;
|
|
|
|
|
|
|
|
static const int image_size = image_width * image_height * image_bpp;
|
|
|
|
static const int image_padded_size = (image_width + 8) *
|
2018-05-05 00:12:22 +02:00
|
|
|
(image_height + 8 + 30) *
|
2010-09-25 17:46:12 +02:00
|
|
|
image_bpp;
|
2018-05-05 00:12:22 +02:00
|
|
|
static const int image_padded_offset = (image_width + 8) * (4 + 30) + 4;
|
2010-09-25 17:46:12 +02:00
|
|
|
static const int scaled_size = scaled_max_width *
|
|
|
|
scaled_max_height *
|
|
|
|
image_bpp;
|
|
|
|
static const int scaled_padded_size = (scaled_max_width + 8) *
|
|
|
|
(scaled_max_height + 8) *
|
|
|
|
image_bpp;
|
2018-05-05 00:12:22 +02:00
|
|
|
static const int scaled_padded_offset = (scaled_max_width + 8) * 4 + 4;
|
2010-09-25 17:46:12 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
Snes9xWindow *window;
|
|
|
|
Snes9xConfig *config;
|
|
|
|
GtkWidget *drawing_area;
|
|
|
|
void *padded_buffer[4];
|
|
|
|
void *buffer[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __GTK_DISPLAY_DRIVER_H*/
|