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 struct SDL_OpenGL {
00042     bool inited;
00043     Bitu pitch;
00044     void * framebuf;
00045     GLuint buffer;
00046     GLuint texture;
00047     GLuint displaylist;
00048     GLint max_texsize;
00049     bool bilinear;
00050     bool packed_pixel;
00051     bool paletted_texture;
00052     bool pixel_buffer_object;
00053     int menudraw_countdown;
00054     int clear_countdown;
00055 };
00056 
00057 extern SDL_OpenGL sdl_opengl;
00058 
00059 // output API
00060 void OUTPUT_OPENGL_Initialize();
00061 void OUTPUT_OPENGL_Select();
00062 Bitu OUTPUT_OPENGL_GetBestMode(Bitu flags);
00063 Bitu OUTPUT_OPENGL_SetSize();
00064 bool OUTPUT_OPENGL_StartUpdate(Bit8u* &pixels, Bitu &pitch);
00065 void OUTPUT_OPENGL_EndUpdate(const Bit16u *changedLines);
00066 void OUTPUT_OPENGL_Shutdown();
00067 
00068 #endif //C_OPENGL
00069 
00070 #endif /*DOSBOX_OUTPUT_OPENGL_H*/