snes9x/gtk/src/gtk_display_driver.h

56 lines
2.3 KiB
C
Raw Normal View History

/*****************************************************************************\
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_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 () = 0;
virtual void deinit () = 0;
virtual void clear_buffers () = 0;
2018-05-05 00:12:22 +02:00
virtual void update (int width, int height, int yoffset) = 0;
virtual uint16 *get_next_buffer () = 0;
virtual uint16 *get_current_buffer () = 0;
2010-09-25 17:46:12 +02:00
virtual void push_buffer (uint16 *src) = 0;
virtual void *get_parameters () = 0;
2018-05-13 18:02:52 +02:00
virtual void save (const char *filename) = 0;
2010-09-25 17:46:12 +02:00
/* Namespaced sizing constants */
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*/