1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus-core - m64p_vidext.h *
3 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4 * Copyright (C) 2009 Richard Goedeken *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22 /* This header file defines typedefs for function pointers to the core's
23 * video extension functions.
26 #if !defined(M64P_VIDEXT_H)
29 #include "m64p_types.h"
37 * This function should be called from within the InitiateGFX() video plugin
38 * function call. The default SDL implementation of this function simply calls
39 * SDL_InitSubSystem(SDL_INIT_VIDEO). It does not open a rendering window or
42 typedef m64p_error (*ptr_VidExt_Init)(void);
43 #if defined(M64P_CORE_PROTOTYPES)
44 EXPORT m64p_error CALL VidExt_Init(void);
49 * This function closes any open rendering window and shuts down the video
50 * system. The default SDL implementation of this function calls
51 * SDL_QuitSubSystem(SDL_INIT_VIDEO). This function should be called from
52 * within the RomClose() video plugin function.
54 typedef m64p_error (*ptr_VidExt_Quit)(void);
55 #if defined(M64P_CORE_PROTOTYPES)
56 EXPORT m64p_error CALL VidExt_Quit(void);
59 /* VidExt_ListFullscreenModes()
61 * This function is used to enumerate the available resolutions for fullscreen
62 * video modes. A pointer to an array is passed into the function, which is
63 * then filled with resolution sizes.
65 typedef m64p_error (*ptr_VidExt_ListFullscreenModes)(m64p_2d_size *, int *);
66 #if defined(M64P_CORE_PROTOTYPES)
67 EXPORT m64p_error CALL VidExt_ListFullscreenModes(m64p_2d_size *, int *);
70 /* VidExt_SetVideoMode()
72 * This function creates a rendering window or switches into a fullscreen
73 * video mode. Any desired OpenGL attributes should be set before calling
76 typedef m64p_error (*ptr_VidExt_SetVideoMode)(int, int, int, m64p_video_mode, m64p_video_flags);
77 #if defined(M64P_CORE_PROTOTYPES)
78 EXPORT m64p_error CALL VidExt_SetVideoMode(int, int, int, m64p_video_mode, m64p_video_flags);
81 /* VidExt_ResizeWindow()
83 * This function resizes the opengl rendering window to match the given size.
85 typedef m64p_error (*ptr_VidExt_ResizeWindow)(int, int);
86 #if defined(M64P_CORE_PROTOTYPES)
87 EXPORT m64p_error CALL VidExt_ResizeWindow(int, int);
90 /* VidExt_SetCaption()
92 * This function sets the caption text of the emulator rendering window.
94 typedef m64p_error (*ptr_VidExt_SetCaption)(const char *);
95 #if defined(M64P_CORE_PROTOTYPES)
96 EXPORT m64p_error CALL VidExt_SetCaption(const char *);
99 /* VidExt_ToggleFullScreen()
101 * This function toggles between fullscreen and windowed rendering modes.
103 typedef m64p_error (*ptr_VidExt_ToggleFullScreen)(void);
104 #if defined(M64P_CORE_PROTOTYPES)
105 EXPORT m64p_error CALL VidExt_ToggleFullScreen(void);
108 /* VidExt_GL_GetProcAddress()
110 * This function is used to get a pointer to an OpenGL extension function. This
111 * is only necessary on the Windows platform, because the OpenGL implementation
112 * shipped with Windows only supports OpenGL version 1.1.
114 typedef void * (*ptr_VidExt_GL_GetProcAddress)(const char *);
115 #if defined(M64P_CORE_PROTOTYPES)
116 EXPORT void * CALL VidExt_GL_GetProcAddress(const char *);
119 /* VidExt_GL_SetAttribute()
121 * This function is used to set certain OpenGL attributes which must be
122 * specified before creating the rendering window with VidExt_SetVideoMode.
124 typedef m64p_error (*ptr_VidExt_GL_SetAttribute)(m64p_GLattr, int);
125 #if defined(M64P_CORE_PROTOTYPES)
126 EXPORT m64p_error CALL VidExt_GL_SetAttribute(m64p_GLattr, int);
129 /* VidExt_GL_GetAttribute()
131 * This function is used to get the value of OpenGL attributes. These values may
132 * be changed when calling VidExt_SetVideoMode.
134 typedef m64p_error (*ptr_VidExt_GL_GetAttribute)(m64p_GLattr, int *);
135 #if defined(M64P_CORE_PROTOTYPES)
136 EXPORT m64p_error CALL VidExt_GL_GetAttribute(m64p_GLattr, int *);
139 /* VidExt_GL_SwapBuffers()
141 * This function is used to swap the front/back buffers after rendering an
142 * output video frame.
144 typedef m64p_error (*ptr_VidExt_GL_SwapBuffers)(void);
145 #if defined(M64P_CORE_PROTOTYPES)
146 EXPORT m64p_error CALL VidExt_GL_SwapBuffers(void);
153 #endif /* #define M64P_VIDEXT_H */