[retro-gtk] Introduce RetroHWRenderCallback



commit 158566e4f0ed07b140acd78d2e15032e87a5b091
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Jan 30 18:44:35 2020 +0500

    Introduce RetroHWRenderCallback
    
    This is the main struct for hardware rendering.

 retro-runner/retro-hw-render-callback-private.h | 49 +++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
---
diff --git a/retro-runner/retro-hw-render-callback-private.h b/retro-runner/retro-hw-render-callback-private.h
new file mode 100644
index 0000000..b233e8e
--- /dev/null
+++ b/retro-runner/retro-hw-render-callback-private.h
@@ -0,0 +1,49 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#pragma once
+
+#if !defined(__RETRO_GTK_INSIDE__) && !defined(RETRO_GTK_COMPILATION)
+# error "Only <retro-gtk.h> can be included directly."
+#endif
+
+#include <stdbool.h>
+#include "retro-proc-address-private.h"
+
+G_BEGIN_DECLS
+
+#define RETRO_HW_FRAME_BUFFER_VALID ((gpointer) -1)
+
+typedef struct _RetroHWRenderCallback RetroHWRenderCallback;
+
+typedef void (*RetroHWRenderCallbackContextReset) (void);
+typedef guintptr (*RetroHWRenderCallbackGetCurrentFramebuffer) (void);
+typedef RetroProcAddress (*RetroHWRenderCallbackGetProcAddress) (const gchar *sym);
+
+typedef enum {
+  RETRO_HW_CONTEXT_NONE = 0,
+  RETRO_HW_CONTEXT_OPENGL,
+  RETRO_HW_CONTEXT_OPENGLES2,
+  RETRO_HW_CONTEXT_OPENGL_CORE,
+  RETRO_HW_CONTEXT_OPENGLES3,
+  RETRO_HW_CONTEXT_OPENGLES_VERSION,
+  RETRO_HW_CONTEXT_VULKAN,
+  RETRO_HW_CONTEXT_DIRECT3D,
+  RETRO_HW_CONTEXT_DUMMY = G_MAXINT
+} RetroHWContextType;
+
+struct _RetroHWRenderCallback {
+  RetroHWContextType context_type;
+  RetroHWRenderCallbackContextReset context_reset;
+  RetroHWRenderCallbackGetCurrentFramebuffer get_current_framebuffer;
+  RetroHWRenderCallbackGetProcAddress get_proc_address;
+  bool depth;
+  bool stencil;
+  bool bottom_left_origin;
+  guint version_major;
+  guint version_minor;
+  bool cache_context;
+  RetroHWRenderCallbackContextReset context_destroy;
+  bool debug_context;
+};
+
+G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]