DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/output/output_opengl.h
00001 #include "dosbox.h"
00002 
00003 #ifndef DOSBOX_OUTPUT_OPENGL_H
00004 #define DOSBOX_OUTPUT_OPENGL_H
00005 
00006 #if C_OPENGL
00007 #include "SDL_opengl.h"
00008 
00009 #ifndef APIENTRY
00010 #define APIENTRY
00011 #endif
00012 #ifndef APIENTRYP
00013 #define APIENTRYP APIENTRY *
00014 #endif
00015 
00016 #ifndef GL_ARB_pixel_buffer_object
00017 #define GL_ARB_pixel_buffer_object 1
00018 #define GL_PIXEL_PACK_BUFFER_ARB           0x88EB
00019 #define GL_PIXEL_UNPACK_BUFFER_ARB         0x88EC
00020 #define GL_PIXEL_PACK_BUFFER_BINDING_ARB   0x88ED
00021 #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
00022 #endif
00023 
00024 #ifndef GL_ARB_vertex_buffer_object
00025 #define GL_ARB_vertex_buffer_object 1
00026 typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
00027 typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
00028 typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
00029 typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
00030 typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
00031 typedef GLboolean(APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
00032 #endif
00033 
00034 extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
00035 extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
00036 extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
00037 extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
00038 extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
00039 extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
00040 
00041 #if defined(C_SDL2)
00042 # include <SDL_video.h>
00043 #endif
00044 
00045 struct SDL_OpenGL {
00046     bool inited;
00047     Bitu pitch;
00048     void * framebuf;
00049     GLuint buffer;
00050     GLuint texture;
00051     GLuint displaylist;
00052     GLint max_texsize;
00053     bool bilinear;
00054     bool packed_pixel;
00055     bool paletted_texture;
00056     bool pixel_buffer_object;
00057     int menudraw_countdown;
00058     int clear_countdown;
00059 #if defined(C_SDL2)
00060     SDL_GLContext context = NULL;
00061 #endif
00062 };
00063 
00064 extern SDL_OpenGL sdl_opengl;
00065 
00066 // output API
00067 void OUTPUT_OPENGL_Initialize();
00068 void OUTPUT_OPENGL_Select();
00069 Bitu OUTPUT_OPENGL_GetBestMode(Bitu flags);
00070 Bitu OUTPUT_OPENGL_SetSize();
00071 bool OUTPUT_OPENGL_StartUpdate(Bit8u* &pixels, Bitu &pitch);
00072 void OUTPUT_OPENGL_EndUpdate(const Bit16u *changedLines);
00073 void OUTPUT_OPENGL_Shutdown();
00074 
00075 #endif //C_OPENGL
00076 
00077 #endif /*DOSBOX_OUTPUT_OPENGL_H*/