1 module m64p_vidext;
2 
3 import m64p_types;
4 
5 @nogc nothrow __gshared extern(C):
6 
7     /* VidExt_Init()
8     *
9     * This function should be called from within the InitiateGFX() video plugin
10     * function call. The default SDL implementation of this function simply calls
11     * SDL_InitSubSystem(SDL_INIT_VIDEO). It does not open a rendering window or
12     * switch video modes.
13     */
14     m64p_error function() VidExt_Init;
15 
16     /* VidExt_Quit()
17     *
18     * This function closes any open rendering window and shuts down the video
19     * system. The default SDL implementation of this function calls
20     * SDL_QuitSubSystem(SDL_INIT_VIDEO). This function should be called from
21     * within the RomClose() video plugin function.
22     */
23     m64p_error function() VidExt_Quit;
24 
25     /* VidExt_ListFullscreenModes()
26     *
27     * This function is used to enumerate the available resolutions for fullscreen
28     * video modes. A pointer to an array is passed into the function, which is
29     * then filled with resolution sizes.
30     */
31     m64p_error function(m64p_2d_size*, int*) VidExt_ListFullscreenModes;
32 
33     /* VidExt_ListFullscreenRates()
34     *
35     * This function is used to enumerate the available refresh rates for a fullscreen
36     * video mode.
37     */
38     m64p_error function(m64p_2d_size, int*, int*) VidExt_ListFullscreenRates;
39 
40     /* VidExt_SetVideoMode()
41     *
42     * This function creates a rendering window or switches into a fullscreen
43     * video mode. Any desired OpenGL attributes should be set before calling
44     * this function.
45     */
46     m64p_error function(int, int, int, m64p_video_mode, m64p_video_flags) VidExt_SetVideoMode;
47 
48     /* VidExt_SetVideoModeWithRate()
49     *
50     * This function creates a rendering window or switches into a fullscreen
51     * video mode. Any desired OpenGL attributes should be set before calling
52     * this function.
53     */
54     m64p_error function(int, int, int, int, m64p_video_mode, m64p_video_flags) VidExt_SetVideoModeWithRate;
55 
56     /* VidExt_ResizeWindow()
57     *
58     * This function resizes the opengl rendering window to match the given size.
59     */
60     m64p_error function(int, int) VidExt_ResizeWindow;
61 
62     /* VidExt_SetCaption()
63     *
64     * This function sets the caption text of the emulator rendering window.
65     */
66     m64p_error function(const char*) VidExt_SetCaption;
67 
68     /* VidExt_ToggleFullScreen()
69     *
70     * This function toggles between fullscreen and windowed rendering modes.
71     */
72     m64p_error function() VidExt_ToggleFullScreen;
73 
74     /* VidExt_GL_GetProcAddress()
75     *
76     * This function is used to get a pointer to an OpenGL extension function. This
77     * is only necessary on the Windows platform, because the OpenGL implementation
78     * shipped with Windows only supports OpenGL version 1.1.
79     */
80     m64p_function function(const char*) VidExt_GL_GetProcAddress;
81 
82     /* VidExt_GL_SetAttribute()
83     *
84     * This function is used to set certain OpenGL attributes which must be
85     * specified before creating the rendering window with VidExt_SetVideoMode.
86     */
87     m64p_error function(m64p_GLattr, int) VidExt_GL_SetAttribute;
88 
89     /* VidExt_GL_GetAttribute()
90     *
91     * This function is used to get the value of OpenGL attributes.  These values may
92     * be changed when calling VidExt_SetVideoMode.
93     */
94     m64p_error function(m64p_GLattr, int*) VidExt_GL_GetAttribute;
95 
96     /* VidExt_GL_SwapBuffers()
97     *
98     * This function is used to swap the front/back buffers after rendering an
99     * output video frame.
100     */
101     m64p_error function() VidExt_GL_SwapBuffers;
102 
103     /* VidExt_GL_GetDefaultFramebuffer()
104     *
105     * On some platforms (for instance, iOS) the default framebuffer object
106     * depends on the surface being rendered to, and might be different from 0.
107     * This function should be called after VidExt_SetVideoMode to retrieve the
108     * name of the default FBO.
109     * Calling this function may have performance implications
110     * and it should not be called every time the default FBO is bound.
111     */
112     uint function() VidExt_GL_GetDefaultFramebuffer;