diff options
Diffstat (limited to 'mesalib/include')
-rw-r--r-- | mesalib/include/EGL/eglmesaext.h | 10 | ||||
-rw-r--r-- | mesalib/include/GL/gl.h | 33 | ||||
-rw-r--r-- | mesalib/include/GL/glext.h | 30 | ||||
-rw-r--r-- | mesalib/include/GL/internal/dri_interface.h | 9 | ||||
-rw-r--r-- | mesalib/include/HaikuGL/GLRenderer.h | 76 | ||||
-rw-r--r-- | mesalib/include/HaikuGL/GLView.h | 193 | ||||
-rw-r--r-- | mesalib/include/HaikuGL/OpenGLKit.h | 10 | ||||
-rw-r--r-- | mesalib/include/HaikuGL/README | 28 |
8 files changed, 351 insertions, 38 deletions
diff --git a/mesalib/include/EGL/eglmesaext.h b/mesalib/include/EGL/eglmesaext.h index 1f07d4cde..14fb07a71 100644 --- a/mesalib/include/EGL/eglmesaext.h +++ b/mesalib/include/EGL/eglmesaext.h @@ -134,6 +134,16 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, st #endif +#ifndef EGL_WL_create_wayland_buffer_from_image +#define EGL_WL_create_wayland_buffer_from_image 1 + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); +#endif +typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); + +#endif + #ifndef EGL_NOK_swap_region #define EGL_NOK_swap_region 1 diff --git a/mesalib/include/GL/gl.h b/mesalib/include/GL/gl.h index b484b96ce..48343f65d 100644 --- a/mesalib/include/GL/gl.h +++ b/mesalib/include/GL/gl.h @@ -2078,39 +2078,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh #endif /* GL_MESA_packed_depth_stencil */ -#ifndef GL_MESA_texture_array -#define GL_MESA_texture_array 1 - -/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array. - */ -#ifndef GL_EXT_texture_array - -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target, - GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif /* GL_GLEXT_PROTOTYPES */ - -#if 0 -/* (temporarily) disabled because of collision with typedef in glext.h - * that happens if apps include both gl.h and glext.h - */ -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, - GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif - -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#endif - -#endif - - #ifndef GL_ATI_blend_equation_separate #define GL_ATI_blend_equation_separate 1 diff --git a/mesalib/include/GL/glext.h b/mesalib/include/GL/glext.h index e70266447..7d6033e10 100644 --- a/mesalib/include/GL/glext.h +++ b/mesalib/include/GL/glext.h @@ -33,7 +33,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.opengl.org/registry/ ** -** Khronos $Revision: 23855 $ on $Date: 2013-11-02 22:54:48 -0700 (Sat, 02 Nov 2013) $ +** Khronos $Revision: 24502 $ on $Date: 2013-12-12 13:14:39 -0800 (Thu, 12 Dec 2013) $ */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -53,7 +53,7 @@ extern "C" { #define GLAPI extern #endif -#define GL_GLEXT_VERSION 20131102 +#define GL_GLEXT_VERSION 20131212 /* Generated C header for: * API: gl @@ -2144,6 +2144,10 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data) #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); @@ -4836,6 +4840,20 @@ GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); #endif #endif /* GL_AMD_name_gen_delete */ +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF +typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); +#endif +#endif /* GL_AMD_occlusion_query_event */ + #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #define GL_COUNTER_TYPE_AMD 0x8BC0 @@ -6163,7 +6181,7 @@ typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintp typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); @@ -6419,7 +6437,7 @@ GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, G GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); @@ -8248,6 +8266,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_NV_blend_equation_advanced 1 #define GL_BLEND_OVERLAP_NV 0x9281 #define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 #define GL_COLORBURN_NV 0x929A #define GL_COLORDODGE_NV 0x9299 #define GL_CONJOINT_NV 0x9284 @@ -8261,6 +8280,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_DST_OUT_NV 0x928D #define GL_DST_OVER_NV 0x9289 #define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 #define GL_HARDLIGHT_NV 0x929B #define GL_HARDMIX_NV 0x92A9 #define GL_HSL_COLOR_NV 0x92AF @@ -8282,6 +8302,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_PLUS_CLAMPED_NV 0x92B1 #define GL_PLUS_DARKER_NV 0x9292 #define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 #define GL_SCREEN_NV 0x9295 #define GL_SOFTLIGHT_NV 0x929C #define GL_SRC_ATOP_NV 0x928E @@ -8291,6 +8312,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_SRC_OVER_NV 0x9288 #define GL_UNCORRELATED_NV 0x9282 #define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); #ifdef GL_GLEXT_PROTOTYPES diff --git a/mesalib/include/GL/internal/dri_interface.h b/mesalib/include/GL/internal/dri_interface.h index 89b559b4e..dc94cf255 100644 --- a/mesalib/include/GL/internal/dri_interface.h +++ b/mesalib/include/GL/internal/dri_interface.h @@ -441,7 +441,7 @@ struct __DRIdamageExtensionRec { * SWRast Loader extension. */ #define __DRI_SWRAST_LOADER "DRI_SWRastLoader" -#define __DRI_SWRAST_LOADER_VERSION 1 +#define __DRI_SWRAST_LOADER_VERSION 2 struct __DRIswrastLoaderExtensionRec { __DRIextension base; @@ -465,6 +465,13 @@ struct __DRIswrastLoaderExtensionRec { void (*getImage)(__DRIdrawable *readable, int x, int y, int width, int height, char *data, void *loaderPrivate); + + /** + * Put image to drawable + */ + void (*putImage2)(__DRIdrawable *drawable, int op, + int x, int y, int width, int height, int stride, + char *data, void *loaderPrivate); }; /** diff --git a/mesalib/include/HaikuGL/GLRenderer.h b/mesalib/include/HaikuGL/GLRenderer.h new file mode 100644 index 000000000..7ffcc34bb --- /dev/null +++ b/mesalib/include/HaikuGL/GLRenderer.h @@ -0,0 +1,76 @@ +/* + * Copyright 2006, Philippe Houdoin. All rights reserved. + * Distributed under the terms of the MIT License. + + * This header defines BGLRenderer, the base class making up + * the Haiku GL renderer add-ons (essentially selfcontained C++ + * shared libraries that do the actual rendering such as + * libswpipe.so and libswrast.so) + */ +#ifndef GLRENDERER_H +#define GLRENDERER_H + + +#include <BeBuild.h> +#include <GLView.h> + + +class BGLDispatcher; +class GLRendererRoster; + +typedef unsigned long renderer_id; + +class BGLRenderer +{ + // Private unimplemented copy constructors + BGLRenderer(const BGLRenderer &); + BGLRenderer & operator=(const BGLRenderer &); + +public: + BGLRenderer(BGLView *view, ulong bgl_options, + BGLDispatcher *dispatcher); + virtual ~BGLRenderer(); + + void Acquire(); + void Release(); + + virtual void LockGL(); + virtual void UnlockGL(); + + virtual void SwapBuffers(bool VSync = false); + virtual void Draw(BRect updateRect); + virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest); + virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest); + + virtual void FrameResized(float width, float height); + + virtual void DirectConnected(direct_buffer_info *info); + virtual void EnableDirectMode(bool enabled); + + inline int32 ReferenceCount() const { return fRefCount; }; + inline ulong Options() const { return fOptions; }; + inline BGLView* GLView() { return fView; }; + inline BGLDispatcher* GLDispatcher() { return fDispatcher; }; + +private: + friend class GLRendererRoster; + + virtual status_t _Reserved_Renderer_0(int32, void *); + virtual status_t _Reserved_Renderer_1(int32, void *); + virtual status_t _Reserved_Renderer_2(int32, void *); + virtual status_t _Reserved_Renderer_3(int32, void *); + virtual status_t _Reserved_Renderer_4(int32, void *); + + volatile int32 fRefCount; // How much we're still usefull? + BGLView* fView; // Never forget who is the boss! + ulong fOptions; // Keep that tune in memory + BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher + + GLRendererRoster* fOwningRoster; + renderer_id fID; +}; + +extern "C" _EXPORT BGLRenderer* instantiate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher); + + +#endif // GLRENDERER_H diff --git a/mesalib/include/HaikuGL/GLView.h b/mesalib/include/HaikuGL/GLView.h new file mode 100644 index 000000000..b848578f6 --- /dev/null +++ b/mesalib/include/HaikuGL/GLView.h @@ -0,0 +1,193 @@ +/* + * Copyright 2008-2013, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * This header defines BGLView, the base class making up + * the Haiku GL Kit. + * + */ +#ifndef BGLVIEW_H +#define BGLVIEW_H + + +#include <GL/gl.h> + +#define BGL_RGB 0 +#define BGL_INDEX 1 +#define BGL_SINGLE 0 +#define BGL_DOUBLE 2 +#define BGL_DIRECT 0 +#define BGL_INDIRECT 4 +#define BGL_ACCUM 8 +#define BGL_ALPHA 16 +#define BGL_DEPTH 32 +#define BGL_OVERLAY 64 +#define BGL_UNDERLAY 128 +#define BGL_STENCIL 512 + +#ifdef __cplusplus + +#include <AppKit.h> +#include <Bitmap.h> +#include <DirectWindow.h> +#include <View.h> +#include <Window.h> +#include <WindowScreen.h> + + +struct glview_direct_info; +class BGLRenderer; +class GLRendererRoster; + +class BGLView : public BView { +public: + BGLView(BRect rect, const char* name, + ulong resizingMode, ulong mode, + ulong options); + virtual ~BGLView(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + void SwapBuffers(bool vSync); + + BView* EmbeddedView(); // deprecated, returns NULL + void* GetGLProcAddress(const char* procName); + + status_t CopyPixelsOut(BPoint source, BBitmap *dest); + status_t CopyPixelsIn(BBitmap *source, BPoint dest); + + // Mesa's GLenum is uint where Be's ones was ulong! + virtual void ErrorCallback(unsigned long errorCode); + + virtual void Draw(BRect updateRect); + virtual void AttachedToWindow(); + virtual void AllAttached(); + virtual void DetachedFromWindow(); + virtual void AllDetached(); + + virtual void FrameResized(float newWidth, float newHeight); + virtual status_t Perform(perform_code d, void *arg); + + virtual status_t Archive(BMessage *data, bool deep = true) const; + + virtual void MessageReceived(BMessage *message); + virtual void SetResizingMode(uint32 mode); + + virtual void Show(); + virtual void Hide(); + + virtual BHandler* ResolveSpecifier(BMessage *msg, int32 index, + BMessage *specifier, int32 form, + const char *property); + virtual status_t GetSupportedSuites(BMessage *data); + + void DirectConnected(direct_buffer_info *info); + void EnableDirectMode(bool enabled); + + void* getGC() { return fGc; } // ??? + + virtual void GetPreferredSize(float* width, float* height); + +private: + + virtual void _ReservedGLView1(); + virtual void _ReservedGLView2(); + virtual void _ReservedGLView3(); + virtual void _ReservedGLView4(); + virtual void _ReservedGLView5(); + virtual void _ReservedGLView6(); + virtual void _ReservedGLView7(); + virtual void _ReservedGLView8(); + + BGLView(const BGLView &); + BGLView &operator=(const BGLView &); + + void _DitherFront(); + bool _ConfirmDither(); + void _Draw(BRect rect); + void _CallDirectConnected(); + + void* fGc; + uint32 fOptions; + uint32 fDitherCount; + BLocker fDrawLock; + BLocker fDisplayLock; + glview_direct_info* fClipInfo; + + BGLRenderer* fRenderer; + GLRendererRoster* fRoster; + + BBitmap* fDitherMap; + BRect fBounds; + int16* fErrorBuffer[2]; + uint64 _reserved[8]; + + void _LockDraw(); + void _UnlockDraw(); + +// BeOS compatibility +private: + BGLView(BRect rect, char* name, + ulong resizingMode, ulong mode, + ulong options); +}; + + +class BGLScreen : public BWindowScreen { +public: + BGLScreen(char* name, + ulong screenMode, ulong options, + status_t *error, bool debug=false); + ~BGLScreen(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + // Mesa's GLenum is uint where Be's ones was ulong! + virtual void ErrorCallback(unsigned long errorCode); + + virtual void ScreenConnected(bool connected); + virtual void FrameResized(float width, float height); + virtual status_t Perform(perform_code code, void *arg); + + virtual status_t Archive(BMessage *data, bool deep = true) const; + virtual void MessageReceived(BMessage *message); + + virtual void Show(); + virtual void Hide(); + + virtual BHandler* ResolveSpecifier(BMessage *message, + int32 index, + BMessage *specifier, + int32 form, + const char *property); + virtual status_t GetSupportedSuites(BMessage *data); + +private: + + virtual void _ReservedGLScreen1(); + virtual void _ReservedGLScreen2(); + virtual void _ReservedGLScreen3(); + virtual void _ReservedGLScreen4(); + virtual void _ReservedGLScreen5(); + virtual void _ReservedGLScreen6(); + virtual void _ReservedGLScreen7(); + virtual void _ReservedGLScreen8(); + + BGLScreen(const BGLScreen &); + BGLScreen &operator=(const BGLScreen &); + + void* fGc; + long fOptions; + BLocker fDrawLock; + + int32 fColorSpace; + uint32 fScreenMode; + + uint64 _reserved[7]; +}; + +#endif // __cplusplus + +#endif // BGLVIEW_H diff --git a/mesalib/include/HaikuGL/OpenGLKit.h b/mesalib/include/HaikuGL/OpenGLKit.h new file mode 100644 index 000000000..f4828714c --- /dev/null +++ b/mesalib/include/HaikuGL/OpenGLKit.h @@ -0,0 +1,10 @@ +/* + * Master include file for the Haiku OpenGL Kit. + */ + +#include <GL/gl.h> +#include <GLView.h> + +// Projects needing GL/glu.h and GL/glut.h should now +// include these headers independently as glu and glut +// are no longe core parts of mesa diff --git a/mesalib/include/HaikuGL/README b/mesalib/include/HaikuGL/README new file mode 100644 index 000000000..0f8503f08 --- /dev/null +++ b/mesalib/include/HaikuGL/README @@ -0,0 +1,28 @@ +These headers make up the Haiku Op*nGL kit. + +Headers in this directory preserve some BeOS™ compatibility +compatibility, so changes should be mentioned to the Haiku +project mailing list. + +http://haiku-os.org + +Normal Haiku Op*enGL layout: + + * headers/os/OpenGLKit.h + * headers/os/opengl/GLView.h + * headers/os/opengl/GLRenderer.h + * headers/os/opengl/GL/gl.h + * headers/os/opengl/GL/gl_mangle.h + * headers/os/opengl/GL/glext.h + * headers/os/opengl/GL/osmesa.h (needed?) + +Extras: + + * headers/os/opengl/GL/glu.h + * headers/os/opengl/GL/glut.h + +OpenGL™ is a trademark of SGI. The usage of this trademark +in the Haiku GL Kit is not a sign of any certification or +endorsement by SGI or its affiliates. Usage is purely to +allow legacy compatibility with the BeOS™ and its 3D GL +rendering subsystem. |