├── .gitattributes ├── .gitignore ├── RTSPUnityPlugin.vcxproj ├── RTSPUnityPlugin.vcxproj.filters ├── RTSPUnityPlugin.vcxproj.user ├── Source.def ├── UnityScriptExample └── SetRTSPTexture.cs └── source ├── FFMpegRTSPStream.cpp ├── FFMpegRTSPStream.h ├── FFMpegStream.cpp ├── FFMpegStream.h ├── GLEW ├── glew.c ├── glew.h ├── glxew.h └── wglew.h ├── MediaSink.cpp ├── MediaSink.h ├── PlatformBase.h ├── RTSPUnityPlugin.cpp ├── RTSPUnityPluginSingleton.cpp ├── RTSPUnityPluginSingleton.h ├── RenderAPI.cpp ├── RenderAPI.h ├── RenderAPI_D3D11.cpp ├── RenderAPI_D3D12.cpp ├── RenderAPI_D3D9.cpp ├── RenderAPI_OpenGL2.cpp ├── RenderAPI_OpenGLCoreES.cpp ├── Unity ├── IUnityGraphics.h ├── IUnityGraphicsD3D11.h ├── IUnityGraphicsD3D12.h ├── IUnityGraphicsD3D9.h ├── IUnityGraphicsMetal.h └── IUnityInterface.h ├── UnityTextureSink.cpp ├── UnityTextureSink.h ├── ffmpegenv.h └── unityenv.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | *.obj 49 | Debug/RTSPUnityPlugin.log 50 | *.log 51 | *.tlog 52 | *.idb 53 | *.pdb 54 | -------------------------------------------------------------------------------- /RTSPUnityPlugin.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {B83DA41E-FAEF-4FED-BAA6-49F562A1F6F3} 61 | RTSPUnityPlugin 62 | 8.1 63 | 64 | 65 | 66 | DynamicLibrary 67 | true 68 | v140 69 | MultiByte 70 | 71 | 72 | DynamicLibrary 73 | false 74 | v140 75 | true 76 | MultiByte 77 | 78 | 79 | Application 80 | true 81 | v140 82 | MultiByte 83 | 84 | 85 | DynamicLibrary 86 | false 87 | v140 88 | true 89 | MultiByte 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | $(SolutionDir)..\..\build\$(Platform)\$(Configuration)\ 111 | $(SolutionDir)..\..\build\$(Platform)\$(Configuration)\ 112 | $(SolutionDir)includes\ffmpeg;$(IncludePath) 113 | $(SolutionDir)libs\ffmpeg\x32;$(LibraryPath) 114 | 115 | 116 | $(SolutionDir)includes\ffmpeg;$(IncludePath) 117 | $(SolutionDir)libs\ffmpeg\x32;$(LibraryPath) 118 | $(SolutionDir)..\..\build\$(Platform)\$(Configuration)\ 119 | $(SolutionDir)..\..\build\$(Platform)\$(Configuration)\ 120 | 121 | 122 | $(SolutionDir)..\..\build\$(Platform)\$(Configuration)\ 123 | $(SolutionDir)..\..\build\$(Platform)\$(Configuration)\ 124 | $(SolutionDir)includes\ffmpeg;$(IncludePath) 125 | $(SolutionDir)libs\ffmpeg\x64;$(LibraryPath) 126 | 127 | 128 | 129 | Level3 130 | Disabled 131 | true 132 | 133 | 134 | Source.def 135 | opengl32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) 136 | 137 | 138 | 139 | 140 | Level3 141 | Disabled 142 | true 143 | 144 | 145 | Source.def 146 | 147 | 148 | 149 | 150 | Level3 151 | MaxSpeed 152 | true 153 | true 154 | true 155 | 156 | 157 | true 158 | true 159 | Source.def 160 | opengl32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) 161 | 162 | 163 | 164 | 165 | Level3 166 | MaxSpeed 167 | true 168 | true 169 | true 170 | 171 | 172 | true 173 | true 174 | Source.def 175 | opengl32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /RTSPUnityPlugin.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {20431d7a-7d67-453a-b622-eabba22ee053} 18 | source/* 19 | 20 | 21 | 22 | 23 | Source Files 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | 63 | 64 | Header Files 65 | 66 | 67 | Header Files 68 | 69 | 70 | Header Files 71 | 72 | 73 | Header Files 74 | 75 | 76 | Header Files 77 | 78 | 79 | Header Files 80 | 81 | 82 | Header Files 83 | 84 | 85 | Header Files 86 | 87 | 88 | Header Files 89 | 90 | 91 | Header Files 92 | 93 | 94 | Header Files 95 | 96 | 97 | Header Files 98 | 99 | 100 | Header Files 101 | 102 | 103 | Header Files 104 | 105 | 106 | Header Files 107 | 108 | 109 | Header Files 110 | 111 | 112 | Header Files 113 | 114 | 115 | Header Files 116 | 117 | 118 | 119 | 120 | Source Files 121 | 122 | 123 | -------------------------------------------------------------------------------- /RTSPUnityPlugin.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Source.def: -------------------------------------------------------------------------------- 1 | LIBRARY 2 | 3 | EXPORTS 4 | SetTimeFromUnity 5 | UnityPluginLoad 6 | UnityPluginUnload 7 | GetRenderEventFunc 8 | 9 | SetTextureAsRTSPSink 10 | 11 | -------------------------------------------------------------------------------- /UnityScriptExample/SetRTSPTexture.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Runtime.InteropServices; 5 | 6 | 7 | public class SetRTSPTexture : MonoBehaviour { 8 | 9 | [DllImport("RTSPUnityPlugin")] 10 | private static extern void SetTimeFromUnity(float t); 11 | [DllImport("RTSPUnityPlugin")] 12 | private static extern IntPtr GetRenderEventFunc(); 13 | [DllImport("RTSPUnityPlugin")] 14 | private static extern void SetTextureAsRTSPSink(string rtsp_uri,System.IntPtr texture, int h, int w); 15 | 16 | 17 | string g_rtspUri = "rtsp://localhost:8554/stream"; 18 | 19 | IEnumerator Start() 20 | { 21 | CreateTextureAndPassToPlugin(); 22 | yield return StartCoroutine("CallPluginAtEndOfFrames"); 23 | } 24 | 25 | private void CreateTextureAndPassToPlugin() 26 | { 27 | // Create a texture 28 | Texture2D tex = new Texture2D(256, 256, TextureFormat.RGBA32, false); 29 | // Set point filtering just so we can see the pixels clearly 30 | tex.filterMode = FilterMode.Point; 31 | // Call Apply() so it's actually uploaded to the GPU 32 | tex.Apply(); 33 | 34 | // Set texture onto our material 35 | GetComponent().material.mainTexture = tex; 36 | 37 | // Pass texture pointer to the plugin 38 | SetTextureAsRTSPSink(g_rtspUri, tex.GetNativeTexturePtr(), tex.width, tex.height); 39 | } 40 | 41 | private IEnumerator CallPluginAtEndOfFrames() 42 | { 43 | while (true) 44 | { 45 | // Wait until all frame rendering is done 46 | yield return new WaitForEndOfFrame(); 47 | 48 | // Set time for the plugin 49 | SetTimeFromUnity(Time.timeSinceLevelLoad); 50 | 51 | // Issue a plugin event with arbitrary integer identifier. 52 | // The plugin can distinguish between different 53 | // things it needs to do based on this ID. 54 | // For our simple plugin, it does not matter which ID we pass here. 55 | GL.IssuePluginEvent(GetRenderEventFunc(), 1); 56 | } 57 | } 58 | 59 | // Update is called once per frame 60 | void Update () { 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /source/FFMpegRTSPStream.cpp: -------------------------------------------------------------------------------- 1 | #include "FFMpegRTSPStream.h" 2 | #include "RTSPUnityPluginSingleton.h" 3 | 4 | 5 | 6 | rtsp_unity_plugin::FFMpegRTSPStream::FFMpegRTSPStream(const char* uri) : 7 | FFMpegStream(uri) 8 | { 9 | InitStream(); 10 | } 11 | 12 | 13 | rtsp_unity_plugin::FFMpegRTSPStream::~FFMpegRTSPStream() 14 | { 15 | CloseStream(); 16 | } 17 | 18 | int rtsp_unity_plugin::FFMpegRTSPStream::InitStream() 19 | { 20 | // init libav, codec and network 21 | RTSPPluginSingleton& rtspPluginSinglet = RTSPPluginSingleton::Instance(); 22 | rtspPluginSinglet.InitAv(); 23 | rtspPluginSinglet.InitAvCodec(); 24 | rtspPluginSinglet.InitAvNetwork(); 25 | 26 | AVCodecParameters *pCodecPar = NULL; 27 | m_pFormatCtx = avformat_alloc_context(); 28 | //get context and format 29 | if (avformat_open_input(&m_pFormatCtx, m_pStreamUri, NULL, NULL) < 0) { 30 | avformat_free_context(m_pFormatCtx); 31 | return -1; // error, init faild, return -1 32 | } 33 | if (avformat_find_stream_info(m_pFormatCtx, NULL)) { 34 | avformat_free_context(m_pFormatCtx); 35 | return -2;// error, codec not found, return -2 36 | } 37 | //search video stream 38 | 39 | for (int i = 0; inb_streams; i++) 40 | { 41 | if (m_pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) 42 | { 43 | m_VideoStreamIndex = i; 44 | } 45 | 46 | else if (m_pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) 47 | { 48 | m_AudioStreamIndex = i; 49 | } 50 | } 51 | 52 | //init packet 53 | av_init_packet(&m_packet); 54 | 55 | //play RTSP 56 | av_read_play(m_pFormatCtx); 57 | 58 | // Get a pointer to the codec parameter for the video stream 59 | pCodecPar = m_pFormatCtx->streams[m_VideoStreamIndex]->codecpar; 60 | // Find the decoder for the video stream 61 | m_pCodec = avcodec_find_decoder(pCodecPar->codec_id); 62 | if (m_pCodec == NULL) { 63 | fprintf(stderr, "Unsupported codec!\n"); 64 | return -1; // Codec not found 65 | } 66 | // set context to codecContext (create new codec_context) 67 | m_pCodecCtx = avcodec_alloc_context3(m_pCodec); 68 | if (avcodec_parameters_to_context(m_pCodecCtx, pCodecPar) < 0) { 69 | fprintf(stderr, "Couldn't copy codec context"); 70 | return -1; // Error copying codec context 71 | } 72 | // Open codec 73 | if (avcodec_open2(m_pCodecCtx, m_pCodec, NULL)<0) 74 | return -1; // Could not open codec 75 | 76 | // Allocate video frame 77 | // Allocate an AVFrame structure 78 | m_pFrameSrc = av_frame_alloc(); 79 | 80 | m_hasInit = true; 81 | m_isClosed = false; 82 | 83 | return 0; 84 | } 85 | 86 | int rtsp_unity_plugin::FFMpegRTSPStream::CloseStream() 87 | { 88 | if (!isClosed() && hasInit()) { 89 | // free the source frame 90 | av_free(m_pFrameSrc); 91 | // Close the codecs 92 | avcodec_close(m_pCodecCtx); 93 | // free the format context 94 | avformat_free_context(m_pFormatCtx); 95 | m_isClosed = true; 96 | return 0; 97 | } 98 | else if (!hasInit()) { 99 | return 1; // 1= not yet initialized 100 | } 101 | else { 102 | return 2; // already closed; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /source/FFMpegRTSPStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "FFMpegStream.h" 3 | 4 | 5 | 6 | namespace rtsp_unity_plugin { 7 | 8 | class FFMpegRTSPStream : public FFMpegStream 9 | { 10 | public: 11 | FFMpegRTSPStream(const char* uri); 12 | ~FFMpegRTSPStream(); 13 | 14 | int InitStream(); 15 | int CloseStream(); 16 | 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /source/FFMpegStream.cpp: -------------------------------------------------------------------------------- 1 | #include "FFMpegStream.h" 2 | #include "RTSPUnityPluginSingleton.h" 3 | 4 | 5 | 6 | rtsp_unity_plugin::FFMpegStream::FFMpegStream(const char* uri) 7 | { 8 | 9 | m_pStreamUri = uri; 10 | m_pMediaSink = NULL; 11 | } 12 | 13 | 14 | rtsp_unity_plugin::FFMpegStream::~FFMpegStream() 15 | { 16 | } 17 | /* 18 | return -1 if the stream as not been set yet. 19 | 20 | */ 21 | int rtsp_unity_plugin::FFMpegStream::setMediaSink(MediaSink* media_sink) 22 | { 23 | if (hasInit()){ 24 | media_sink->setSrcCodecContext(m_pCodecCtx); 25 | m_pMediaSink = media_sink; 26 | return 0; 27 | } 28 | return -1; 29 | } 30 | 31 | const char * rtsp_unity_plugin::FFMpegStream::getUri() const 32 | { 33 | return m_pStreamUri; 34 | } 35 | 36 | 37 | /* 38 | int rtsp_unity_plugin::FFMpegStream::addMediaSink(MediaSink &media_sink) 39 | { 40 | media_sink.setSrcCodecContext(m_pCodecCtx); 41 | m_vMediaSink.push_back(media_sink); 42 | return 0; 43 | }*/ 44 | /* will read frame and send them to the mediaSink 45 | if no frame are available, close the stream and return 0 46 | if frame not yet available, return 1 47 | else return 2; (2 mean ok!!) 48 | 49 | */ 50 | int rtsp_unity_plugin::FFMpegStream::ReadFrame() 51 | { 52 | RTSPPluginSingleton& ffmpegClassPtr = RTSPPluginSingleton::Instance(); 53 | //if (m_pMediaSink != NULL) 54 | // m_pMediaSink->WriteVideo(ffmpegClassPtr.getRenderApi(), NULL); 55 | 56 | if (m_hasInit && !m_isClosed) { 57 | 58 | if (av_read_frame(m_pFormatCtx, &m_packet) >= 0) { 59 | if (m_packet.stream_index == m_VideoStreamIndex) { 60 | //Supply raw packet data as input to a decoder. 61 | avcodec_send_packet(m_pCodecCtx, &m_packet); 62 | // Decode video frame 63 | m_frameFinished = avcodec_receive_frame(m_pCodecCtx, m_pFrameSrc); 64 | // Did we get a video complete video frame? 65 | if (m_frameFinished == 0) { 66 | 67 | //for (std::vector::iterator it = m_vMediaSink.begin(); it != m_vMediaSink.end(); ++it) { 68 | // it->WriteVideo(m_pFrameSrc); 69 | //} 70 | if (m_pMediaSink != NULL) 71 | m_pMediaSink->WriteVideo(ffmpegClassPtr.getRenderApi(), m_pFrameSrc); 72 | } 73 | } 74 | else if (m_packet.stream_index == m_AudioStreamIndex) { 75 | // TODO Handle the audio output!!! 76 | 77 | //for (std::vector::iterator it = m_vMediaSink.begin(); it != m_vMediaSink.end(); ++it) { 78 | // it->WriteAudio(m_pFrameSrc); 79 | //} 80 | if (m_pMediaSink != NULL) 81 | m_pMediaSink->WriteAudio(m_pFrameSrc); 82 | }else { 83 | // if thie packet is an error, we free the packet 84 | av_packet_unref(&m_packet); 85 | } 86 | } 87 | else { 88 | CloseStream(); 89 | } 90 | return 2; 91 | } 92 | else return 0; 93 | } 94 | -------------------------------------------------------------------------------- /source/FFMpegStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include ; 5 | #include "MediaSink.h" 6 | 7 | 8 | namespace rtsp_unity_plugin { 9 | class MediaSink; 10 | class FFMpegStream 11 | { 12 | 13 | protected: 14 | AVFormatContext* m_pFormatCtx= NULL; 15 | AVCodecContext *m_pCodecCtx = NULL; 16 | AVCodec *m_pCodec = NULL; 17 | AVFrame *m_pFrameSrc = NULL; 18 | 19 | int m_dstWidth = 0; 20 | int m_dstHeight = 0; 21 | int m_frameFinished; 22 | 23 | const char* m_pStreamUri; 24 | 25 | AVPacket m_packet; 26 | 27 | int m_VideoStreamIndex; 28 | int m_AudioStreamIndex; 29 | 30 | bool m_hasInit = false; 31 | bool m_isClosed = false; 32 | 33 | MediaSink* m_pMediaSink; 34 | //std::vector m_vMediaSink; 35 | 36 | public: 37 | FFMpegStream(const char* uri); 38 | ~FFMpegStream(); 39 | 40 | virtual int InitStream() = 0; // return 0 if ok 41 | virtual int CloseStream() = 0; // return 0 if ok, 1 if not yet init, 2 if already closed 42 | 43 | inline AVCodecContext *getCodecContext() { return m_pCodecCtx; } 44 | inline bool hasInit() { return m_hasInit; } 45 | inline bool isClosed() { return m_isClosed; } 46 | //int addMediaSink(MediaSink &media_sink); 47 | int setMediaSink(MediaSink* media_sink); 48 | 49 | const char* getUri() const; 50 | 51 | int ReadFrame(); 52 | 53 | protected: 54 | 55 | private: 56 | 57 | 58 | }; 59 | /* 60 | struct FFMpegStreamCompare { 61 | bool operator() (const FFMpegStream& lhs, const FFMpegStream& rhs) const { 62 | return strcmp(lhs.getUri(), rhs.getUri()) < 0; 63 | } 64 | };*/ 65 | } 66 | -------------------------------------------------------------------------------- /source/GLEW/glxew.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** The OpenGL Extension Wrangler Library 3 | ** Copyright (C) 2008-2015, Nigel Stewart 4 | ** Copyright (C) 2002-2008, Milan Ikits 5 | ** Copyright (C) 2002-2008, Marcelo E. Magallon 6 | ** Copyright (C) 2002, Lev Povalahev 7 | ** All rights reserved. 8 | ** 9 | ** Redistribution and use in source and binary forms, with or without 10 | ** modification, are permitted provided that the following conditions are met: 11 | ** 12 | ** * Redistributions of source code must retain the above copyright notice, 13 | ** this list of conditions and the following disclaimer. 14 | ** * Redistributions in binary form must reproduce the above copyright notice, 15 | ** this list of conditions and the following disclaimer in the documentation 16 | ** and/or other materials provided with the distribution. 17 | ** * The name of the author may be used to endorse or promote products 18 | ** derived from this software without specific prior written permission. 19 | ** 20 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24 | ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | ** THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | /* 34 | * Mesa 3-D graphics library 35 | * Version: 7.0 36 | * 37 | * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 38 | * 39 | * Permission is hereby granted, free of charge, to any person obtaining a 40 | * copy of this software and associated documentation files (the "Software"), 41 | * to deal in the Software without restriction, including without limitation 42 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 43 | * and/or sell copies of the Software, and to permit persons to whom the 44 | * Software is furnished to do so, subject to the following conditions: 45 | * 46 | * The above copyright notice and this permission notice shall be included 47 | * in all copies or substantial portions of the Software. 48 | * 49 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 50 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 51 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 52 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 53 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 54 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 55 | */ 56 | 57 | /* 58 | ** Copyright (c) 2007 The Khronos Group Inc. 59 | ** 60 | ** Permission is hereby granted, free of charge, to any person obtaining a 61 | ** copy of this software and/or associated documentation files (the 62 | ** "Materials"), to deal in the Materials without restriction, including 63 | ** without limitation the rights to use, copy, modify, merge, publish, 64 | ** distribute, sublicense, and/or sell copies of the Materials, and to 65 | ** permit persons to whom the Materials are furnished to do so, subject to 66 | ** the following conditions: 67 | ** 68 | ** The above copyright notice and this permission notice shall be included 69 | ** in all copies or substantial portions of the Materials. 70 | ** 71 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 72 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 73 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 74 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 75 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 76 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 77 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 78 | */ 79 | 80 | #ifndef __glxew_h__ 81 | #define __glxew_h__ 82 | #define __GLXEW_H__ 83 | 84 | #ifdef __glxext_h_ 85 | #error glxext.h included before glxew.h 86 | #endif 87 | 88 | #if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) 89 | #error glx.h included before glxew.h 90 | #endif 91 | 92 | #define __glxext_h_ 93 | 94 | #define GLX_H 95 | #define __GLX_glx_h__ 96 | #define __glx_h__ 97 | 98 | #include 99 | #include 100 | #include 101 | #include 102 | 103 | #ifdef __cplusplus 104 | extern "C" { 105 | #endif 106 | 107 | /* ---------------------------- GLX_VERSION_1_0 --------------------------- */ 108 | 109 | #ifndef GLX_VERSION_1_0 110 | #define GLX_VERSION_1_0 1 111 | 112 | #define GLX_USE_GL 1 113 | #define GLX_BUFFER_SIZE 2 114 | #define GLX_LEVEL 3 115 | #define GLX_RGBA 4 116 | #define GLX_DOUBLEBUFFER 5 117 | #define GLX_STEREO 6 118 | #define GLX_AUX_BUFFERS 7 119 | #define GLX_RED_SIZE 8 120 | #define GLX_GREEN_SIZE 9 121 | #define GLX_BLUE_SIZE 10 122 | #define GLX_ALPHA_SIZE 11 123 | #define GLX_DEPTH_SIZE 12 124 | #define GLX_STENCIL_SIZE 13 125 | #define GLX_ACCUM_RED_SIZE 14 126 | #define GLX_ACCUM_GREEN_SIZE 15 127 | #define GLX_ACCUM_BLUE_SIZE 16 128 | #define GLX_ACCUM_ALPHA_SIZE 17 129 | #define GLX_BAD_SCREEN 1 130 | #define GLX_BAD_ATTRIBUTE 2 131 | #define GLX_NO_EXTENSION 3 132 | #define GLX_BAD_VISUAL 4 133 | #define GLX_BAD_CONTEXT 5 134 | #define GLX_BAD_VALUE 6 135 | #define GLX_BAD_ENUM 7 136 | 137 | typedef XID GLXDrawable; 138 | typedef XID GLXPixmap; 139 | #ifdef __sun 140 | typedef struct __glXContextRec *GLXContext; 141 | #else 142 | typedef struct __GLXcontextRec *GLXContext; 143 | #endif 144 | 145 | typedef unsigned int GLXVideoDeviceNV; 146 | 147 | extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); 148 | extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); 149 | extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); 150 | extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); 151 | extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); 152 | extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); 153 | extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); 154 | extern void glXDestroyContext (Display *dpy, GLXContext ctx); 155 | extern Bool glXIsDirect (Display *dpy, GLXContext ctx); 156 | extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); 157 | extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); 158 | extern GLXContext glXGetCurrentContext (void); 159 | extern GLXDrawable glXGetCurrentDrawable (void); 160 | extern void glXWaitGL (void); 161 | extern void glXWaitX (void); 162 | extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); 163 | extern void glXUseXFont (Font font, int first, int count, int listBase); 164 | 165 | #define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) 166 | 167 | #endif /* GLX_VERSION_1_0 */ 168 | 169 | /* ---------------------------- GLX_VERSION_1_1 --------------------------- */ 170 | 171 | #ifndef GLX_VERSION_1_1 172 | #define GLX_VERSION_1_1 173 | 174 | #define GLX_VENDOR 0x1 175 | #define GLX_VERSION 0x2 176 | #define GLX_EXTENSIONS 0x3 177 | 178 | extern const char* glXQueryExtensionsString (Display *dpy, int screen); 179 | extern const char* glXGetClientString (Display *dpy, int name); 180 | extern const char* glXQueryServerString (Display *dpy, int screen, int name); 181 | 182 | #define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) 183 | 184 | #endif /* GLX_VERSION_1_1 */ 185 | 186 | /* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ 187 | 188 | #ifndef GLX_VERSION_1_2 189 | #define GLX_VERSION_1_2 1 190 | 191 | typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); 192 | 193 | #define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) 194 | 195 | #define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) 196 | 197 | #endif /* GLX_VERSION_1_2 */ 198 | 199 | /* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ 200 | 201 | #ifndef GLX_VERSION_1_3 202 | #define GLX_VERSION_1_3 1 203 | 204 | #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 205 | #define GLX_RGBA_BIT 0x00000001 206 | #define GLX_WINDOW_BIT 0x00000001 207 | #define GLX_COLOR_INDEX_BIT 0x00000002 208 | #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 209 | #define GLX_PIXMAP_BIT 0x00000002 210 | #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 211 | #define GLX_PBUFFER_BIT 0x00000004 212 | #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 213 | #define GLX_AUX_BUFFERS_BIT 0x00000010 214 | #define GLX_CONFIG_CAVEAT 0x20 215 | #define GLX_DEPTH_BUFFER_BIT 0x00000020 216 | #define GLX_X_VISUAL_TYPE 0x22 217 | #define GLX_TRANSPARENT_TYPE 0x23 218 | #define GLX_TRANSPARENT_INDEX_VALUE 0x24 219 | #define GLX_TRANSPARENT_RED_VALUE 0x25 220 | #define GLX_TRANSPARENT_GREEN_VALUE 0x26 221 | #define GLX_TRANSPARENT_BLUE_VALUE 0x27 222 | #define GLX_TRANSPARENT_ALPHA_VALUE 0x28 223 | #define GLX_STENCIL_BUFFER_BIT 0x00000040 224 | #define GLX_ACCUM_BUFFER_BIT 0x00000080 225 | #define GLX_NONE 0x8000 226 | #define GLX_SLOW_CONFIG 0x8001 227 | #define GLX_TRUE_COLOR 0x8002 228 | #define GLX_DIRECT_COLOR 0x8003 229 | #define GLX_PSEUDO_COLOR 0x8004 230 | #define GLX_STATIC_COLOR 0x8005 231 | #define GLX_GRAY_SCALE 0x8006 232 | #define GLX_STATIC_GRAY 0x8007 233 | #define GLX_TRANSPARENT_RGB 0x8008 234 | #define GLX_TRANSPARENT_INDEX 0x8009 235 | #define GLX_VISUAL_ID 0x800B 236 | #define GLX_SCREEN 0x800C 237 | #define GLX_NON_CONFORMANT_CONFIG 0x800D 238 | #define GLX_DRAWABLE_TYPE 0x8010 239 | #define GLX_RENDER_TYPE 0x8011 240 | #define GLX_X_RENDERABLE 0x8012 241 | #define GLX_FBCONFIG_ID 0x8013 242 | #define GLX_RGBA_TYPE 0x8014 243 | #define GLX_COLOR_INDEX_TYPE 0x8015 244 | #define GLX_MAX_PBUFFER_WIDTH 0x8016 245 | #define GLX_MAX_PBUFFER_HEIGHT 0x8017 246 | #define GLX_MAX_PBUFFER_PIXELS 0x8018 247 | #define GLX_PRESERVED_CONTENTS 0x801B 248 | #define GLX_LARGEST_PBUFFER 0x801C 249 | #define GLX_WIDTH 0x801D 250 | #define GLX_HEIGHT 0x801E 251 | #define GLX_EVENT_MASK 0x801F 252 | #define GLX_DAMAGED 0x8020 253 | #define GLX_SAVED 0x8021 254 | #define GLX_WINDOW 0x8022 255 | #define GLX_PBUFFER 0x8023 256 | #define GLX_PBUFFER_HEIGHT 0x8040 257 | #define GLX_PBUFFER_WIDTH 0x8041 258 | #define GLX_PBUFFER_CLOBBER_MASK 0x08000000 259 | #define GLX_DONT_CARE 0xFFFFFFFF 260 | 261 | typedef XID GLXFBConfigID; 262 | typedef XID GLXPbuffer; 263 | typedef XID GLXWindow; 264 | typedef struct __GLXFBConfigRec *GLXFBConfig; 265 | 266 | typedef struct { 267 | int event_type; 268 | int draw_type; 269 | unsigned long serial; 270 | Bool send_event; 271 | Display *display; 272 | GLXDrawable drawable; 273 | unsigned int buffer_mask; 274 | unsigned int aux_buffer; 275 | int x, y; 276 | int width, height; 277 | int count; 278 | } GLXPbufferClobberEvent; 279 | typedef union __GLXEvent { 280 | GLXPbufferClobberEvent glxpbufferclobber; 281 | long pad[24]; 282 | } GLXEvent; 283 | 284 | typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); 285 | typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); 286 | typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); 287 | typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); 288 | typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); 289 | typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); 290 | typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); 291 | typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); 292 | typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); 293 | typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); 294 | typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); 295 | typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); 296 | typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); 297 | typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); 298 | typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); 299 | typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); 300 | typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); 301 | 302 | #define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) 303 | #define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) 304 | #define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) 305 | #define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) 306 | #define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) 307 | #define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) 308 | #define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) 309 | #define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) 310 | #define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) 311 | #define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) 312 | #define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) 313 | #define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) 314 | #define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) 315 | #define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) 316 | #define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) 317 | #define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) 318 | #define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) 319 | 320 | #define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) 321 | 322 | #endif /* GLX_VERSION_1_3 */ 323 | 324 | /* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ 325 | 326 | #ifndef GLX_VERSION_1_4 327 | #define GLX_VERSION_1_4 1 328 | 329 | #define GLX_SAMPLE_BUFFERS 100000 330 | #define GLX_SAMPLES 100001 331 | 332 | extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); 333 | 334 | #define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) 335 | 336 | #endif /* GLX_VERSION_1_4 */ 337 | 338 | /* -------------------------- GLX_3DFX_multisample ------------------------- */ 339 | 340 | #ifndef GLX_3DFX_multisample 341 | #define GLX_3DFX_multisample 1 342 | 343 | #define GLX_SAMPLE_BUFFERS_3DFX 0x8050 344 | #define GLX_SAMPLES_3DFX 0x8051 345 | 346 | #define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) 347 | 348 | #endif /* GLX_3DFX_multisample */ 349 | 350 | /* ------------------------ GLX_AMD_gpu_association ------------------------ */ 351 | 352 | #ifndef GLX_AMD_gpu_association 353 | #define GLX_AMD_gpu_association 1 354 | 355 | #define GLX_GPU_VENDOR_AMD 0x1F00 356 | #define GLX_GPU_RENDERER_STRING_AMD 0x1F01 357 | #define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 358 | #define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 359 | #define GLX_GPU_RAM_AMD 0x21A3 360 | #define GLX_GPU_CLOCK_AMD 0x21A4 361 | #define GLX_GPU_NUM_PIPES_AMD 0x21A5 362 | #define GLX_GPU_NUM_SIMD_AMD 0x21A6 363 | #define GLX_GPU_NUM_RB_AMD 0x21A7 364 | #define GLX_GPU_NUM_SPI_AMD 0x21A8 365 | 366 | typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 367 | typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); 368 | typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); 369 | typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); 370 | typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); 371 | typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); 372 | typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); 373 | typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); 374 | typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); 375 | 376 | #define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) 377 | #define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) 378 | #define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) 379 | #define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) 380 | #define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) 381 | #define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) 382 | #define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) 383 | #define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) 384 | #define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) 385 | 386 | #define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) 387 | 388 | #endif /* GLX_AMD_gpu_association */ 389 | 390 | /* --------------------- GLX_ARB_context_flush_control --------------------- */ 391 | 392 | #ifndef GLX_ARB_context_flush_control 393 | #define GLX_ARB_context_flush_control 1 394 | 395 | #define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 396 | #define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 397 | #define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 398 | 399 | #define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) 400 | 401 | #endif /* GLX_ARB_context_flush_control */ 402 | 403 | /* ------------------------- GLX_ARB_create_context ------------------------ */ 404 | 405 | #ifndef GLX_ARB_create_context 406 | #define GLX_ARB_create_context 1 407 | 408 | #define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 409 | #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 410 | #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 411 | #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 412 | #define GLX_CONTEXT_FLAGS_ARB 0x2094 413 | 414 | typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); 415 | 416 | #define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) 417 | 418 | #define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) 419 | 420 | #endif /* GLX_ARB_create_context */ 421 | 422 | /* --------------------- GLX_ARB_create_context_profile -------------------- */ 423 | 424 | #ifndef GLX_ARB_create_context_profile 425 | #define GLX_ARB_create_context_profile 1 426 | 427 | #define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 428 | #define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 429 | #define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 430 | 431 | #define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) 432 | 433 | #endif /* GLX_ARB_create_context_profile */ 434 | 435 | /* ------------------- GLX_ARB_create_context_robustness ------------------- */ 436 | 437 | #ifndef GLX_ARB_create_context_robustness 438 | #define GLX_ARB_create_context_robustness 1 439 | 440 | #define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 441 | #define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 442 | #define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 443 | #define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 444 | 445 | #define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) 446 | 447 | #endif /* GLX_ARB_create_context_robustness */ 448 | 449 | /* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ 450 | 451 | #ifndef GLX_ARB_fbconfig_float 452 | #define GLX_ARB_fbconfig_float 1 453 | 454 | #define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 455 | #define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 456 | 457 | #define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) 458 | 459 | #endif /* GLX_ARB_fbconfig_float */ 460 | 461 | /* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ 462 | 463 | #ifndef GLX_ARB_framebuffer_sRGB 464 | #define GLX_ARB_framebuffer_sRGB 1 465 | 466 | #define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 467 | 468 | #define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) 469 | 470 | #endif /* GLX_ARB_framebuffer_sRGB */ 471 | 472 | /* ------------------------ GLX_ARB_get_proc_address ----------------------- */ 473 | 474 | #ifndef GLX_ARB_get_proc_address 475 | #define GLX_ARB_get_proc_address 1 476 | 477 | extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); 478 | 479 | #define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) 480 | 481 | #endif /* GLX_ARB_get_proc_address */ 482 | 483 | /* -------------------------- GLX_ARB_multisample -------------------------- */ 484 | 485 | #ifndef GLX_ARB_multisample 486 | #define GLX_ARB_multisample 1 487 | 488 | #define GLX_SAMPLE_BUFFERS_ARB 100000 489 | #define GLX_SAMPLES_ARB 100001 490 | 491 | #define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) 492 | 493 | #endif /* GLX_ARB_multisample */ 494 | 495 | /* ---------------- GLX_ARB_robustness_application_isolation --------------- */ 496 | 497 | #ifndef GLX_ARB_robustness_application_isolation 498 | #define GLX_ARB_robustness_application_isolation 1 499 | 500 | #define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 501 | 502 | #define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) 503 | 504 | #endif /* GLX_ARB_robustness_application_isolation */ 505 | 506 | /* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ 507 | 508 | #ifndef GLX_ARB_robustness_share_group_isolation 509 | #define GLX_ARB_robustness_share_group_isolation 1 510 | 511 | #define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 512 | 513 | #define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) 514 | 515 | #endif /* GLX_ARB_robustness_share_group_isolation */ 516 | 517 | /* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ 518 | 519 | #ifndef GLX_ARB_vertex_buffer_object 520 | #define GLX_ARB_vertex_buffer_object 1 521 | 522 | #define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 523 | 524 | #define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) 525 | 526 | #endif /* GLX_ARB_vertex_buffer_object */ 527 | 528 | /* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ 529 | 530 | #ifndef GLX_ATI_pixel_format_float 531 | #define GLX_ATI_pixel_format_float 1 532 | 533 | #define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 534 | 535 | #define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) 536 | 537 | #endif /* GLX_ATI_pixel_format_float */ 538 | 539 | /* ------------------------- GLX_ATI_render_texture ------------------------ */ 540 | 541 | #ifndef GLX_ATI_render_texture 542 | #define GLX_ATI_render_texture 1 543 | 544 | #define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 545 | #define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 546 | #define GLX_TEXTURE_FORMAT_ATI 0x9802 547 | #define GLX_TEXTURE_TARGET_ATI 0x9803 548 | #define GLX_MIPMAP_TEXTURE_ATI 0x9804 549 | #define GLX_TEXTURE_RGB_ATI 0x9805 550 | #define GLX_TEXTURE_RGBA_ATI 0x9806 551 | #define GLX_NO_TEXTURE_ATI 0x9807 552 | #define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 553 | #define GLX_TEXTURE_1D_ATI 0x9809 554 | #define GLX_TEXTURE_2D_ATI 0x980A 555 | #define GLX_MIPMAP_LEVEL_ATI 0x980B 556 | #define GLX_CUBE_MAP_FACE_ATI 0x980C 557 | #define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D 558 | #define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E 559 | #define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F 560 | #define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 561 | #define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 562 | #define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 563 | #define GLX_FRONT_LEFT_ATI 0x9813 564 | #define GLX_FRONT_RIGHT_ATI 0x9814 565 | #define GLX_BACK_LEFT_ATI 0x9815 566 | #define GLX_BACK_RIGHT_ATI 0x9816 567 | #define GLX_AUX0_ATI 0x9817 568 | #define GLX_AUX1_ATI 0x9818 569 | #define GLX_AUX2_ATI 0x9819 570 | #define GLX_AUX3_ATI 0x981A 571 | #define GLX_AUX4_ATI 0x981B 572 | #define GLX_AUX5_ATI 0x981C 573 | #define GLX_AUX6_ATI 0x981D 574 | #define GLX_AUX7_ATI 0x981E 575 | #define GLX_AUX8_ATI 0x981F 576 | #define GLX_AUX9_ATI 0x9820 577 | #define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 578 | #define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 579 | 580 | typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); 581 | typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); 582 | typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); 583 | 584 | #define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) 585 | #define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) 586 | #define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) 587 | 588 | #define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) 589 | 590 | #endif /* GLX_ATI_render_texture */ 591 | 592 | /* --------------------------- GLX_EXT_buffer_age -------------------------- */ 593 | 594 | #ifndef GLX_EXT_buffer_age 595 | #define GLX_EXT_buffer_age 1 596 | 597 | #define GLX_BACK_BUFFER_AGE_EXT 0x20F4 598 | 599 | #define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) 600 | 601 | #endif /* GLX_EXT_buffer_age */ 602 | 603 | /* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ 604 | 605 | #ifndef GLX_EXT_create_context_es2_profile 606 | #define GLX_EXT_create_context_es2_profile 1 607 | 608 | #define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 609 | 610 | #define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) 611 | 612 | #endif /* GLX_EXT_create_context_es2_profile */ 613 | 614 | /* ------------------- GLX_EXT_create_context_es_profile ------------------- */ 615 | 616 | #ifndef GLX_EXT_create_context_es_profile 617 | #define GLX_EXT_create_context_es_profile 1 618 | 619 | #define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 620 | 621 | #define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) 622 | 623 | #endif /* GLX_EXT_create_context_es_profile */ 624 | 625 | /* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ 626 | 627 | #ifndef GLX_EXT_fbconfig_packed_float 628 | #define GLX_EXT_fbconfig_packed_float 1 629 | 630 | #define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 631 | #define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 632 | 633 | #define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) 634 | 635 | #endif /* GLX_EXT_fbconfig_packed_float */ 636 | 637 | /* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ 638 | 639 | #ifndef GLX_EXT_framebuffer_sRGB 640 | #define GLX_EXT_framebuffer_sRGB 1 641 | 642 | #define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 643 | 644 | #define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) 645 | 646 | #endif /* GLX_EXT_framebuffer_sRGB */ 647 | 648 | /* ------------------------- GLX_EXT_import_context ------------------------ */ 649 | 650 | #ifndef GLX_EXT_import_context 651 | #define GLX_EXT_import_context 1 652 | 653 | #define GLX_SHARE_CONTEXT_EXT 0x800A 654 | #define GLX_VISUAL_ID_EXT 0x800B 655 | #define GLX_SCREEN_EXT 0x800C 656 | 657 | typedef XID GLXContextID; 658 | 659 | typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); 660 | typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); 661 | typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); 662 | typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); 663 | 664 | #define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) 665 | #define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) 666 | #define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) 667 | #define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) 668 | 669 | #define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) 670 | 671 | #endif /* GLX_EXT_import_context */ 672 | 673 | /* -------------------------- GLX_EXT_scene_marker ------------------------- */ 674 | 675 | #ifndef GLX_EXT_scene_marker 676 | #define GLX_EXT_scene_marker 1 677 | 678 | #define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) 679 | 680 | #endif /* GLX_EXT_scene_marker */ 681 | 682 | /* -------------------------- GLX_EXT_stereo_tree -------------------------- */ 683 | 684 | #ifndef GLX_EXT_stereo_tree 685 | #define GLX_EXT_stereo_tree 1 686 | 687 | #define GLX_STEREO_NOTIFY_EXT 0x00000000 688 | #define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 689 | #define GLX_STEREO_TREE_EXT 0x20F5 690 | 691 | #define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) 692 | 693 | #endif /* GLX_EXT_stereo_tree */ 694 | 695 | /* -------------------------- GLX_EXT_swap_control ------------------------- */ 696 | 697 | #ifndef GLX_EXT_swap_control 698 | #define GLX_EXT_swap_control 1 699 | 700 | #define GLX_SWAP_INTERVAL_EXT 0x20F1 701 | #define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 702 | 703 | typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); 704 | 705 | #define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) 706 | 707 | #define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) 708 | 709 | #endif /* GLX_EXT_swap_control */ 710 | 711 | /* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ 712 | 713 | #ifndef GLX_EXT_swap_control_tear 714 | #define GLX_EXT_swap_control_tear 1 715 | 716 | #define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 717 | 718 | #define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) 719 | 720 | #endif /* GLX_EXT_swap_control_tear */ 721 | 722 | /* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ 723 | 724 | #ifndef GLX_EXT_texture_from_pixmap 725 | #define GLX_EXT_texture_from_pixmap 1 726 | 727 | #define GLX_TEXTURE_1D_BIT_EXT 0x00000001 728 | #define GLX_TEXTURE_2D_BIT_EXT 0x00000002 729 | #define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 730 | #define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 731 | #define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 732 | #define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 733 | #define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 734 | #define GLX_Y_INVERTED_EXT 0x20D4 735 | #define GLX_TEXTURE_FORMAT_EXT 0x20D5 736 | #define GLX_TEXTURE_TARGET_EXT 0x20D6 737 | #define GLX_MIPMAP_TEXTURE_EXT 0x20D7 738 | #define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 739 | #define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 740 | #define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA 741 | #define GLX_TEXTURE_1D_EXT 0x20DB 742 | #define GLX_TEXTURE_2D_EXT 0x20DC 743 | #define GLX_TEXTURE_RECTANGLE_EXT 0x20DD 744 | #define GLX_FRONT_LEFT_EXT 0x20DE 745 | #define GLX_FRONT_RIGHT_EXT 0x20DF 746 | #define GLX_BACK_LEFT_EXT 0x20E0 747 | #define GLX_BACK_RIGHT_EXT 0x20E1 748 | #define GLX_AUX0_EXT 0x20E2 749 | #define GLX_AUX1_EXT 0x20E3 750 | #define GLX_AUX2_EXT 0x20E4 751 | #define GLX_AUX3_EXT 0x20E5 752 | #define GLX_AUX4_EXT 0x20E6 753 | #define GLX_AUX5_EXT 0x20E7 754 | #define GLX_AUX6_EXT 0x20E8 755 | #define GLX_AUX7_EXT 0x20E9 756 | #define GLX_AUX8_EXT 0x20EA 757 | #define GLX_AUX9_EXT 0x20EB 758 | 759 | typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); 760 | typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); 761 | 762 | #define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) 763 | #define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) 764 | 765 | #define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) 766 | 767 | #endif /* GLX_EXT_texture_from_pixmap */ 768 | 769 | /* -------------------------- GLX_EXT_visual_info -------------------------- */ 770 | 771 | #ifndef GLX_EXT_visual_info 772 | #define GLX_EXT_visual_info 1 773 | 774 | #define GLX_X_VISUAL_TYPE_EXT 0x22 775 | #define GLX_TRANSPARENT_TYPE_EXT 0x23 776 | #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 777 | #define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 778 | #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 779 | #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 780 | #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 781 | #define GLX_NONE_EXT 0x8000 782 | #define GLX_TRUE_COLOR_EXT 0x8002 783 | #define GLX_DIRECT_COLOR_EXT 0x8003 784 | #define GLX_PSEUDO_COLOR_EXT 0x8004 785 | #define GLX_STATIC_COLOR_EXT 0x8005 786 | #define GLX_GRAY_SCALE_EXT 0x8006 787 | #define GLX_STATIC_GRAY_EXT 0x8007 788 | #define GLX_TRANSPARENT_RGB_EXT 0x8008 789 | #define GLX_TRANSPARENT_INDEX_EXT 0x8009 790 | 791 | #define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) 792 | 793 | #endif /* GLX_EXT_visual_info */ 794 | 795 | /* ------------------------- GLX_EXT_visual_rating ------------------------- */ 796 | 797 | #ifndef GLX_EXT_visual_rating 798 | #define GLX_EXT_visual_rating 1 799 | 800 | #define GLX_VISUAL_CAVEAT_EXT 0x20 801 | #define GLX_SLOW_VISUAL_EXT 0x8001 802 | #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D 803 | 804 | #define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) 805 | 806 | #endif /* GLX_EXT_visual_rating */ 807 | 808 | /* -------------------------- GLX_INTEL_swap_event ------------------------- */ 809 | 810 | #ifndef GLX_INTEL_swap_event 811 | #define GLX_INTEL_swap_event 1 812 | 813 | #define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 814 | #define GLX_COPY_COMPLETE_INTEL 0x8181 815 | #define GLX_FLIP_COMPLETE_INTEL 0x8182 816 | #define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 817 | 818 | #define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) 819 | 820 | #endif /* GLX_INTEL_swap_event */ 821 | 822 | /* -------------------------- GLX_MESA_agp_offset -------------------------- */ 823 | 824 | #ifndef GLX_MESA_agp_offset 825 | #define GLX_MESA_agp_offset 1 826 | 827 | typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); 828 | 829 | #define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) 830 | 831 | #define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) 832 | 833 | #endif /* GLX_MESA_agp_offset */ 834 | 835 | /* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ 836 | 837 | #ifndef GLX_MESA_copy_sub_buffer 838 | #define GLX_MESA_copy_sub_buffer 1 839 | 840 | typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); 841 | 842 | #define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) 843 | 844 | #define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) 845 | 846 | #endif /* GLX_MESA_copy_sub_buffer */ 847 | 848 | /* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ 849 | 850 | #ifndef GLX_MESA_pixmap_colormap 851 | #define GLX_MESA_pixmap_colormap 1 852 | 853 | typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); 854 | 855 | #define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) 856 | 857 | #define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) 858 | 859 | #endif /* GLX_MESA_pixmap_colormap */ 860 | 861 | /* ------------------------ GLX_MESA_query_renderer ------------------------ */ 862 | 863 | #ifndef GLX_MESA_query_renderer 864 | #define GLX_MESA_query_renderer 1 865 | 866 | #define GLX_RENDERER_VENDOR_ID_MESA 0x8183 867 | #define GLX_RENDERER_DEVICE_ID_MESA 0x8184 868 | #define GLX_RENDERER_VERSION_MESA 0x8185 869 | #define GLX_RENDERER_ACCELERATED_MESA 0x8186 870 | #define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 871 | #define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 872 | #define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 873 | #define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A 874 | #define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B 875 | #define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C 876 | #define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D 877 | #define GLX_RENDERER_ID_MESA 0x818E 878 | 879 | typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); 880 | typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); 881 | typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); 882 | typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); 883 | 884 | #define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) 885 | #define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) 886 | #define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) 887 | #define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) 888 | 889 | #define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) 890 | 891 | #endif /* GLX_MESA_query_renderer */ 892 | 893 | /* ------------------------ GLX_MESA_release_buffers ----------------------- */ 894 | 895 | #ifndef GLX_MESA_release_buffers 896 | #define GLX_MESA_release_buffers 1 897 | 898 | typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); 899 | 900 | #define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) 901 | 902 | #define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) 903 | 904 | #endif /* GLX_MESA_release_buffers */ 905 | 906 | /* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ 907 | 908 | #ifndef GLX_MESA_set_3dfx_mode 909 | #define GLX_MESA_set_3dfx_mode 1 910 | 911 | #define GLX_3DFX_WINDOW_MODE_MESA 0x1 912 | #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 913 | 914 | typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); 915 | 916 | #define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) 917 | 918 | #define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) 919 | 920 | #endif /* GLX_MESA_set_3dfx_mode */ 921 | 922 | /* ------------------------- GLX_MESA_swap_control ------------------------- */ 923 | 924 | #ifndef GLX_MESA_swap_control 925 | #define GLX_MESA_swap_control 1 926 | 927 | typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); 928 | typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); 929 | 930 | #define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) 931 | #define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) 932 | 933 | #define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) 934 | 935 | #endif /* GLX_MESA_swap_control */ 936 | 937 | /* --------------------------- GLX_NV_copy_buffer -------------------------- */ 938 | 939 | #ifndef GLX_NV_copy_buffer 940 | #define GLX_NV_copy_buffer 1 941 | 942 | typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); 943 | typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); 944 | 945 | #define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) 946 | #define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) 947 | 948 | #define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) 949 | 950 | #endif /* GLX_NV_copy_buffer */ 951 | 952 | /* --------------------------- GLX_NV_copy_image --------------------------- */ 953 | 954 | #ifndef GLX_NV_copy_image 955 | #define GLX_NV_copy_image 1 956 | 957 | typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); 958 | 959 | #define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) 960 | 961 | #define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) 962 | 963 | #endif /* GLX_NV_copy_image */ 964 | 965 | /* ------------------------ GLX_NV_delay_before_swap ----------------------- */ 966 | 967 | #ifndef GLX_NV_delay_before_swap 968 | #define GLX_NV_delay_before_swap 1 969 | 970 | typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); 971 | 972 | #define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) 973 | 974 | #define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) 975 | 976 | #endif /* GLX_NV_delay_before_swap */ 977 | 978 | /* -------------------------- GLX_NV_float_buffer -------------------------- */ 979 | 980 | #ifndef GLX_NV_float_buffer 981 | #define GLX_NV_float_buffer 1 982 | 983 | #define GLX_FLOAT_COMPONENTS_NV 0x20B0 984 | 985 | #define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) 986 | 987 | #endif /* GLX_NV_float_buffer */ 988 | 989 | /* ---------------------- GLX_NV_multisample_coverage ---------------------- */ 990 | 991 | #ifndef GLX_NV_multisample_coverage 992 | #define GLX_NV_multisample_coverage 1 993 | 994 | #define GLX_COLOR_SAMPLES_NV 0x20B3 995 | #define GLX_COVERAGE_SAMPLES_NV 100001 996 | 997 | #define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) 998 | 999 | #endif /* GLX_NV_multisample_coverage */ 1000 | 1001 | /* -------------------------- GLX_NV_present_video ------------------------- */ 1002 | 1003 | #ifndef GLX_NV_present_video 1004 | #define GLX_NV_present_video 1 1005 | 1006 | #define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 1007 | 1008 | typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); 1009 | typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); 1010 | 1011 | #define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) 1012 | #define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) 1013 | 1014 | #define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) 1015 | 1016 | #endif /* GLX_NV_present_video */ 1017 | 1018 | /* --------------------------- GLX_NV_swap_group --------------------------- */ 1019 | 1020 | #ifndef GLX_NV_swap_group 1021 | #define GLX_NV_swap_group 1 1022 | 1023 | typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); 1024 | typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); 1025 | typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); 1026 | typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); 1027 | typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); 1028 | typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); 1029 | 1030 | #define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) 1031 | #define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) 1032 | #define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) 1033 | #define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) 1034 | #define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) 1035 | #define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) 1036 | 1037 | #define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) 1038 | 1039 | #endif /* GLX_NV_swap_group */ 1040 | 1041 | /* ----------------------- GLX_NV_vertex_array_range ----------------------- */ 1042 | 1043 | #ifndef GLX_NV_vertex_array_range 1044 | #define GLX_NV_vertex_array_range 1 1045 | 1046 | typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); 1047 | typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); 1048 | 1049 | #define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) 1050 | #define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) 1051 | 1052 | #define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) 1053 | 1054 | #endif /* GLX_NV_vertex_array_range */ 1055 | 1056 | /* -------------------------- GLX_NV_video_capture ------------------------- */ 1057 | 1058 | #ifndef GLX_NV_video_capture 1059 | #define GLX_NV_video_capture 1 1060 | 1061 | #define GLX_DEVICE_ID_NV 0x20CD 1062 | #define GLX_UNIQUE_ID_NV 0x20CE 1063 | #define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF 1064 | 1065 | typedef XID GLXVideoCaptureDeviceNV; 1066 | 1067 | typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); 1068 | typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); 1069 | typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); 1070 | typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); 1071 | typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); 1072 | 1073 | #define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) 1074 | #define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) 1075 | #define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) 1076 | #define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) 1077 | #define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) 1078 | 1079 | #define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) 1080 | 1081 | #endif /* GLX_NV_video_capture */ 1082 | 1083 | /* ---------------------------- GLX_NV_video_out --------------------------- */ 1084 | 1085 | #ifndef GLX_NV_video_out 1086 | #define GLX_NV_video_out 1 1087 | 1088 | #define GLX_VIDEO_OUT_COLOR_NV 0x20C3 1089 | #define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 1090 | #define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 1091 | #define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 1092 | #define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 1093 | #define GLX_VIDEO_OUT_FRAME_NV 0x20C8 1094 | #define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 1095 | #define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA 1096 | #define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB 1097 | #define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC 1098 | 1099 | typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); 1100 | typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); 1101 | typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); 1102 | typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); 1103 | typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); 1104 | typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); 1105 | 1106 | #define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) 1107 | #define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) 1108 | #define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) 1109 | #define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) 1110 | #define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) 1111 | #define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) 1112 | 1113 | #define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) 1114 | 1115 | #endif /* GLX_NV_video_out */ 1116 | 1117 | /* -------------------------- GLX_OML_swap_method -------------------------- */ 1118 | 1119 | #ifndef GLX_OML_swap_method 1120 | #define GLX_OML_swap_method 1 1121 | 1122 | #define GLX_SWAP_METHOD_OML 0x8060 1123 | #define GLX_SWAP_EXCHANGE_OML 0x8061 1124 | #define GLX_SWAP_COPY_OML 0x8062 1125 | #define GLX_SWAP_UNDEFINED_OML 0x8063 1126 | 1127 | #define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) 1128 | 1129 | #endif /* GLX_OML_swap_method */ 1130 | 1131 | /* -------------------------- GLX_OML_sync_control ------------------------- */ 1132 | 1133 | #ifndef GLX_OML_sync_control 1134 | #define GLX_OML_sync_control 1 1135 | 1136 | typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); 1137 | typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); 1138 | typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); 1139 | typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); 1140 | typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); 1141 | 1142 | #define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) 1143 | #define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) 1144 | #define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) 1145 | #define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) 1146 | #define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) 1147 | 1148 | #define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) 1149 | 1150 | #endif /* GLX_OML_sync_control */ 1151 | 1152 | /* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ 1153 | 1154 | #ifndef GLX_SGIS_blended_overlay 1155 | #define GLX_SGIS_blended_overlay 1 1156 | 1157 | #define GLX_BLENDED_RGBA_SGIS 0x8025 1158 | 1159 | #define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) 1160 | 1161 | #endif /* GLX_SGIS_blended_overlay */ 1162 | 1163 | /* -------------------------- GLX_SGIS_color_range ------------------------- */ 1164 | 1165 | #ifndef GLX_SGIS_color_range 1166 | #define GLX_SGIS_color_range 1 1167 | 1168 | #define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) 1169 | 1170 | #endif /* GLX_SGIS_color_range */ 1171 | 1172 | /* -------------------------- GLX_SGIS_multisample ------------------------- */ 1173 | 1174 | #ifndef GLX_SGIS_multisample 1175 | #define GLX_SGIS_multisample 1 1176 | 1177 | #define GLX_SAMPLE_BUFFERS_SGIS 100000 1178 | #define GLX_SAMPLES_SGIS 100001 1179 | 1180 | #define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) 1181 | 1182 | #endif /* GLX_SGIS_multisample */ 1183 | 1184 | /* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ 1185 | 1186 | #ifndef GLX_SGIS_shared_multisample 1187 | #define GLX_SGIS_shared_multisample 1 1188 | 1189 | #define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 1190 | #define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 1191 | 1192 | #define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) 1193 | 1194 | #endif /* GLX_SGIS_shared_multisample */ 1195 | 1196 | /* --------------------------- GLX_SGIX_fbconfig --------------------------- */ 1197 | 1198 | #ifndef GLX_SGIX_fbconfig 1199 | #define GLX_SGIX_fbconfig 1 1200 | 1201 | #define GLX_RGBA_BIT_SGIX 0x00000001 1202 | #define GLX_WINDOW_BIT_SGIX 0x00000001 1203 | #define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 1204 | #define GLX_PIXMAP_BIT_SGIX 0x00000002 1205 | #define GLX_SCREEN_EXT 0x800C 1206 | #define GLX_DRAWABLE_TYPE_SGIX 0x8010 1207 | #define GLX_RENDER_TYPE_SGIX 0x8011 1208 | #define GLX_X_RENDERABLE_SGIX 0x8012 1209 | #define GLX_FBCONFIG_ID_SGIX 0x8013 1210 | #define GLX_RGBA_TYPE_SGIX 0x8014 1211 | #define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 1212 | 1213 | typedef XID GLXFBConfigIDSGIX; 1214 | typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; 1215 | 1216 | typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); 1217 | typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); 1218 | typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); 1219 | typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); 1220 | typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); 1221 | typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); 1222 | 1223 | #define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) 1224 | #define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) 1225 | #define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) 1226 | #define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) 1227 | #define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) 1228 | #define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) 1229 | 1230 | #define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) 1231 | 1232 | #endif /* GLX_SGIX_fbconfig */ 1233 | 1234 | /* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ 1235 | 1236 | #ifndef GLX_SGIX_hyperpipe 1237 | #define GLX_SGIX_hyperpipe 1 1238 | 1239 | #define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 1240 | #define GLX_PIPE_RECT_SGIX 0x00000001 1241 | #define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 1242 | #define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 1243 | #define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 1244 | #define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 1245 | #define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 1246 | #define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 1247 | #define GLX_BAD_HYPERPIPE_SGIX 92 1248 | #define GLX_HYPERPIPE_ID_SGIX 0x8030 1249 | 1250 | typedef struct { 1251 | char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 1252 | int networkId; 1253 | } GLXHyperpipeNetworkSGIX; 1254 | typedef struct { 1255 | char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 1256 | int XOrigin; 1257 | int YOrigin; 1258 | int maxHeight; 1259 | int maxWidth; 1260 | } GLXPipeRectLimits; 1261 | typedef struct { 1262 | char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 1263 | int channel; 1264 | unsigned int participationType; 1265 | int timeSlice; 1266 | } GLXHyperpipeConfigSGIX; 1267 | typedef struct { 1268 | char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 1269 | int srcXOrigin; 1270 | int srcYOrigin; 1271 | int srcWidth; 1272 | int srcHeight; 1273 | int destXOrigin; 1274 | int destYOrigin; 1275 | int destWidth; 1276 | int destHeight; 1277 | } GLXPipeRect; 1278 | 1279 | typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); 1280 | typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); 1281 | typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); 1282 | typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); 1283 | typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); 1284 | typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); 1285 | typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); 1286 | typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); 1287 | 1288 | #define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) 1289 | #define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) 1290 | #define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) 1291 | #define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) 1292 | #define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) 1293 | #define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) 1294 | #define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) 1295 | #define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) 1296 | 1297 | #define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) 1298 | 1299 | #endif /* GLX_SGIX_hyperpipe */ 1300 | 1301 | /* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ 1302 | 1303 | #ifndef GLX_SGIX_pbuffer 1304 | #define GLX_SGIX_pbuffer 1 1305 | 1306 | #define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 1307 | #define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 1308 | #define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 1309 | #define GLX_PBUFFER_BIT_SGIX 0x00000004 1310 | #define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 1311 | #define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 1312 | #define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 1313 | #define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 1314 | #define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 1315 | #define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 1316 | #define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 1317 | #define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 1318 | #define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 1319 | #define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 1320 | #define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A 1321 | #define GLX_PRESERVED_CONTENTS_SGIX 0x801B 1322 | #define GLX_LARGEST_PBUFFER_SGIX 0x801C 1323 | #define GLX_WIDTH_SGIX 0x801D 1324 | #define GLX_HEIGHT_SGIX 0x801E 1325 | #define GLX_EVENT_MASK_SGIX 0x801F 1326 | #define GLX_DAMAGED_SGIX 0x8020 1327 | #define GLX_SAVED_SGIX 0x8021 1328 | #define GLX_WINDOW_SGIX 0x8022 1329 | #define GLX_PBUFFER_SGIX 0x8023 1330 | #define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 1331 | 1332 | typedef XID GLXPbufferSGIX; 1333 | typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; 1334 | 1335 | typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); 1336 | typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); 1337 | typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); 1338 | typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); 1339 | typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); 1340 | 1341 | #define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) 1342 | #define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) 1343 | #define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) 1344 | #define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) 1345 | #define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) 1346 | 1347 | #define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) 1348 | 1349 | #endif /* GLX_SGIX_pbuffer */ 1350 | 1351 | /* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ 1352 | 1353 | #ifndef GLX_SGIX_swap_barrier 1354 | #define GLX_SGIX_swap_barrier 1 1355 | 1356 | typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); 1357 | typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); 1358 | 1359 | #define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) 1360 | #define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) 1361 | 1362 | #define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) 1363 | 1364 | #endif /* GLX_SGIX_swap_barrier */ 1365 | 1366 | /* -------------------------- GLX_SGIX_swap_group -------------------------- */ 1367 | 1368 | #ifndef GLX_SGIX_swap_group 1369 | #define GLX_SGIX_swap_group 1 1370 | 1371 | typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); 1372 | 1373 | #define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) 1374 | 1375 | #define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) 1376 | 1377 | #endif /* GLX_SGIX_swap_group */ 1378 | 1379 | /* ------------------------- GLX_SGIX_video_resize ------------------------- */ 1380 | 1381 | #ifndef GLX_SGIX_video_resize 1382 | #define GLX_SGIX_video_resize 1 1383 | 1384 | #define GLX_SYNC_FRAME_SGIX 0x00000000 1385 | #define GLX_SYNC_SWAP_SGIX 0x00000001 1386 | 1387 | typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); 1388 | typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); 1389 | typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); 1390 | typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); 1391 | typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); 1392 | 1393 | #define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) 1394 | #define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) 1395 | #define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) 1396 | #define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) 1397 | #define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) 1398 | 1399 | #define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) 1400 | 1401 | #endif /* GLX_SGIX_video_resize */ 1402 | 1403 | /* ---------------------- GLX_SGIX_visual_select_group --------------------- */ 1404 | 1405 | #ifndef GLX_SGIX_visual_select_group 1406 | #define GLX_SGIX_visual_select_group 1 1407 | 1408 | #define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 1409 | 1410 | #define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) 1411 | 1412 | #endif /* GLX_SGIX_visual_select_group */ 1413 | 1414 | /* ---------------------------- GLX_SGI_cushion ---------------------------- */ 1415 | 1416 | #ifndef GLX_SGI_cushion 1417 | #define GLX_SGI_cushion 1 1418 | 1419 | typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); 1420 | 1421 | #define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) 1422 | 1423 | #define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) 1424 | 1425 | #endif /* GLX_SGI_cushion */ 1426 | 1427 | /* ----------------------- GLX_SGI_make_current_read ----------------------- */ 1428 | 1429 | #ifndef GLX_SGI_make_current_read 1430 | #define GLX_SGI_make_current_read 1 1431 | 1432 | typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); 1433 | typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); 1434 | 1435 | #define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) 1436 | #define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) 1437 | 1438 | #define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) 1439 | 1440 | #endif /* GLX_SGI_make_current_read */ 1441 | 1442 | /* -------------------------- GLX_SGI_swap_control ------------------------- */ 1443 | 1444 | #ifndef GLX_SGI_swap_control 1445 | #define GLX_SGI_swap_control 1 1446 | 1447 | typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); 1448 | 1449 | #define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) 1450 | 1451 | #define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) 1452 | 1453 | #endif /* GLX_SGI_swap_control */ 1454 | 1455 | /* --------------------------- GLX_SGI_video_sync -------------------------- */ 1456 | 1457 | #ifndef GLX_SGI_video_sync 1458 | #define GLX_SGI_video_sync 1 1459 | 1460 | typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); 1461 | typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); 1462 | 1463 | #define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) 1464 | #define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) 1465 | 1466 | #define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) 1467 | 1468 | #endif /* GLX_SGI_video_sync */ 1469 | 1470 | /* --------------------- GLX_SUN_get_transparent_index --------------------- */ 1471 | 1472 | #ifndef GLX_SUN_get_transparent_index 1473 | #define GLX_SUN_get_transparent_index 1 1474 | 1475 | typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); 1476 | 1477 | #define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) 1478 | 1479 | #define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) 1480 | 1481 | #endif /* GLX_SUN_get_transparent_index */ 1482 | 1483 | /* -------------------------- GLX_SUN_video_resize ------------------------- */ 1484 | 1485 | #ifndef GLX_SUN_video_resize 1486 | #define GLX_SUN_video_resize 1 1487 | 1488 | #define GLX_VIDEO_RESIZE_SUN 0x8171 1489 | #define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD 1490 | 1491 | typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); 1492 | typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); 1493 | 1494 | #define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) 1495 | #define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) 1496 | 1497 | #define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) 1498 | 1499 | #endif /* GLX_SUN_video_resize */ 1500 | 1501 | /* ------------------------------------------------------------------------- */ 1502 | 1503 | #ifdef GLEW_MX 1504 | #define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT 1505 | #define GLXEW_VAR_EXPORT 1506 | #else 1507 | #define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT 1508 | #define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT 1509 | #endif /* GLEW_MX */ 1510 | 1511 | GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; 1512 | 1513 | GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; 1514 | GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; 1515 | GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; 1516 | GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; 1517 | GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; 1518 | GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; 1519 | GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; 1520 | GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; 1521 | GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; 1522 | GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; 1523 | GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; 1524 | GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; 1525 | GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; 1526 | GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; 1527 | GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; 1528 | GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; 1529 | GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; 1530 | 1531 | GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; 1532 | GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; 1533 | GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; 1534 | GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; 1535 | GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; 1536 | GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; 1537 | GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; 1538 | GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; 1539 | GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; 1540 | 1541 | GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; 1542 | 1543 | GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; 1544 | GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; 1545 | GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; 1546 | 1547 | GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; 1548 | GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; 1549 | GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; 1550 | GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; 1551 | 1552 | GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; 1553 | 1554 | GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; 1555 | GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; 1556 | 1557 | GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; 1558 | 1559 | GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; 1560 | 1561 | GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; 1562 | 1563 | GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; 1564 | GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; 1565 | GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; 1566 | GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; 1567 | 1568 | GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; 1569 | 1570 | GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; 1571 | 1572 | GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; 1573 | GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; 1574 | 1575 | GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; 1576 | GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; 1577 | 1578 | GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; 1579 | 1580 | GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; 1581 | 1582 | GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; 1583 | GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; 1584 | 1585 | GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; 1586 | GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; 1587 | GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; 1588 | GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; 1589 | GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; 1590 | GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; 1591 | 1592 | GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; 1593 | GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; 1594 | 1595 | GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; 1596 | GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; 1597 | GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; 1598 | GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; 1599 | GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; 1600 | 1601 | GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; 1602 | GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; 1603 | GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; 1604 | GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; 1605 | GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; 1606 | GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; 1607 | 1608 | GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; 1609 | GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; 1610 | GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; 1611 | GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; 1612 | GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; 1613 | 1614 | GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; 1615 | GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; 1616 | GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; 1617 | GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; 1618 | GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; 1619 | GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; 1620 | 1621 | GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; 1622 | GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; 1623 | GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; 1624 | GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; 1625 | GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; 1626 | GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; 1627 | GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; 1628 | GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; 1629 | 1630 | GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; 1631 | GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; 1632 | GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; 1633 | GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; 1634 | GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; 1635 | 1636 | GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; 1637 | GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; 1638 | 1639 | GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; 1640 | 1641 | GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; 1642 | GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; 1643 | GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; 1644 | GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; 1645 | GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; 1646 | 1647 | GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; 1648 | 1649 | GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; 1650 | GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; 1651 | 1652 | GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; 1653 | 1654 | GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; 1655 | GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; 1656 | 1657 | GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; 1658 | 1659 | GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; 1660 | GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; 1661 | 1662 | #if defined(GLEW_MX) 1663 | struct GLXEWContextStruct 1664 | { 1665 | #endif /* GLEW_MX */ 1666 | 1667 | GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; 1668 | GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; 1669 | GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; 1670 | GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; 1671 | GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; 1672 | GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; 1673 | GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; 1674 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; 1675 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; 1676 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; 1677 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; 1678 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; 1679 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; 1680 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; 1681 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; 1682 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; 1683 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; 1684 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; 1685 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; 1686 | GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; 1687 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; 1688 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; 1689 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; 1690 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; 1691 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; 1692 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; 1693 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; 1694 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; 1695 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; 1696 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; 1697 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; 1698 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; 1699 | GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; 1700 | GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; 1701 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; 1702 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; 1703 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; 1704 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; 1705 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; 1706 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; 1707 | GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; 1708 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; 1709 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; 1710 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; 1711 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; 1712 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; 1713 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; 1714 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; 1715 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; 1716 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; 1717 | GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; 1718 | GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; 1719 | GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; 1720 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; 1721 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; 1722 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; 1723 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; 1724 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; 1725 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; 1726 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; 1727 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; 1728 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; 1729 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; 1730 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; 1731 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; 1732 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; 1733 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; 1734 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; 1735 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; 1736 | GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; 1737 | 1738 | #ifdef GLEW_MX 1739 | }; /* GLXEWContextStruct */ 1740 | #endif /* GLEW_MX */ 1741 | 1742 | /* ------------------------------------------------------------------------ */ 1743 | 1744 | #ifdef GLEW_MX 1745 | 1746 | typedef struct GLXEWContextStruct GLXEWContext; 1747 | GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); 1748 | GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); 1749 | 1750 | #define glxewInit() glxewContextInit(glxewGetContext()) 1751 | #define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) 1752 | 1753 | #define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) 1754 | #define GLXEW_GET_FUN(x) x 1755 | 1756 | #else /* GLEW_MX */ 1757 | 1758 | GLEWAPI GLenum GLEWAPIENTRY glxewInit (); 1759 | GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); 1760 | 1761 | #define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) 1762 | #define GLXEW_GET_FUN(x) x 1763 | 1764 | #endif /* GLEW_MX */ 1765 | 1766 | GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); 1767 | 1768 | #ifdef __cplusplus 1769 | } 1770 | #endif 1771 | 1772 | #endif /* __glxew_h__ */ 1773 | -------------------------------------------------------------------------------- /source/GLEW/wglew.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** The OpenGL Extension Wrangler Library 3 | ** Copyright (C) 2008-2015, Nigel Stewart 4 | ** Copyright (C) 2002-2008, Milan Ikits 5 | ** Copyright (C) 2002-2008, Marcelo E. Magallon 6 | ** Copyright (C) 2002, Lev Povalahev 7 | ** All rights reserved. 8 | ** 9 | ** Redistribution and use in source and binary forms, with or without 10 | ** modification, are permitted provided that the following conditions are met: 11 | ** 12 | ** * Redistributions of source code must retain the above copyright notice, 13 | ** this list of conditions and the following disclaimer. 14 | ** * Redistributions in binary form must reproduce the above copyright notice, 15 | ** this list of conditions and the following disclaimer in the documentation 16 | ** and/or other materials provided with the distribution. 17 | ** * The name of the author may be used to endorse or promote products 18 | ** derived from this software without specific prior written permission. 19 | ** 20 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24 | ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | ** THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | /* 34 | ** Copyright (c) 2007 The Khronos Group Inc. 35 | ** 36 | ** Permission is hereby granted, free of charge, to any person obtaining a 37 | ** copy of this software and/or associated documentation files (the 38 | ** "Materials"), to deal in the Materials without restriction, including 39 | ** without limitation the rights to use, copy, modify, merge, publish, 40 | ** distribute, sublicense, and/or sell copies of the Materials, and to 41 | ** permit persons to whom the Materials are furnished to do so, subject to 42 | ** the following conditions: 43 | ** 44 | ** The above copyright notice and this permission notice shall be included 45 | ** in all copies or substantial portions of the Materials. 46 | ** 47 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 48 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 49 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 50 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 51 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 52 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 53 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 54 | */ 55 | 56 | #ifndef __wglew_h__ 57 | #define __wglew_h__ 58 | #define __WGLEW_H__ 59 | 60 | #ifdef __wglext_h_ 61 | #error wglext.h included before wglew.h 62 | #endif 63 | 64 | #define __wglext_h_ 65 | 66 | #if !defined(WINAPI) 67 | # ifndef WIN32_LEAN_AND_MEAN 68 | # define WIN32_LEAN_AND_MEAN 1 69 | # endif 70 | #include 71 | # undef WIN32_LEAN_AND_MEAN 72 | #endif 73 | 74 | /* 75 | * GLEW_STATIC needs to be set when using the static version. 76 | * GLEW_BUILD is set when building the DLL version. 77 | */ 78 | #ifdef GLEW_STATIC 79 | # define GLEWAPI extern 80 | #else 81 | # ifdef GLEW_BUILD 82 | # define GLEWAPI extern __declspec(dllexport) 83 | # else 84 | # define GLEWAPI extern __declspec(dllimport) 85 | # endif 86 | #endif 87 | 88 | #ifdef __cplusplus 89 | extern "C" { 90 | #endif 91 | 92 | /* -------------------------- WGL_3DFX_multisample ------------------------- */ 93 | 94 | #ifndef WGL_3DFX_multisample 95 | #define WGL_3DFX_multisample 1 96 | 97 | #define WGL_SAMPLE_BUFFERS_3DFX 0x2060 98 | #define WGL_SAMPLES_3DFX 0x2061 99 | 100 | #define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) 101 | 102 | #endif /* WGL_3DFX_multisample */ 103 | 104 | /* ------------------------- WGL_3DL_stereo_control ------------------------ */ 105 | 106 | #ifndef WGL_3DL_stereo_control 107 | #define WGL_3DL_stereo_control 1 108 | 109 | #define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 110 | #define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 111 | #define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 112 | #define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 113 | 114 | typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); 115 | 116 | #define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) 117 | 118 | #define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) 119 | 120 | #endif /* WGL_3DL_stereo_control */ 121 | 122 | /* ------------------------ WGL_AMD_gpu_association ------------------------ */ 123 | 124 | #ifndef WGL_AMD_gpu_association 125 | #define WGL_AMD_gpu_association 1 126 | 127 | #define WGL_GPU_VENDOR_AMD 0x1F00 128 | #define WGL_GPU_RENDERER_STRING_AMD 0x1F01 129 | #define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 130 | #define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 131 | #define WGL_GPU_RAM_AMD 0x21A3 132 | #define WGL_GPU_CLOCK_AMD 0x21A4 133 | #define WGL_GPU_NUM_PIPES_AMD 0x21A5 134 | #define WGL_GPU_NUM_SIMD_AMD 0x21A6 135 | #define WGL_GPU_NUM_RB_AMD 0x21A7 136 | #define WGL_GPU_NUM_SPI_AMD 0x21A8 137 | 138 | typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 139 | typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); 140 | typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); 141 | typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); 142 | typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); 143 | typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); 144 | typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); 145 | typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); 146 | typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); 147 | 148 | #define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) 149 | #define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) 150 | #define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) 151 | #define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) 152 | #define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) 153 | #define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) 154 | #define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) 155 | #define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) 156 | #define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) 157 | 158 | #define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) 159 | 160 | #endif /* WGL_AMD_gpu_association */ 161 | 162 | /* ------------------------- WGL_ARB_buffer_region ------------------------- */ 163 | 164 | #ifndef WGL_ARB_buffer_region 165 | #define WGL_ARB_buffer_region 1 166 | 167 | #define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 168 | #define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 169 | #define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 170 | #define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 171 | 172 | typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); 173 | typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); 174 | typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); 175 | typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); 176 | 177 | #define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) 178 | #define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) 179 | #define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) 180 | #define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) 181 | 182 | #define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) 183 | 184 | #endif /* WGL_ARB_buffer_region */ 185 | 186 | /* --------------------- WGL_ARB_context_flush_control --------------------- */ 187 | 188 | #ifndef WGL_ARB_context_flush_control 189 | #define WGL_ARB_context_flush_control 1 190 | 191 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 192 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 193 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 194 | 195 | #define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) 196 | 197 | #endif /* WGL_ARB_context_flush_control */ 198 | 199 | /* ------------------------- WGL_ARB_create_context ------------------------ */ 200 | 201 | #ifndef WGL_ARB_create_context 202 | #define WGL_ARB_create_context 1 203 | 204 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 205 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 206 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 207 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 208 | #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 209 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 210 | #define ERROR_INVALID_VERSION_ARB 0x2095 211 | #define ERROR_INVALID_PROFILE_ARB 0x2096 212 | 213 | typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); 214 | 215 | #define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) 216 | 217 | #define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) 218 | 219 | #endif /* WGL_ARB_create_context */ 220 | 221 | /* --------------------- WGL_ARB_create_context_profile -------------------- */ 222 | 223 | #ifndef WGL_ARB_create_context_profile 224 | #define WGL_ARB_create_context_profile 1 225 | 226 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 227 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 228 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 229 | 230 | #define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) 231 | 232 | #endif /* WGL_ARB_create_context_profile */ 233 | 234 | /* ------------------- WGL_ARB_create_context_robustness ------------------- */ 235 | 236 | #ifndef WGL_ARB_create_context_robustness 237 | #define WGL_ARB_create_context_robustness 1 238 | 239 | #define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 240 | #define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 241 | #define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 242 | #define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 243 | 244 | #define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) 245 | 246 | #endif /* WGL_ARB_create_context_robustness */ 247 | 248 | /* ----------------------- WGL_ARB_extensions_string ----------------------- */ 249 | 250 | #ifndef WGL_ARB_extensions_string 251 | #define WGL_ARB_extensions_string 1 252 | 253 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); 254 | 255 | #define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) 256 | 257 | #define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) 258 | 259 | #endif /* WGL_ARB_extensions_string */ 260 | 261 | /* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ 262 | 263 | #ifndef WGL_ARB_framebuffer_sRGB 264 | #define WGL_ARB_framebuffer_sRGB 1 265 | 266 | #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 267 | 268 | #define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) 269 | 270 | #endif /* WGL_ARB_framebuffer_sRGB */ 271 | 272 | /* ----------------------- WGL_ARB_make_current_read ----------------------- */ 273 | 274 | #ifndef WGL_ARB_make_current_read 275 | #define WGL_ARB_make_current_read 1 276 | 277 | #define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 278 | #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 279 | 280 | typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); 281 | typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); 282 | 283 | #define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) 284 | #define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) 285 | 286 | #define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) 287 | 288 | #endif /* WGL_ARB_make_current_read */ 289 | 290 | /* -------------------------- WGL_ARB_multisample -------------------------- */ 291 | 292 | #ifndef WGL_ARB_multisample 293 | #define WGL_ARB_multisample 1 294 | 295 | #define WGL_SAMPLE_BUFFERS_ARB 0x2041 296 | #define WGL_SAMPLES_ARB 0x2042 297 | 298 | #define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) 299 | 300 | #endif /* WGL_ARB_multisample */ 301 | 302 | /* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ 303 | 304 | #ifndef WGL_ARB_pbuffer 305 | #define WGL_ARB_pbuffer 1 306 | 307 | #define WGL_DRAW_TO_PBUFFER_ARB 0x202D 308 | #define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E 309 | #define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F 310 | #define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 311 | #define WGL_PBUFFER_LARGEST_ARB 0x2033 312 | #define WGL_PBUFFER_WIDTH_ARB 0x2034 313 | #define WGL_PBUFFER_HEIGHT_ARB 0x2035 314 | #define WGL_PBUFFER_LOST_ARB 0x2036 315 | 316 | DECLARE_HANDLE(HPBUFFERARB); 317 | 318 | typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); 319 | typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); 320 | typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); 321 | typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); 322 | typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); 323 | 324 | #define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) 325 | #define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) 326 | #define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) 327 | #define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) 328 | #define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) 329 | 330 | #define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) 331 | 332 | #endif /* WGL_ARB_pbuffer */ 333 | 334 | /* -------------------------- WGL_ARB_pixel_format ------------------------- */ 335 | 336 | #ifndef WGL_ARB_pixel_format 337 | #define WGL_ARB_pixel_format 1 338 | 339 | #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 340 | #define WGL_DRAW_TO_WINDOW_ARB 0x2001 341 | #define WGL_DRAW_TO_BITMAP_ARB 0x2002 342 | #define WGL_ACCELERATION_ARB 0x2003 343 | #define WGL_NEED_PALETTE_ARB 0x2004 344 | #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 345 | #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 346 | #define WGL_SWAP_METHOD_ARB 0x2007 347 | #define WGL_NUMBER_OVERLAYS_ARB 0x2008 348 | #define WGL_NUMBER_UNDERLAYS_ARB 0x2009 349 | #define WGL_TRANSPARENT_ARB 0x200A 350 | #define WGL_SHARE_DEPTH_ARB 0x200C 351 | #define WGL_SHARE_STENCIL_ARB 0x200D 352 | #define WGL_SHARE_ACCUM_ARB 0x200E 353 | #define WGL_SUPPORT_GDI_ARB 0x200F 354 | #define WGL_SUPPORT_OPENGL_ARB 0x2010 355 | #define WGL_DOUBLE_BUFFER_ARB 0x2011 356 | #define WGL_STEREO_ARB 0x2012 357 | #define WGL_PIXEL_TYPE_ARB 0x2013 358 | #define WGL_COLOR_BITS_ARB 0x2014 359 | #define WGL_RED_BITS_ARB 0x2015 360 | #define WGL_RED_SHIFT_ARB 0x2016 361 | #define WGL_GREEN_BITS_ARB 0x2017 362 | #define WGL_GREEN_SHIFT_ARB 0x2018 363 | #define WGL_BLUE_BITS_ARB 0x2019 364 | #define WGL_BLUE_SHIFT_ARB 0x201A 365 | #define WGL_ALPHA_BITS_ARB 0x201B 366 | #define WGL_ALPHA_SHIFT_ARB 0x201C 367 | #define WGL_ACCUM_BITS_ARB 0x201D 368 | #define WGL_ACCUM_RED_BITS_ARB 0x201E 369 | #define WGL_ACCUM_GREEN_BITS_ARB 0x201F 370 | #define WGL_ACCUM_BLUE_BITS_ARB 0x2020 371 | #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 372 | #define WGL_DEPTH_BITS_ARB 0x2022 373 | #define WGL_STENCIL_BITS_ARB 0x2023 374 | #define WGL_AUX_BUFFERS_ARB 0x2024 375 | #define WGL_NO_ACCELERATION_ARB 0x2025 376 | #define WGL_GENERIC_ACCELERATION_ARB 0x2026 377 | #define WGL_FULL_ACCELERATION_ARB 0x2027 378 | #define WGL_SWAP_EXCHANGE_ARB 0x2028 379 | #define WGL_SWAP_COPY_ARB 0x2029 380 | #define WGL_SWAP_UNDEFINED_ARB 0x202A 381 | #define WGL_TYPE_RGBA_ARB 0x202B 382 | #define WGL_TYPE_COLORINDEX_ARB 0x202C 383 | #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 384 | #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 385 | #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 386 | #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A 387 | #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B 388 | 389 | typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); 390 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); 391 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); 392 | 393 | #define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) 394 | #define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) 395 | #define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) 396 | 397 | #define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) 398 | 399 | #endif /* WGL_ARB_pixel_format */ 400 | 401 | /* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ 402 | 403 | #ifndef WGL_ARB_pixel_format_float 404 | #define WGL_ARB_pixel_format_float 1 405 | 406 | #define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 407 | 408 | #define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) 409 | 410 | #endif /* WGL_ARB_pixel_format_float */ 411 | 412 | /* ------------------------- WGL_ARB_render_texture ------------------------ */ 413 | 414 | #ifndef WGL_ARB_render_texture 415 | #define WGL_ARB_render_texture 1 416 | 417 | #define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 418 | #define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 419 | #define WGL_TEXTURE_FORMAT_ARB 0x2072 420 | #define WGL_TEXTURE_TARGET_ARB 0x2073 421 | #define WGL_MIPMAP_TEXTURE_ARB 0x2074 422 | #define WGL_TEXTURE_RGB_ARB 0x2075 423 | #define WGL_TEXTURE_RGBA_ARB 0x2076 424 | #define WGL_NO_TEXTURE_ARB 0x2077 425 | #define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 426 | #define WGL_TEXTURE_1D_ARB 0x2079 427 | #define WGL_TEXTURE_2D_ARB 0x207A 428 | #define WGL_MIPMAP_LEVEL_ARB 0x207B 429 | #define WGL_CUBE_MAP_FACE_ARB 0x207C 430 | #define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D 431 | #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E 432 | #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F 433 | #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 434 | #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 435 | #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 436 | #define WGL_FRONT_LEFT_ARB 0x2083 437 | #define WGL_FRONT_RIGHT_ARB 0x2084 438 | #define WGL_BACK_LEFT_ARB 0x2085 439 | #define WGL_BACK_RIGHT_ARB 0x2086 440 | #define WGL_AUX0_ARB 0x2087 441 | #define WGL_AUX1_ARB 0x2088 442 | #define WGL_AUX2_ARB 0x2089 443 | #define WGL_AUX3_ARB 0x208A 444 | #define WGL_AUX4_ARB 0x208B 445 | #define WGL_AUX5_ARB 0x208C 446 | #define WGL_AUX6_ARB 0x208D 447 | #define WGL_AUX7_ARB 0x208E 448 | #define WGL_AUX8_ARB 0x208F 449 | #define WGL_AUX9_ARB 0x2090 450 | 451 | typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); 452 | typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); 453 | typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); 454 | 455 | #define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) 456 | #define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) 457 | #define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) 458 | 459 | #define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) 460 | 461 | #endif /* WGL_ARB_render_texture */ 462 | 463 | /* ---------------- WGL_ARB_robustness_application_isolation --------------- */ 464 | 465 | #ifndef WGL_ARB_robustness_application_isolation 466 | #define WGL_ARB_robustness_application_isolation 1 467 | 468 | #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 469 | 470 | #define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) 471 | 472 | #endif /* WGL_ARB_robustness_application_isolation */ 473 | 474 | /* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ 475 | 476 | #ifndef WGL_ARB_robustness_share_group_isolation 477 | #define WGL_ARB_robustness_share_group_isolation 1 478 | 479 | #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 480 | 481 | #define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) 482 | 483 | #endif /* WGL_ARB_robustness_share_group_isolation */ 484 | 485 | /* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ 486 | 487 | #ifndef WGL_ATI_pixel_format_float 488 | #define WGL_ATI_pixel_format_float 1 489 | 490 | #define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 491 | #define GL_RGBA_FLOAT_MODE_ATI 0x8820 492 | #define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 493 | 494 | #define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) 495 | 496 | #endif /* WGL_ATI_pixel_format_float */ 497 | 498 | /* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ 499 | 500 | #ifndef WGL_ATI_render_texture_rectangle 501 | #define WGL_ATI_render_texture_rectangle 1 502 | 503 | #define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 504 | 505 | #define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) 506 | 507 | #endif /* WGL_ATI_render_texture_rectangle */ 508 | 509 | /* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ 510 | 511 | #ifndef WGL_EXT_create_context_es2_profile 512 | #define WGL_EXT_create_context_es2_profile 1 513 | 514 | #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 515 | 516 | #define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) 517 | 518 | #endif /* WGL_EXT_create_context_es2_profile */ 519 | 520 | /* ------------------- WGL_EXT_create_context_es_profile ------------------- */ 521 | 522 | #ifndef WGL_EXT_create_context_es_profile 523 | #define WGL_EXT_create_context_es_profile 1 524 | 525 | #define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 526 | 527 | #define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) 528 | 529 | #endif /* WGL_EXT_create_context_es_profile */ 530 | 531 | /* -------------------------- WGL_EXT_depth_float -------------------------- */ 532 | 533 | #ifndef WGL_EXT_depth_float 534 | #define WGL_EXT_depth_float 1 535 | 536 | #define WGL_DEPTH_FLOAT_EXT 0x2040 537 | 538 | #define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) 539 | 540 | #endif /* WGL_EXT_depth_float */ 541 | 542 | /* ---------------------- WGL_EXT_display_color_table ---------------------- */ 543 | 544 | #ifndef WGL_EXT_display_color_table 545 | #define WGL_EXT_display_color_table 1 546 | 547 | typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); 548 | typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); 549 | typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); 550 | typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); 551 | 552 | #define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) 553 | #define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) 554 | #define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) 555 | #define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) 556 | 557 | #define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) 558 | 559 | #endif /* WGL_EXT_display_color_table */ 560 | 561 | /* ----------------------- WGL_EXT_extensions_string ----------------------- */ 562 | 563 | #ifndef WGL_EXT_extensions_string 564 | #define WGL_EXT_extensions_string 1 565 | 566 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); 567 | 568 | #define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) 569 | 570 | #define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) 571 | 572 | #endif /* WGL_EXT_extensions_string */ 573 | 574 | /* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ 575 | 576 | #ifndef WGL_EXT_framebuffer_sRGB 577 | #define WGL_EXT_framebuffer_sRGB 1 578 | 579 | #define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 580 | 581 | #define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) 582 | 583 | #endif /* WGL_EXT_framebuffer_sRGB */ 584 | 585 | /* ----------------------- WGL_EXT_make_current_read ----------------------- */ 586 | 587 | #ifndef WGL_EXT_make_current_read 588 | #define WGL_EXT_make_current_read 1 589 | 590 | #define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 591 | 592 | typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); 593 | typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); 594 | 595 | #define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) 596 | #define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) 597 | 598 | #define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) 599 | 600 | #endif /* WGL_EXT_make_current_read */ 601 | 602 | /* -------------------------- WGL_EXT_multisample -------------------------- */ 603 | 604 | #ifndef WGL_EXT_multisample 605 | #define WGL_EXT_multisample 1 606 | 607 | #define WGL_SAMPLE_BUFFERS_EXT 0x2041 608 | #define WGL_SAMPLES_EXT 0x2042 609 | 610 | #define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) 611 | 612 | #endif /* WGL_EXT_multisample */ 613 | 614 | /* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ 615 | 616 | #ifndef WGL_EXT_pbuffer 617 | #define WGL_EXT_pbuffer 1 618 | 619 | #define WGL_DRAW_TO_PBUFFER_EXT 0x202D 620 | #define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E 621 | #define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F 622 | #define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 623 | #define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 624 | #define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 625 | #define WGL_PBUFFER_LARGEST_EXT 0x2033 626 | #define WGL_PBUFFER_WIDTH_EXT 0x2034 627 | #define WGL_PBUFFER_HEIGHT_EXT 0x2035 628 | 629 | DECLARE_HANDLE(HPBUFFEREXT); 630 | 631 | typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); 632 | typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); 633 | typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); 634 | typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); 635 | typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); 636 | 637 | #define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) 638 | #define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) 639 | #define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) 640 | #define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) 641 | #define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) 642 | 643 | #define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) 644 | 645 | #endif /* WGL_EXT_pbuffer */ 646 | 647 | /* -------------------------- WGL_EXT_pixel_format ------------------------- */ 648 | 649 | #ifndef WGL_EXT_pixel_format 650 | #define WGL_EXT_pixel_format 1 651 | 652 | #define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 653 | #define WGL_DRAW_TO_WINDOW_EXT 0x2001 654 | #define WGL_DRAW_TO_BITMAP_EXT 0x2002 655 | #define WGL_ACCELERATION_EXT 0x2003 656 | #define WGL_NEED_PALETTE_EXT 0x2004 657 | #define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 658 | #define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 659 | #define WGL_SWAP_METHOD_EXT 0x2007 660 | #define WGL_NUMBER_OVERLAYS_EXT 0x2008 661 | #define WGL_NUMBER_UNDERLAYS_EXT 0x2009 662 | #define WGL_TRANSPARENT_EXT 0x200A 663 | #define WGL_TRANSPARENT_VALUE_EXT 0x200B 664 | #define WGL_SHARE_DEPTH_EXT 0x200C 665 | #define WGL_SHARE_STENCIL_EXT 0x200D 666 | #define WGL_SHARE_ACCUM_EXT 0x200E 667 | #define WGL_SUPPORT_GDI_EXT 0x200F 668 | #define WGL_SUPPORT_OPENGL_EXT 0x2010 669 | #define WGL_DOUBLE_BUFFER_EXT 0x2011 670 | #define WGL_STEREO_EXT 0x2012 671 | #define WGL_PIXEL_TYPE_EXT 0x2013 672 | #define WGL_COLOR_BITS_EXT 0x2014 673 | #define WGL_RED_BITS_EXT 0x2015 674 | #define WGL_RED_SHIFT_EXT 0x2016 675 | #define WGL_GREEN_BITS_EXT 0x2017 676 | #define WGL_GREEN_SHIFT_EXT 0x2018 677 | #define WGL_BLUE_BITS_EXT 0x2019 678 | #define WGL_BLUE_SHIFT_EXT 0x201A 679 | #define WGL_ALPHA_BITS_EXT 0x201B 680 | #define WGL_ALPHA_SHIFT_EXT 0x201C 681 | #define WGL_ACCUM_BITS_EXT 0x201D 682 | #define WGL_ACCUM_RED_BITS_EXT 0x201E 683 | #define WGL_ACCUM_GREEN_BITS_EXT 0x201F 684 | #define WGL_ACCUM_BLUE_BITS_EXT 0x2020 685 | #define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 686 | #define WGL_DEPTH_BITS_EXT 0x2022 687 | #define WGL_STENCIL_BITS_EXT 0x2023 688 | #define WGL_AUX_BUFFERS_EXT 0x2024 689 | #define WGL_NO_ACCELERATION_EXT 0x2025 690 | #define WGL_GENERIC_ACCELERATION_EXT 0x2026 691 | #define WGL_FULL_ACCELERATION_EXT 0x2027 692 | #define WGL_SWAP_EXCHANGE_EXT 0x2028 693 | #define WGL_SWAP_COPY_EXT 0x2029 694 | #define WGL_SWAP_UNDEFINED_EXT 0x202A 695 | #define WGL_TYPE_RGBA_EXT 0x202B 696 | #define WGL_TYPE_COLORINDEX_EXT 0x202C 697 | 698 | typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); 699 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); 700 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); 701 | 702 | #define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) 703 | #define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) 704 | #define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) 705 | 706 | #define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) 707 | 708 | #endif /* WGL_EXT_pixel_format */ 709 | 710 | /* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ 711 | 712 | #ifndef WGL_EXT_pixel_format_packed_float 713 | #define WGL_EXT_pixel_format_packed_float 1 714 | 715 | #define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 716 | 717 | #define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) 718 | 719 | #endif /* WGL_EXT_pixel_format_packed_float */ 720 | 721 | /* -------------------------- WGL_EXT_swap_control ------------------------- */ 722 | 723 | #ifndef WGL_EXT_swap_control 724 | #define WGL_EXT_swap_control 1 725 | 726 | typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); 727 | typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); 728 | 729 | #define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) 730 | #define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) 731 | 732 | #define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) 733 | 734 | #endif /* WGL_EXT_swap_control */ 735 | 736 | /* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ 737 | 738 | #ifndef WGL_EXT_swap_control_tear 739 | #define WGL_EXT_swap_control_tear 1 740 | 741 | #define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) 742 | 743 | #endif /* WGL_EXT_swap_control_tear */ 744 | 745 | /* --------------------- WGL_I3D_digital_video_control --------------------- */ 746 | 747 | #ifndef WGL_I3D_digital_video_control 748 | #define WGL_I3D_digital_video_control 1 749 | 750 | #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 751 | #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 752 | #define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 753 | #define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 754 | 755 | typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); 756 | typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); 757 | 758 | #define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) 759 | #define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) 760 | 761 | #define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) 762 | 763 | #endif /* WGL_I3D_digital_video_control */ 764 | 765 | /* ----------------------------- WGL_I3D_gamma ----------------------------- */ 766 | 767 | #ifndef WGL_I3D_gamma 768 | #define WGL_I3D_gamma 1 769 | 770 | #define WGL_GAMMA_TABLE_SIZE_I3D 0x204E 771 | #define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F 772 | 773 | typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); 774 | typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); 775 | typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); 776 | typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); 777 | 778 | #define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) 779 | #define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) 780 | #define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) 781 | #define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) 782 | 783 | #define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) 784 | 785 | #endif /* WGL_I3D_gamma */ 786 | 787 | /* ---------------------------- WGL_I3D_genlock ---------------------------- */ 788 | 789 | #ifndef WGL_I3D_genlock 790 | #define WGL_I3D_genlock 1 791 | 792 | #define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 793 | #define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 794 | #define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 795 | #define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 796 | #define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 797 | #define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 798 | #define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A 799 | #define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B 800 | #define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C 801 | 802 | typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); 803 | typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); 804 | typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); 805 | typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); 806 | typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); 807 | typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); 808 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); 809 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); 810 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); 811 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); 812 | typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); 813 | typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); 814 | 815 | #define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) 816 | #define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) 817 | #define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) 818 | #define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) 819 | #define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) 820 | #define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) 821 | #define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) 822 | #define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) 823 | #define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) 824 | #define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) 825 | #define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) 826 | #define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) 827 | 828 | #define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) 829 | 830 | #endif /* WGL_I3D_genlock */ 831 | 832 | /* -------------------------- WGL_I3D_image_buffer ------------------------- */ 833 | 834 | #ifndef WGL_I3D_image_buffer 835 | #define WGL_I3D_image_buffer 1 836 | 837 | #define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 838 | #define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 839 | 840 | typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); 841 | typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); 842 | typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); 843 | typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); 844 | 845 | #define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) 846 | #define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) 847 | #define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) 848 | #define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) 849 | 850 | #define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) 851 | 852 | #endif /* WGL_I3D_image_buffer */ 853 | 854 | /* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ 855 | 856 | #ifndef WGL_I3D_swap_frame_lock 857 | #define WGL_I3D_swap_frame_lock 1 858 | 859 | typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); 860 | typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); 861 | typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); 862 | typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); 863 | 864 | #define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) 865 | #define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) 866 | #define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) 867 | #define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) 868 | 869 | #define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) 870 | 871 | #endif /* WGL_I3D_swap_frame_lock */ 872 | 873 | /* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ 874 | 875 | #ifndef WGL_I3D_swap_frame_usage 876 | #define WGL_I3D_swap_frame_usage 1 877 | 878 | typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); 879 | typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); 880 | typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); 881 | typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); 882 | 883 | #define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) 884 | #define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) 885 | #define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) 886 | #define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) 887 | 888 | #define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) 889 | 890 | #endif /* WGL_I3D_swap_frame_usage */ 891 | 892 | /* --------------------------- WGL_NV_DX_interop --------------------------- */ 893 | 894 | #ifndef WGL_NV_DX_interop 895 | #define WGL_NV_DX_interop 1 896 | 897 | #define WGL_ACCESS_READ_ONLY_NV 0x0000 898 | #define WGL_ACCESS_READ_WRITE_NV 0x0001 899 | #define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 900 | 901 | typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); 902 | typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); 903 | typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); 904 | typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); 905 | typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); 906 | typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); 907 | typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); 908 | typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); 909 | 910 | #define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) 911 | #define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) 912 | #define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) 913 | #define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) 914 | #define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) 915 | #define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) 916 | #define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) 917 | #define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) 918 | 919 | #define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) 920 | 921 | #endif /* WGL_NV_DX_interop */ 922 | 923 | /* --------------------------- WGL_NV_DX_interop2 -------------------------- */ 924 | 925 | #ifndef WGL_NV_DX_interop2 926 | #define WGL_NV_DX_interop2 1 927 | 928 | #define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) 929 | 930 | #endif /* WGL_NV_DX_interop2 */ 931 | 932 | /* --------------------------- WGL_NV_copy_image --------------------------- */ 933 | 934 | #ifndef WGL_NV_copy_image 935 | #define WGL_NV_copy_image 1 936 | 937 | typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); 938 | 939 | #define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) 940 | 941 | #define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) 942 | 943 | #endif /* WGL_NV_copy_image */ 944 | 945 | /* ------------------------ WGL_NV_delay_before_swap ----------------------- */ 946 | 947 | #ifndef WGL_NV_delay_before_swap 948 | #define WGL_NV_delay_before_swap 1 949 | 950 | typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); 951 | 952 | #define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) 953 | 954 | #define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) 955 | 956 | #endif /* WGL_NV_delay_before_swap */ 957 | 958 | /* -------------------------- WGL_NV_float_buffer -------------------------- */ 959 | 960 | #ifndef WGL_NV_float_buffer 961 | #define WGL_NV_float_buffer 1 962 | 963 | #define WGL_FLOAT_COMPONENTS_NV 0x20B0 964 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 965 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 966 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 967 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 968 | #define WGL_TEXTURE_FLOAT_R_NV 0x20B5 969 | #define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 970 | #define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 971 | #define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 972 | 973 | #define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) 974 | 975 | #endif /* WGL_NV_float_buffer */ 976 | 977 | /* -------------------------- WGL_NV_gpu_affinity -------------------------- */ 978 | 979 | #ifndef WGL_NV_gpu_affinity 980 | #define WGL_NV_gpu_affinity 1 981 | 982 | #define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 983 | #define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 984 | 985 | DECLARE_HANDLE(HGPUNV); 986 | typedef struct _GPU_DEVICE { 987 | DWORD cb; 988 | CHAR DeviceName[32]; 989 | CHAR DeviceString[128]; 990 | DWORD Flags; 991 | RECT rcVirtualScreen; 992 | } GPU_DEVICE, *PGPU_DEVICE; 993 | 994 | typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); 995 | typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); 996 | typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); 997 | typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); 998 | typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); 999 | 1000 | #define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) 1001 | #define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) 1002 | #define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) 1003 | #define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) 1004 | #define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) 1005 | 1006 | #define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) 1007 | 1008 | #endif /* WGL_NV_gpu_affinity */ 1009 | 1010 | /* ---------------------- WGL_NV_multisample_coverage ---------------------- */ 1011 | 1012 | #ifndef WGL_NV_multisample_coverage 1013 | #define WGL_NV_multisample_coverage 1 1014 | 1015 | #define WGL_COVERAGE_SAMPLES_NV 0x2042 1016 | #define WGL_COLOR_SAMPLES_NV 0x20B9 1017 | 1018 | #define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) 1019 | 1020 | #endif /* WGL_NV_multisample_coverage */ 1021 | 1022 | /* -------------------------- WGL_NV_present_video ------------------------- */ 1023 | 1024 | #ifndef WGL_NV_present_video 1025 | #define WGL_NV_present_video 1 1026 | 1027 | #define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 1028 | 1029 | DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); 1030 | 1031 | typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); 1032 | typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); 1033 | typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); 1034 | 1035 | #define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) 1036 | #define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) 1037 | #define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) 1038 | 1039 | #define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) 1040 | 1041 | #endif /* WGL_NV_present_video */ 1042 | 1043 | /* ---------------------- WGL_NV_render_depth_texture ---------------------- */ 1044 | 1045 | #ifndef WGL_NV_render_depth_texture 1046 | #define WGL_NV_render_depth_texture 1 1047 | 1048 | #define WGL_NO_TEXTURE_ARB 0x2077 1049 | #define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 1050 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 1051 | #define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 1052 | #define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 1053 | #define WGL_DEPTH_COMPONENT_NV 0x20A7 1054 | 1055 | #define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) 1056 | 1057 | #endif /* WGL_NV_render_depth_texture */ 1058 | 1059 | /* -------------------- WGL_NV_render_texture_rectangle -------------------- */ 1060 | 1061 | #ifndef WGL_NV_render_texture_rectangle 1062 | #define WGL_NV_render_texture_rectangle 1 1063 | 1064 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 1065 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 1066 | #define WGL_TEXTURE_RECTANGLE_NV 0x20A2 1067 | 1068 | #define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) 1069 | 1070 | #endif /* WGL_NV_render_texture_rectangle */ 1071 | 1072 | /* --------------------------- WGL_NV_swap_group --------------------------- */ 1073 | 1074 | #ifndef WGL_NV_swap_group 1075 | #define WGL_NV_swap_group 1 1076 | 1077 | typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); 1078 | typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); 1079 | typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); 1080 | typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); 1081 | typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); 1082 | typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); 1083 | 1084 | #define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) 1085 | #define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) 1086 | #define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) 1087 | #define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) 1088 | #define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) 1089 | #define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) 1090 | 1091 | #define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) 1092 | 1093 | #endif /* WGL_NV_swap_group */ 1094 | 1095 | /* ----------------------- WGL_NV_vertex_array_range ----------------------- */ 1096 | 1097 | #ifndef WGL_NV_vertex_array_range 1098 | #define WGL_NV_vertex_array_range 1 1099 | 1100 | typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); 1101 | typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); 1102 | 1103 | #define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) 1104 | #define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) 1105 | 1106 | #define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) 1107 | 1108 | #endif /* WGL_NV_vertex_array_range */ 1109 | 1110 | /* -------------------------- WGL_NV_video_capture ------------------------- */ 1111 | 1112 | #ifndef WGL_NV_video_capture 1113 | #define WGL_NV_video_capture 1 1114 | 1115 | #define WGL_UNIQUE_ID_NV 0x20CE 1116 | #define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF 1117 | 1118 | DECLARE_HANDLE(HVIDEOINPUTDEVICENV); 1119 | 1120 | typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); 1121 | typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); 1122 | typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); 1123 | typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); 1124 | typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); 1125 | 1126 | #define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) 1127 | #define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) 1128 | #define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) 1129 | #define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) 1130 | #define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) 1131 | 1132 | #define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) 1133 | 1134 | #endif /* WGL_NV_video_capture */ 1135 | 1136 | /* -------------------------- WGL_NV_video_output -------------------------- */ 1137 | 1138 | #ifndef WGL_NV_video_output 1139 | #define WGL_NV_video_output 1 1140 | 1141 | #define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 1142 | #define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 1143 | #define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 1144 | #define WGL_VIDEO_OUT_COLOR_NV 0x20C3 1145 | #define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 1146 | #define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 1147 | #define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 1148 | #define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 1149 | #define WGL_VIDEO_OUT_FRAME 0x20C8 1150 | #define WGL_VIDEO_OUT_FIELD_1 0x20C9 1151 | #define WGL_VIDEO_OUT_FIELD_2 0x20CA 1152 | #define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB 1153 | #define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC 1154 | 1155 | DECLARE_HANDLE(HPVIDEODEV); 1156 | 1157 | typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); 1158 | typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); 1159 | typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); 1160 | typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); 1161 | typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); 1162 | typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); 1163 | 1164 | #define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) 1165 | #define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) 1166 | #define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) 1167 | #define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) 1168 | #define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) 1169 | #define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) 1170 | 1171 | #define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) 1172 | 1173 | #endif /* WGL_NV_video_output */ 1174 | 1175 | /* -------------------------- WGL_OML_sync_control ------------------------- */ 1176 | 1177 | #ifndef WGL_OML_sync_control 1178 | #define WGL_OML_sync_control 1 1179 | 1180 | typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); 1181 | typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); 1182 | typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); 1183 | typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); 1184 | typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); 1185 | typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); 1186 | 1187 | #define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) 1188 | #define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) 1189 | #define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) 1190 | #define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) 1191 | #define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) 1192 | #define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) 1193 | 1194 | #define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) 1195 | 1196 | #endif /* WGL_OML_sync_control */ 1197 | 1198 | /* ------------------------------------------------------------------------- */ 1199 | 1200 | #ifdef GLEW_MX 1201 | #define WGLEW_FUN_EXPORT 1202 | #define WGLEW_VAR_EXPORT 1203 | #else 1204 | #define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT 1205 | #define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT 1206 | #endif /* GLEW_MX */ 1207 | 1208 | #ifdef GLEW_MX 1209 | struct WGLEWContextStruct 1210 | { 1211 | #endif /* GLEW_MX */ 1212 | 1213 | WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; 1214 | 1215 | WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; 1216 | WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; 1217 | WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; 1218 | WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; 1219 | WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; 1220 | WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; 1221 | WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; 1222 | WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; 1223 | WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; 1224 | 1225 | WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; 1226 | WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; 1227 | WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; 1228 | WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; 1229 | 1230 | WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; 1231 | 1232 | WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; 1233 | 1234 | WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; 1235 | WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; 1236 | 1237 | WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; 1238 | WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; 1239 | WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; 1240 | WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; 1241 | WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; 1242 | 1243 | WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; 1244 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; 1245 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; 1246 | 1247 | WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; 1248 | WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; 1249 | WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; 1250 | 1251 | WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; 1252 | WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; 1253 | WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; 1254 | WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; 1255 | 1256 | WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; 1257 | 1258 | WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; 1259 | WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; 1260 | 1261 | WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; 1262 | WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; 1263 | WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; 1264 | WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; 1265 | WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; 1266 | 1267 | WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; 1268 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; 1269 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; 1270 | 1271 | WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; 1272 | WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; 1273 | 1274 | WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; 1275 | WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; 1276 | 1277 | WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; 1278 | WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; 1279 | WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; 1280 | WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; 1281 | 1282 | WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; 1283 | WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; 1284 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; 1285 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; 1286 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; 1287 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; 1288 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; 1289 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; 1290 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; 1291 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; 1292 | WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; 1293 | WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; 1294 | 1295 | WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; 1296 | WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; 1297 | WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; 1298 | WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; 1299 | 1300 | WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; 1301 | WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; 1302 | WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; 1303 | WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; 1304 | 1305 | WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; 1306 | WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; 1307 | WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; 1308 | WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; 1309 | 1310 | WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; 1311 | WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; 1312 | WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; 1313 | WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; 1314 | WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; 1315 | WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; 1316 | WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; 1317 | WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; 1318 | 1319 | WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; 1320 | 1321 | WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; 1322 | 1323 | WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; 1324 | WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; 1325 | WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; 1326 | WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; 1327 | WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; 1328 | 1329 | WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; 1330 | WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; 1331 | WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; 1332 | 1333 | WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; 1334 | WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; 1335 | WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; 1336 | WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; 1337 | WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; 1338 | WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; 1339 | 1340 | WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; 1341 | WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; 1342 | 1343 | WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; 1344 | WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; 1345 | WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; 1346 | WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; 1347 | WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; 1348 | 1349 | WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; 1350 | WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; 1351 | WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; 1352 | WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; 1353 | WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; 1354 | WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; 1355 | 1356 | WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; 1357 | WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; 1358 | WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; 1359 | WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; 1360 | WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; 1361 | WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; 1362 | WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; 1363 | WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; 1364 | WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; 1365 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; 1366 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; 1367 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; 1368 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; 1369 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; 1370 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; 1371 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; 1372 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; 1373 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; 1374 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; 1375 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; 1376 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; 1377 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; 1378 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; 1379 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; 1380 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; 1381 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; 1382 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; 1383 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; 1384 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; 1385 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; 1386 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; 1387 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; 1388 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; 1389 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; 1390 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; 1391 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; 1392 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; 1393 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; 1394 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; 1395 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; 1396 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; 1397 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; 1398 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; 1399 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; 1400 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; 1401 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; 1402 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; 1403 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; 1404 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; 1405 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; 1406 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; 1407 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; 1408 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; 1409 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; 1410 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; 1411 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; 1412 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; 1413 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; 1414 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; 1415 | WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; 1416 | 1417 | #ifdef GLEW_MX 1418 | }; /* WGLEWContextStruct */ 1419 | #endif /* GLEW_MX */ 1420 | 1421 | /* ------------------------------------------------------------------------- */ 1422 | 1423 | #ifdef GLEW_MX 1424 | 1425 | typedef struct WGLEWContextStruct WGLEWContext; 1426 | GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); 1427 | GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); 1428 | 1429 | #define wglewInit() wglewContextInit(wglewGetContext()) 1430 | #define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) 1431 | 1432 | #define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) 1433 | #define WGLEW_GET_FUN(x) wglewGetContext()->x 1434 | 1435 | #else /* GLEW_MX */ 1436 | 1437 | GLEWAPI GLenum GLEWAPIENTRY wglewInit (); 1438 | GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); 1439 | 1440 | #define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) 1441 | #define WGLEW_GET_FUN(x) x 1442 | 1443 | #endif /* GLEW_MX */ 1444 | 1445 | GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); 1446 | 1447 | #ifdef __cplusplus 1448 | } 1449 | #endif 1450 | 1451 | #undef GLEWAPI 1452 | 1453 | #endif /* __wglew_h__ */ 1454 | -------------------------------------------------------------------------------- /source/MediaSink.cpp: -------------------------------------------------------------------------------- 1 | #include "MediaSink.h" 2 | 3 | 4 | rtsp_unity_plugin::MediaSink::MediaSink(int height, int width, AVPixelFormat format) 5 | { 6 | m_Height = height; 7 | m_Width = width; 8 | m_dstFormat = format; 9 | // Allocate an AVFrame structure 10 | m_pFrameDst = av_frame_alloc(); 11 | 12 | int numBytes; 13 | // Determine required buffer size and allocate buffer 14 | numBytes = av_image_get_buffer_size(m_dstFormat,m_Width,m_Height, 1); 15 | m_pBuffer = (uint8_t *)av_malloc(numBytes * sizeof(uint8_t)); 16 | 17 | // Assign appropriate parts of buffer to image planes in dstFrame 18 | // Note that dstFrame is an AVFrame, but AVFrame is a superset 19 | // of AVPicture 20 | int dstSizeByte = av_image_fill_arrays(m_pFrameDst->data, m_pFrameDst->linesize, m_pBuffer, m_dstFormat, m_Width, m_Height, 1); 21 | 22 | } 23 | //m_pSrcCodecContext = p_src_codec_context; 24 | rtsp_unity_plugin::MediaSink::~MediaSink() 25 | { 26 | m_pSrcCodecContext = NULL; 27 | av_free(m_pBuffer); 28 | av_free(m_pFrameDst); 29 | delete m_pSwsContext; 30 | } 31 | 32 | int rtsp_unity_plugin::MediaSink::setSrcCodecContext(AVCodecContext * p_src_codec_context) 33 | { 34 | 35 | m_pSrcCodecContext = p_src_codec_context; 36 | // initialize SWS context for software scaling 37 | //NOTE: this function is to be removed after a saner alternative is written 38 | //about to get DEPRECATED 39 | m_pSwsContext = sws_getContext(m_pSrcCodecContext->width, 40 | m_pSrcCodecContext->height, 41 | m_pSrcCodecContext->pix_fmt, 42 | m_Width, 43 | m_Height, 44 | m_dstFormat, 45 | SWS_BILINEAR, 46 | NULL, 47 | NULL, 48 | NULL 49 | ); 50 | m_hasInit = true; 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /source/MediaSink.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ffmpegenv.h" 3 | #include "Unity/IUnityGraphics.h" 4 | #include "RenderApi.h" 5 | 6 | 7 | namespace rtsp_unity_plugin { 8 | 9 | 10 | class MediaSink 11 | { 12 | protected: 13 | int m_Height; 14 | int m_Width; 15 | 16 | AVFrame *m_pFrameDst = NULL; 17 | AVPixelFormat m_dstFormat; 18 | AVCodecContext *m_pSrcCodecContext = NULL; 19 | struct SwsContext *m_pSwsContext = NULL; 20 | uint8_t *m_pBuffer = NULL; 21 | 22 | public: 23 | /* 24 | @param height: height of the target frame 25 | @param width: width of the target frame 26 | */ 27 | MediaSink(int height, int width, AVPixelFormat format= AV_PIX_FMT_YUV420P); 28 | ~MediaSink(); 29 | 30 | int setSrcCodecContext(AVCodecContext * p_src_codec_context); 31 | 32 | virtual int WriteAudio(AVFrame* audio_frame) = 0; 33 | virtual int WriteVideo(RenderAPI* render_api,AVFrame* Video_frame) = 0; 34 | 35 | inline bool hasInit() { return m_hasInit; } 36 | private: 37 | bool m_hasInit = false; 38 | 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /source/PlatformBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Standard base includes, defines that indicate our current platform, etc. 4 | 5 | #include 6 | 7 | 8 | // Which platform we are on? 9 | // UNITY_WIN - Windows (regular win32) 10 | // UNITY_OSX - Mac OS X 11 | // UNITY_LINUX - Linux 12 | // UNITY_IPHONE - iOS 13 | // UNITY_ANDROID - Android 14 | // UNITY_METRO - WSA or UWP 15 | #if _MSC_VER 16 | #define UNITY_WIN 1 17 | #elif defined(__APPLE__) 18 | #if defined(__arm__) || defined(__arm64__) 19 | #define UNITY_IPHONE 1 20 | #else 21 | #define UNITY_OSX 1 22 | #endif 23 | #elif defined(UNITY_METRO) || defined(UNITY_ANDROID) || defined(UNITY_LINUX) 24 | // these are defined externally 25 | #else 26 | #error "Unknown platform!" 27 | #endif 28 | 29 | 30 | 31 | // Which graphics device APIs we possibly support? 32 | #if UNITY_METRO 33 | #define SUPPORT_D3D11 1 34 | #if WINDOWS_UWP 35 | #define SUPPORT_D3D12 1 36 | #endif 37 | #elif UNITY_WIN 38 | #define SUPPORT_D3D9 1 39 | #define SUPPORT_D3D11 1 // comment this out if you don't have D3D11 header/library files 40 | #define SUPPORT_D3D12 0 //@TODO: enable by default? comment this out if you don't have D3D12 header/library files 41 | #define SUPPORT_OPENGL_LEGACY 1 42 | #define SUPPORT_OPENGL_UNIFIED 1 43 | #define SUPPORT_OPENGL_CORE 1 44 | #elif UNITY_IPHONE || UNITY_ANDROID 45 | #define SUPPORT_OPENGL_UNIFIED 1 46 | #define SUPPORT_OPENGL_ES 1 47 | #elif UNITY_OSX || UNITY_LINUX 48 | #define SUPPORT_OPENGL_LEGACY 1 49 | #define SUPPORT_OPENGL_UNIFIED 1 50 | #define SUPPORT_OPENGL_CORE 1 51 | #endif 52 | 53 | #if UNITY_IPHONE || UNITY_OSX 54 | #define SUPPORT_METAL 1 55 | #endif 56 | 57 | 58 | 59 | // COM-like Release macro 60 | #ifndef SAFE_RELEASE 61 | #define SAFE_RELEASE(a) if (a) { a->Release(); a = NULL; } 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /source/RTSPUnityPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include "PlatformBase.h" 2 | #include "Unity/IUnityGraphics.h" 3 | #include 4 | 5 | #include "RTSPUnityPluginSingleton.h" 6 | #include "UnityTextureSink.h" 7 | 8 | // Frome Example : -------------------------------------------------------------------------- 9 | // SetTimeFromUnity, an example function we export which is called by one of the scripts. 10 | 11 | rtsp_unity_plugin::RTSPPluginSingleton& pluginSinglet = rtsp_unity_plugin::RTSPPluginSingleton::Instance(); 12 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API SetTimeFromUnity(float t) { pluginSinglet.setTime(t); } 13 | 14 | // -------------------------------------------------------------------------- 15 | // UnitySetInterfaces 16 | 17 | static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType eventType); 18 | 19 | static UnityGfxRenderer s_DeviceType = kUnityGfxRendererNull; 20 | static IUnityInterfaces* s_UnityInterfaces = NULL; 21 | static IUnityGraphics* s_Graphics = NULL; 22 | 23 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnityInterfaces* unityInterfaces) 24 | { 25 | s_UnityInterfaces = unityInterfaces; 26 | s_Graphics = s_UnityInterfaces->Get(); 27 | s_Graphics->RegisterDeviceEventCallback(OnGraphicsDeviceEvent); 28 | 29 | // Run OnGraphicsDeviceEvent(initialize) manually on plugin load 30 | OnGraphicsDeviceEvent(kUnityGfxDeviceEventInitialize); 31 | } 32 | 33 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload() 34 | { 35 | s_Graphics->UnregisterDeviceEventCallback(OnGraphicsDeviceEvent); 36 | } 37 | 38 | 39 | // -------------------------------------------------------------------------- 40 | // GraphicsDeviceEvent 41 | 42 | static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType eventType) 43 | { 44 | // Create graphics API implementation upon initialization 45 | if (eventType == kUnityGfxDeviceEventInitialize) 46 | { 47 | assert(pluginSinglet.getRenderApi() == NULL); 48 | s_DeviceType = s_Graphics->GetRenderer(); 49 | RenderAPI* renderApi = CreateRenderAPI(s_DeviceType); 50 | pluginSinglet.SetRenderApi(renderApi); 51 | } 52 | 53 | // Let the implementation process the device related events 54 | if (pluginSinglet.getRenderApi()) 55 | { 56 | pluginSinglet.getRenderApi()->ProcessDeviceEvent(eventType, s_UnityInterfaces); 57 | } 58 | 59 | // Cleanup graphics API implementation upon shutdown 60 | if (eventType == kUnityGfxDeviceEventShutdown) 61 | { 62 | //delete s_CurrentAPI; 63 | //s_CurrentAPI = NULL; 64 | s_DeviceType = kUnityGfxRendererNull; 65 | } 66 | } 67 | 68 | // -------------------------------------------------------------------------- 69 | // OnRenderEvent 70 | // This will be called for GL.IssuePluginEvent script calls; eventID will 71 | // be the integer passed to IssuePluginEvent. In this example, we just ignore 72 | // that value. 73 | 74 | 75 | 76 | static void UNITY_INTERFACE_API OnRenderEvent(int eventID) 77 | { 78 | // Unknown / unsupported graphics device type? Do nothing 79 | if (pluginSinglet.getRenderApi() == NULL) 80 | return; 81 | 82 | pluginSinglet.ReadFrame(); 83 | } 84 | // -------------------------------------------------------------------------- 85 | // GetRenderEventFunc, an example function we export which is used to get a rendering event callback function. 86 | 87 | extern "C" UnityRenderingEvent UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API GetRenderEventFunc() 88 | { 89 | return OnRenderEvent; 90 | } 91 | 92 | /* 93 | // get the textureHandle, the size and width of the unity texture 94 | // Return a pointer to the new mediaSink Object Created 95 | extern "C" void* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API SetTextureAsMediaSink(void* texture_handle, int h, int w) 96 | { 97 | return (void*) new rtsp_unity_plugin::UnityTextureSink(texture_handle, "textureName", h, w); 98 | } 99 | 100 | // get the rtsp uri 101 | // open a ffmpegRtspStream with that uri 102 | // Return a pointer to the new stream created 103 | extern "C" void* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API OpenRTSPStream(void* rtsp_uri) 104 | { 105 | return (void*) new rtsp_unity_plugin::FFMpegRTSPStream((char*)rtsp_uri); 106 | } 107 | 108 | 109 | // get the rtsp uri 110 | // open a ffmpegRtspStream with that uri 111 | // Return a pointer to the new stream created 112 | 113 | extern "C" void* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API AddMediaSinkToStream(void* rtsp_stream, void* ) 114 | { 115 | return (void*) new rtsp_unity_plugin::FFMpegRTSPStream((char*)rtsp_uri); 116 | } 117 | */ 118 | 119 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API SetTextureAsRTSPSink(const char* rtsp_uri,void* texture_handle, int h, int w) 120 | { 121 | char* uri = pluginSinglet.MakeStringCopy(rtsp_uri); 122 | pluginSinglet.SetRtspStream(uri);//"rtsp://localhost:8554/stream" 123 | rtsp_unity_plugin::UnityTextureSink* sink = new rtsp_unity_plugin::UnityTextureSink(texture_handle, "texture", h, w); 124 | //ffmpegClassPtr.SetDummySink(sink); 125 | pluginSinglet.getStream()->setMediaSink(sink); 126 | } 127 | -------------------------------------------------------------------------------- /source/RTSPUnityPluginSingleton.cpp: -------------------------------------------------------------------------------- 1 | #include "RTSPUnityPluginSingleton.h" 2 | #include "FFMpegRTSPStream.h" 3 | 4 | rtsp_unity_plugin::RTSPPluginSingleton rtsp_unity_plugin::RTSPPluginSingleton::m_instance = rtsp_unity_plugin::RTSPPluginSingleton(); 5 | 6 | 7 | void rtsp_unity_plugin::RTSPPluginSingleton::InitAv() 8 | { 9 | if (!m_hasInitAv) 10 | av_register_all(); 11 | m_hasInitAv = true; 12 | } 13 | 14 | void rtsp_unity_plugin::RTSPPluginSingleton::InitAvCodec() 15 | { 16 | if (!m_hasInitAvCodec) 17 | avcodec_register_all(); 18 | m_hasInitAvCodec = true; 19 | } 20 | void rtsp_unity_plugin::RTSPPluginSingleton::InitAvNetwork() 21 | { 22 | if (!m_hasInitAvNetwork) 23 | avformat_network_init(); 24 | m_hasInitAvNetwork = true; 25 | } 26 | 27 | 28 | 29 | void rtsp_unity_plugin::RTSPPluginSingleton::SetRtspStream(const char * uri) 30 | { 31 | if (m_pStream != NULL) 32 | delete m_pStream; 33 | m_pStream = new FFMpegRTSPStream(uri); 34 | } 35 | // todo delete that : 36 | 37 | 38 | void rtsp_unity_plugin::RTSPPluginSingleton::ReadFrame() 39 | { 40 | if (m_pStream != NULL) 41 | m_pStream->ReadFrame(); 42 | } 43 | /*/ 44 | void rtsp_unity_plugin::FFMpegClass::AddNewRtspStream(const char * uri) 45 | { 46 | m_vStream.insert(FFMpegRTSPStream(uri)); 47 | }*/ 48 | 49 | 50 | rtsp_unity_plugin::RTSPPluginSingleton::RTSPPluginSingleton() 51 | { 52 | m_hasInitAv = false; 53 | m_hasInitAvCodec = false; 54 | m_hasInitAvNetwork = false; 55 | m_pStream = NULL; 56 | } 57 | 58 | rtsp_unity_plugin::RTSPPluginSingleton::~RTSPPluginSingleton() 59 | { 60 | if (m_pRenderApi!= NULL) { 61 | delete m_pRenderApi; 62 | } 63 | } 64 | 65 | rtsp_unity_plugin::RTSPPluginSingleton& rtsp_unity_plugin::RTSPPluginSingleton::Instance() 66 | { 67 | return m_instance; 68 | } 69 | -------------------------------------------------------------------------------- /source/RTSPUnityPluginSingleton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Unity/IUnityGraphics.h" 4 | #include "RenderAPI.h" 5 | 6 | #include "ffmpegenv.h" 7 | 8 | #include "FFMpegStream.h" 9 | 10 | 11 | namespace rtsp_unity_plugin { 12 | class FFMpegStream; 13 | class MediaSink; 14 | 15 | 16 | 17 | 18 | 19 | class RTSPPluginSingleton 20 | { 21 | 22 | private: 23 | RTSPPluginSingleton(); 24 | ~RTSPPluginSingleton(); 25 | 26 | public: 27 | static RTSPPluginSingleton& Instance(); 28 | 29 | void InitAv(); 30 | void InitAvNetwork(); 31 | void InitAvCodec(); 32 | 33 | //TODO not used 34 | //void AddNewRtspStream(const char* uri); 35 | 36 | void SetRtspStream(const char* uri); 37 | 38 | void SetRenderApi(RenderAPI* render_api) { m_pRenderApi = render_api; }; 39 | 40 | //void ReadFrames(); 41 | void ReadFrame(); 42 | 43 | inline bool hasInitAv() { return m_hasInitAv; } 44 | inline bool hasInitAvCodec() { return m_hasInitAvCodec; } 45 | inline bool hasInitAvNetwork() { return m_hasInitAvNetwork; } 46 | 47 | FFMpegStream* getStream() { return m_pStream; } 48 | RenderAPI* getRenderApi() { return m_pRenderApi; } 49 | 50 | inline void setTime(float time) { m_time = time; } 51 | inline float getTime() { return m_time; } 52 | 53 | char* MakeStringCopy(const char* string) { 54 | if (string == NULL) return NULL; 55 | int length = strlen(string) + 1; 56 | char* res = new char[length]; 57 | strcpy_s(res, length , string); 58 | return res; 59 | } 60 | 61 | private: 62 | 63 | static RTSPPluginSingleton m_instance; 64 | //TODO use many stream? 65 | //std::set m_vStream; 66 | 67 | FFMpegStream* m_pStream = NULL; 68 | RenderAPI* m_pRenderApi = NULL; 69 | 70 | bool m_hasInitAvCodec; 71 | bool m_hasInitAv; 72 | bool m_hasInitAvNetwork; 73 | 74 | float m_time = 0; 75 | }; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /source/RenderAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "PlatformBase.h" 3 | #include "Unity/IUnityGraphics.h" 4 | 5 | 6 | RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType) 7 | { 8 | # if SUPPORT_D3D11 9 | if (apiType == kUnityGfxRendererD3D11) 10 | { 11 | extern RenderAPI* CreateRenderAPI_D3D11(); 12 | return CreateRenderAPI_D3D11(); 13 | } 14 | # endif // if SUPPORT_D3D11 15 | 16 | # if SUPPORT_D3D9 17 | if (apiType == kUnityGfxRendererD3D9) 18 | { 19 | extern RenderAPI* CreateRenderAPI_D3D9(); 20 | return CreateRenderAPI_D3D9(); 21 | } 22 | # endif // if SUPPORT_D3D9 23 | 24 | # if SUPPORT_D3D12 25 | if (apiType == kUnityGfxRendererD3D12) 26 | { 27 | extern RenderAPI* CreateRenderAPI_D3D12(); 28 | return CreateRenderAPI_D3D12(); 29 | } 30 | # endif // if SUPPORT_D3D9 31 | 32 | 33 | # if SUPPORT_OPENGL_UNIFIED 34 | if (apiType == kUnityGfxRendererOpenGLCore || apiType == kUnityGfxRendererOpenGLES20 || apiType == kUnityGfxRendererOpenGLES30) 35 | { 36 | extern RenderAPI* CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer apiType); 37 | return CreateRenderAPI_OpenGLCoreES(apiType); 38 | } 39 | # endif // if SUPPORT_OPENGL_UNIFIED 40 | 41 | # if SUPPORT_OPENGL_LEGACY 42 | if (apiType == kUnityGfxRendererOpenGL) 43 | { 44 | extern RenderAPI* CreateRenderAPI_OpenGL2(); 45 | return CreateRenderAPI_OpenGL2(); 46 | } 47 | # endif // if SUPPORT_OPENGL_LEGACY 48 | 49 | # if SUPPORT_METAL 50 | if (apiType == kUnityGfxRendererMetal) 51 | { 52 | extern RenderAPI* CreateRenderAPI_Metal(); 53 | return CreateRenderAPI_Metal(); 54 | } 55 | # endif // if SUPPORT_METAL 56 | 57 | 58 | // Unknown or unsupported graphics API 59 | return NULL; 60 | } 61 | -------------------------------------------------------------------------------- /source/RenderAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Unity/IUnityGraphics.h" 4 | 5 | struct IUnityInterfaces; 6 | 7 | 8 | // Super-simple "graphics abstraction". This is nothing like how a proper platform abstraction layer would look like; 9 | // all this does is a base interface for whatever our plugin sample needs. Which is only "draw some triangles" 10 | // and "modify a texture" at this point. 11 | // 12 | // There are implementations of this base class for D3D9, D3D11, OpenGL etc.; see individual RenderAPI_* files. 13 | class RenderAPI 14 | { 15 | public: 16 | virtual ~RenderAPI() { } 17 | 18 | // Process general event like initialization, shutdown, device loss/reset etc. 19 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) = 0; 20 | 21 | // Begin modifying texture data. You need to pass texture width/height too, since some graphics APIs 22 | // (e.g. OpenGL ES) do not have a good way to query that from the texture itself... 23 | // Returns pointer into the data buffer to write into (or NULL on failure), and pitch in bytes of a single texture row. 24 | virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) = 0; 25 | 26 | // End modifying texture data. 27 | virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) = 0; 28 | }; 29 | 30 | 31 | // Create a graphics API implementation instance for the given API type. 32 | RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType); 33 | 34 | -------------------------------------------------------------------------------- /source/RenderAPI_D3D11.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "PlatformBase.h" 3 | 4 | // Direct3D 11 implementation of RenderAPI. 5 | 6 | #if SUPPORT_D3D11 7 | 8 | #include 9 | #include 10 | #include "Unity/IUnityGraphicsD3D11.h" 11 | 12 | 13 | class RenderAPI_D3D11 : public RenderAPI 14 | { 15 | public: 16 | RenderAPI_D3D11(); 17 | virtual ~RenderAPI_D3D11() { } 18 | 19 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces); 20 | 21 | virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch); 22 | virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr); 23 | 24 | private: 25 | ID3D11Device* m_Device; 26 | }; 27 | 28 | 29 | RenderAPI* CreateRenderAPI_D3D11() 30 | { 31 | return new RenderAPI_D3D11(); 32 | } 33 | 34 | 35 | // Simple compiled shader bytecode. 36 | // 37 | // Shader source that was used: 38 | #if 0 39 | cbuffer MyCB : register(b0) 40 | { 41 | float4x4 worldMatrix; 42 | } 43 | void VS(float3 pos : POSITION, float4 color : COLOR, out float4 ocolor : COLOR, out float4 opos : SV_Position) 44 | { 45 | opos = mul(worldMatrix, float4(pos, 1)); 46 | ocolor = color; 47 | } 48 | float4 PS(float4 color : COLOR) : SV_TARGET 49 | { 50 | return color; 51 | } 52 | #endif // #if 0 53 | 54 | RenderAPI_D3D11::RenderAPI_D3D11() 55 | : m_Device(NULL) 56 | { 57 | } 58 | 59 | 60 | void RenderAPI_D3D11::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) 61 | { 62 | switch (type) 63 | { 64 | case kUnityGfxDeviceEventInitialize: 65 | { 66 | IUnityGraphicsD3D11* d3d = interfaces->Get(); 67 | m_Device = d3d->GetDevice(); 68 | break; 69 | } 70 | case kUnityGfxDeviceEventShutdown: 71 | break; 72 | } 73 | } 74 | 75 | 76 | 77 | 78 | void* RenderAPI_D3D11::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) 79 | { 80 | const int rowPitch = textureWidth * 4; 81 | // Just allocate a system memory buffer here for simplicity 82 | unsigned char* data = new unsigned char[rowPitch * textureHeight]; 83 | *outRowPitch = rowPitch; 84 | return data; 85 | } 86 | 87 | 88 | void RenderAPI_D3D11::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) 89 | { 90 | ID3D11Texture2D* d3dtex = (ID3D11Texture2D*)textureHandle; 91 | assert(d3dtex); 92 | 93 | ID3D11DeviceContext* ctx = NULL; 94 | m_Device->GetImmediateContext(&ctx); 95 | // Update texture data, and free the memory buffer 96 | ctx->UpdateSubresource(d3dtex, 0, NULL, dataPtr, rowPitch, 0); 97 | delete[](unsigned char*)dataPtr; 98 | ctx->Release(); 99 | } 100 | 101 | 102 | #endif // #if SUPPORT_D3D11 103 | -------------------------------------------------------------------------------- /source/RenderAPI_D3D12.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "PlatformBase.h" 3 | 4 | // Direct3D 12 implementation of RenderAPI. 5 | 6 | //TODO : FIXME 7 | #if SUPPORT_D3D12 8 | 9 | #include 10 | #include 11 | #include "Unity/IUnityGraphicsD3D12.h" 12 | 13 | 14 | class RenderAPI_D3D12 : public RenderAPI 15 | { 16 | public: 17 | RenderAPI_D3D12(); 18 | virtual ~RenderAPI_D3D12() { } 19 | 20 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces); 21 | 22 | virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch); 23 | virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr); 24 | 25 | private: 26 | IUnityGraphicsD3D12v2* s_D3D12; 27 | ID3D12Resource* s_D3D12Upload; 28 | ID3D12CommandAllocator* s_D3D12CmdAlloc; 29 | ID3D12GraphicsCommandList* s_D3D12CmdList; 30 | UINT64 s_D3D12FenceValue = 0; 31 | HANDLE s_D3D12Event = NULL; 32 | }; 33 | 34 | 35 | RenderAPI* CreateRenderAPI_D3D12() 36 | { 37 | return new RenderAPI_D3D12(); 38 | } 39 | 40 | 41 | const UINT kNodeMask = 0; 42 | 43 | 44 | RenderAPI_D3D12::RenderAPI_D3D12() 45 | : s_D3D12(NULL) 46 | , s_D3D12Upload(NULL) 47 | , s_D3D12CmdAlloc(NULL) 48 | , s_D3D12CmdList(NULL) 49 | , s_D3D12FenceValue(0) 50 | , s_D3D12Event(NULL) 51 | { 52 | } 53 | 54 | 55 | void RenderAPI_D3D12::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) 56 | { 57 | switch (type) 58 | { 59 | case kUnityGfxDeviceEventInitialize: 60 | s_D3D12 = interfaces->Get(); 61 | break; 62 | case kUnityGfxDeviceEventShutdown: 63 | break; 64 | } 65 | } 66 | 67 | 68 | 69 | void* RenderAPI_D3D12::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) 70 | { 71 | ID3D12Fence* fence = s_D3D12->GetFrameFence(); 72 | 73 | // Wait on the previous job (example only - simplifies resource management) 74 | if (fence->GetCompletedValue() < s_D3D12FenceValue) 75 | { 76 | fence->SetEventOnCompletion(s_D3D12FenceValue, s_D3D12Event); 77 | WaitForSingleObject(s_D3D12Event, INFINITE); 78 | } 79 | 80 | // Begin a command list 81 | s_D3D12CmdAlloc->Reset(); 82 | s_D3D12CmdList->Reset(s_D3D12CmdAlloc, nullptr); 83 | 84 | // Fill data 85 | const UINT64 kDataSize = textureWidth * textureHeight * 4; 86 | ID3D12Resource* upload = GetUploadResource(kDataSize); 87 | void* mapped = NULL; 88 | upload->Map(0, NULL, &mapped); 89 | *outRowPitch = textureWidth * 4; 90 | return mapped; 91 | } 92 | 93 | 94 | void RenderAPI_D3D12::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) 95 | { 96 | ID3D12Device* device = s_D3D12->GetDevice(); 97 | 98 | const UINT64 kDataSize = textureWidth * textureHeight * 4; 99 | ID3D12Resource* upload = GetUploadResource(kDataSize); 100 | upload->Unmap(0, NULL); 101 | 102 | ID3D12Resource* resource = (ID3D12Resource*)textureHandle; 103 | D3D12_RESOURCE_DESC desc = resource->GetDesc(); 104 | assert(desc.Width == textureWidth); 105 | assert(desc.Height == textureHeight); 106 | 107 | D3D12_TEXTURE_COPY_LOCATION srcLoc = {}; 108 | srcLoc.pResource = upload; 109 | srcLoc.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; 110 | device->GetCopyableFootprints(&desc, 0, 1, 0, &srcLoc.PlacedFootprint, nullptr, nullptr, nullptr); 111 | 112 | D3D12_TEXTURE_COPY_LOCATION dstLoc = {}; 113 | dstLoc.pResource = resource; 114 | dstLoc.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; 115 | dstLoc.SubresourceIndex = 0; 116 | 117 | // We inform Unity that we expect this resource to be in D3D12_RESOURCE_STATE_COPY_DEST state, 118 | // and because we do not barrier it ourselves, we tell Unity that no changes are done on our command list. 119 | UnityGraphicsD3D12ResourceState resourceState = {}; 120 | resourceState.resource = resource; 121 | resourceState.expected = D3D12_RESOURCE_STATE_COPY_DEST; 122 | resourceState.current = D3D12_RESOURCE_STATE_COPY_DEST; 123 | 124 | // Queue data upload 125 | s_D3D12CmdList->CopyTextureRegion(&dstLoc, 0, 0, 0, &srcLoc, nullptr); 126 | 127 | // Execute the command list 128 | s_D3D12CmdList->Close(); 129 | s_D3D12FenceValue = s_D3D12->ExecuteCommandList(s_D3D12CmdList, 1, &resourceState); 130 | } 131 | 132 | 133 | #endif // #if SUPPORT_D3D12 134 | -------------------------------------------------------------------------------- /source/RenderAPI_D3D9.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "PlatformBase.h" 3 | 4 | // Direct3D 9 implementation of RenderAPI. 5 | 6 | #if SUPPORT_D3D9 7 | 8 | #include 9 | #include 10 | #include "Unity/IUnityGraphicsD3D9.h" 11 | 12 | 13 | class RenderAPI_D3D9 : public RenderAPI 14 | { 15 | public: 16 | RenderAPI_D3D9(); 17 | virtual ~RenderAPI_D3D9() { } 18 | 19 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces); 20 | 21 | virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch); 22 | virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr); 23 | 24 | private: 25 | IDirect3DDevice9* m_Device; 26 | // A dynamic vertex buffer just to demonstrate how to handle D3D9 device resets. 27 | IDirect3DVertexBuffer9* m_DynamicVB; 28 | }; 29 | 30 | 31 | RenderAPI* CreateRenderAPI_D3D9() 32 | { 33 | return new RenderAPI_D3D9(); 34 | } 35 | 36 | 37 | RenderAPI_D3D9::RenderAPI_D3D9() 38 | : m_Device(NULL) 39 | , m_DynamicVB(NULL) 40 | { 41 | } 42 | 43 | 44 | void RenderAPI_D3D9::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) 45 | { 46 | switch (type) 47 | { 48 | case kUnityGfxDeviceEventInitialize: 49 | { 50 | IUnityGraphicsD3D9* d3d = interfaces->Get(); 51 | m_Device = d3d->GetDevice(); 52 | } 53 | // fall-through! 54 | case kUnityGfxDeviceEventAfterReset: 55 | // After device is initialized or was just reset, create the VB. 56 | if (m_DynamicVB == NULL) 57 | m_Device->CreateVertexBuffer(1024, D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, 0, D3DPOOL_DEFAULT, &m_DynamicVB, NULL); 58 | break; 59 | case kUnityGfxDeviceEventBeforeReset: 60 | case kUnityGfxDeviceEventShutdown: 61 | // Before device is reset or being shut down, release the VB. 62 | SAFE_RELEASE(m_DynamicVB); 63 | break; 64 | } 65 | } 66 | 67 | 68 | 69 | void* RenderAPI_D3D9::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) 70 | { 71 | IDirect3DTexture9* d3dtex = (IDirect3DTexture9*)textureHandle; 72 | assert(d3dtex); 73 | 74 | // Lock the texture and return pointer 75 | D3DLOCKED_RECT lr; 76 | HRESULT hr = d3dtex->LockRect(0, &lr, NULL, 0); 77 | if (FAILED(hr)) 78 | return NULL; 79 | 80 | *outRowPitch = lr.Pitch; 81 | return lr.pBits; 82 | } 83 | 84 | 85 | void RenderAPI_D3D9::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) 86 | { 87 | IDirect3DTexture9* d3dtex = (IDirect3DTexture9*)textureHandle; 88 | assert(d3dtex); 89 | 90 | // Unlock the texture after modification 91 | d3dtex->UnlockRect(0); 92 | } 93 | 94 | 95 | #endif // #if SUPPORT_D3D9 96 | -------------------------------------------------------------------------------- /source/RenderAPI_OpenGL2.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "PlatformBase.h" 3 | 4 | // OpenGL 2 (legacy, deprecated) implementation of RenderAPI. 5 | 6 | 7 | #if SUPPORT_OPENGL_LEGACY 8 | 9 | #include "GLEW/glew.h" 10 | 11 | 12 | class RenderAPI_OpenGL2 : public RenderAPI 13 | { 14 | public: 15 | RenderAPI_OpenGL2(); 16 | virtual ~RenderAPI_OpenGL2() { } 17 | 18 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces); 19 | 20 | virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch); 21 | virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr); 22 | }; 23 | 24 | 25 | RenderAPI* CreateRenderAPI_OpenGL2() 26 | { 27 | return new RenderAPI_OpenGL2(); 28 | } 29 | 30 | 31 | RenderAPI_OpenGL2::RenderAPI_OpenGL2() 32 | { 33 | } 34 | 35 | 36 | void RenderAPI_OpenGL2::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) 37 | { 38 | // not much to do :) 39 | } 40 | 41 | void* RenderAPI_OpenGL2::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) 42 | { 43 | const int rowPitch = textureWidth * 4; 44 | // Just allocate a system memory buffer here for simplicity 45 | unsigned char* data = new unsigned char[rowPitch * textureHeight]; 46 | *outRowPitch = rowPitch; 47 | return data; 48 | } 49 | 50 | 51 | void RenderAPI_OpenGL2::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) 52 | { 53 | GLuint gltex = (GLuint)(size_t)(textureHandle); 54 | // Update texture data, and free the memory buffer 55 | glBindTexture(GL_TEXTURE_2D, gltex); 56 | glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, GL_RGBA, GL_UNSIGNED_BYTE, dataPtr); 57 | delete[](unsigned char*)dataPtr; 58 | } 59 | 60 | 61 | #endif // #if SUPPORT_OPENGL_LEGACY 62 | -------------------------------------------------------------------------------- /source/RenderAPI_OpenGLCoreES.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | #include "PlatformBase.h" 3 | 4 | // OpenGL Core profile (desktop) or OpenGL ES (mobile) implementation of RenderAPI. 5 | // Supports several flavors: Core, ES2, ES3 6 | 7 | 8 | #if SUPPORT_OPENGL_UNIFIED 9 | 10 | 11 | #include 12 | #if UNITY_IPHONE 13 | # include 14 | #elif UNITY_ANDROID 15 | # include 16 | #else 17 | # include "GLEW/glew.h" 18 | #endif 19 | 20 | 21 | class RenderAPI_OpenGLCoreES : public RenderAPI 22 | { 23 | public: 24 | RenderAPI_OpenGLCoreES(UnityGfxRenderer apiType); 25 | virtual ~RenderAPI_OpenGLCoreES() { } 26 | 27 | virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces); 28 | 29 | virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch); 30 | virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr); 31 | 32 | 33 | private: 34 | UnityGfxRenderer m_APIType; 35 | }; 36 | 37 | 38 | RenderAPI* CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer apiType) 39 | { 40 | return new RenderAPI_OpenGLCoreES(apiType); 41 | } 42 | 43 | 44 | RenderAPI_OpenGLCoreES::RenderAPI_OpenGLCoreES(UnityGfxRenderer apiType) 45 | : m_APIType(apiType) 46 | { 47 | } 48 | 49 | 50 | void RenderAPI_OpenGLCoreES::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) 51 | { 52 | // nothing to do here. 53 | } 54 | 55 | 56 | 57 | void* RenderAPI_OpenGLCoreES::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) 58 | { 59 | const int rowPitch = textureWidth * 4; 60 | // Just allocate a system memory buffer here for simplicity 61 | unsigned char* data = new unsigned char[rowPitch * textureHeight]; 62 | *outRowPitch = rowPitch; 63 | return data; 64 | } 65 | 66 | 67 | void RenderAPI_OpenGLCoreES::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) 68 | { 69 | GLuint gltex = (GLuint)(size_t)(textureHandle); 70 | // Update texture data, and free the memory buffer 71 | glBindTexture(GL_TEXTURE_2D, gltex); 72 | glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, GL_RGBA, GL_UNSIGNED_BYTE, dataPtr); 73 | delete[](unsigned char*)dataPtr; 74 | } 75 | 76 | 77 | #endif // #if SUPPORT_OPENGL_UNIFIED 78 | -------------------------------------------------------------------------------- /source/Unity/IUnityGraphics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | typedef enum UnityGfxRenderer 5 | { 6 | kUnityGfxRendererOpenGL = 0, // Legacy OpenGL 7 | kUnityGfxRendererD3D9 = 1, // Direct3D 9 8 | kUnityGfxRendererD3D11 = 2, // Direct3D 11 9 | kUnityGfxRendererGCM = 3, // PlayStation 3 10 | kUnityGfxRendererNull = 4, // "null" device (used in batch mode) 11 | kUnityGfxRendererXenon = 6, // Xbox 360 12 | kUnityGfxRendererOpenGLES20 = 8, // OpenGL ES 2.0 13 | kUnityGfxRendererOpenGLES30 = 11, // OpenGL ES 3.x 14 | kUnityGfxRendererGXM = 12, // PlayStation Vita 15 | kUnityGfxRendererPS4 = 13, // PlayStation 4 16 | kUnityGfxRendererXboxOne = 14, // Xbox One 17 | kUnityGfxRendererMetal = 16, // iOS Metal 18 | kUnityGfxRendererOpenGLCore = 17, // OpenGL core 19 | kUnityGfxRendererD3D12 = 18, // Direct3D 12 20 | } UnityGfxRenderer; 21 | 22 | typedef enum UnityGfxDeviceEventType 23 | { 24 | kUnityGfxDeviceEventInitialize = 0, 25 | kUnityGfxDeviceEventShutdown = 1, 26 | kUnityGfxDeviceEventBeforeReset = 2, 27 | kUnityGfxDeviceEventAfterReset = 3, 28 | } UnityGfxDeviceEventType; 29 | 30 | typedef void (UNITY_INTERFACE_API * IUnityGraphicsDeviceEventCallback)(UnityGfxDeviceEventType eventType); 31 | 32 | // Should only be used on the rendering thread unless noted otherwise. 33 | UNITY_DECLARE_INTERFACE(IUnityGraphics) 34 | { 35 | UnityGfxRenderer (UNITY_INTERFACE_API * GetRenderer)(); // Thread safe 36 | 37 | // This callback will be called when graphics device is created, destroyed, reset, etc. 38 | // It is possible to miss the kUnityGfxDeviceEventInitialize event in case plugin is loaded at a later time, 39 | // when the graphics device is already created. 40 | void (UNITY_INTERFACE_API * RegisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); 41 | void (UNITY_INTERFACE_API * UnregisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); 42 | }; 43 | UNITY_REGISTER_INTERFACE_GUID(0x7CBA0A9CA4DDB544ULL,0x8C5AD4926EB17B11ULL,IUnityGraphics) 44 | 45 | 46 | 47 | // Certain Unity APIs (GL.IssuePluginEvent, CommandBuffer.IssuePluginEvent) can callback into native plugins. 48 | // Provide them with an address to a function of this signature. 49 | typedef void (UNITY_INTERFACE_API * UnityRenderingEvent)(int eventId); 50 | -------------------------------------------------------------------------------- /source/Unity/IUnityGraphicsD3D11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | // Should only be used on the rendering thread unless noted otherwise. 5 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D11) 6 | { 7 | ID3D11Device* (UNITY_INTERFACE_API * GetDevice)(); 8 | }; 9 | UNITY_REGISTER_INTERFACE_GUID(0xAAB37EF87A87D748ULL,0xBF76967F07EFB177ULL,IUnityGraphicsD3D11) 10 | -------------------------------------------------------------------------------- /source/Unity/IUnityGraphicsD3D12.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | #ifndef __cplusplus 4 | #include 5 | #endif 6 | 7 | typedef struct UnityGraphicsD3D12ResourceState UnityGraphicsD3D12ResourceState; 8 | struct UnityGraphicsD3D12ResourceState 9 | { 10 | ID3D12Resource* resource; // Resource to barrier. 11 | D3D12_RESOURCE_STATES expected; // Expected resource state before this command list is executed. 12 | D3D12_RESOURCE_STATES current; // State this resource will be in after this command list is executed. 13 | }; 14 | 15 | // Should only be used on the main thread. 16 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v2) 17 | { 18 | ID3D12Device* (UNITY_INTERFACE_API * GetDevice)(); 19 | 20 | ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)(); 21 | // Returns the value set on the frame fence once the current frame completes or the GPU is flushed 22 | UINT64 (UNITY_INTERFACE_API * GetNextFrameFenceValue)(); 23 | 24 | // Executes a given command list on a worker thread. 25 | // [Optional] Declares expected and post-execution resource states. 26 | // Returns the fence value. 27 | UINT64 (UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList* commandList, int stateCount, UnityGraphicsD3D12ResourceState* states); 28 | }; 29 | UNITY_REGISTER_INTERFACE_GUID(0xEC39D2F18446C745ULL,0xB1A2626641D6B11FULL,IUnityGraphicsD3D12v2) 30 | 31 | 32 | 33 | // Obsolete 34 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12) 35 | { 36 | ID3D12Device* (UNITY_INTERFACE_API * GetDevice)(); 37 | ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)(); 38 | 39 | ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)(); 40 | // Returns the value set on the frame fence once the current frame completes or the GPU is flushed 41 | UINT64 (UNITY_INTERFACE_API * GetNextFrameFenceValue)(); 42 | 43 | // Returns the state a resource will be in after the last command list is executed 44 | bool (UNITY_INTERFACE_API * GetResourceState)(ID3D12Resource* resource, D3D12_RESOURCE_STATES* outState); 45 | // Specifies the state a resource will be in after a plugin command list with resource barriers is executed 46 | void (UNITY_INTERFACE_API * SetResourceState)(ID3D12Resource* resource, D3D12_RESOURCE_STATES state); 47 | }; 48 | UNITY_REGISTER_INTERFACE_GUID(0xEF4CEC88A45F4C4CULL,0xBD295B6F2A38D9DEULL,IUnityGraphicsD3D12) 49 | -------------------------------------------------------------------------------- /source/Unity/IUnityGraphicsD3D9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | // Should only be used on the rendering thread unless noted otherwise. 5 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D9) 6 | { 7 | IDirect3D9* (UNITY_INTERFACE_API * GetD3D)(); 8 | IDirect3DDevice9* (UNITY_INTERFACE_API * GetDevice)(); 9 | }; 10 | UNITY_REGISTER_INTERFACE_GUID(0xE90746A523D53C4CULL,0xAC825B19B6F82AC3ULL,IUnityGraphicsD3D9) 11 | -------------------------------------------------------------------------------- /source/Unity/IUnityGraphicsMetal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | #ifndef __OBJC__ 5 | #error metal plugin is objc code. 6 | #endif 7 | #ifndef __clang__ 8 | #error only clang compiler is supported. 9 | #endif 10 | #if !__has_feature(objc_arc) 11 | #error metal demands ARC enabled. 12 | #endif 13 | 14 | @class NSBundle; 15 | @protocol MTLDevice; 16 | @protocol MTLCommandBuffer; 17 | @protocol MTLCommandEncoder; 18 | @protocol MTLTexture; 19 | 20 | struct RenderSurfaceBase; 21 | typedef struct RenderSurfaceBase* UnityRenderBuffer; 22 | 23 | // Should only be used on the rendering thread unless noted otherwise. 24 | UNITY_DECLARE_INTERFACE(IUnityGraphicsMetal) 25 | { 26 | NSBundle* (UNITY_INTERFACE_API * MetalBundle)(); 27 | id (UNITY_INTERFACE_API * MetalDevice)(); 28 | 29 | id (UNITY_INTERFACE_API * CurrentCommandBuffer)(); 30 | 31 | // for custom rendering support there are two scenarios: 32 | // you want to use current in-flight MTLCommandEncoder (NB: it might be nil) 33 | id (UNITY_INTERFACE_API * CurrentCommandEncoder)(); 34 | // or you might want to create your own encoder. 35 | // In that case you should end unity's encoder before creating your own and end yours before returning control to unity 36 | void (UNITY_INTERFACE_API * EndCurrentCommandEncoder)(); 37 | 38 | // access to RenderBuffer's texure 39 | // NB: you pass here *native* RenderBuffer, acquired by calling (C#) RenderBuffer.GetNativeRenderBufferPtr 40 | // AAResolvedTextureFromRenderBuffer will return nil in case of non-AA RenderBuffer or if called for depth RenderBuffer 41 | // StencilTextureFromRenderBuffer will return nil in case of no-stencil RenderBuffer or if called for color RenderBuffer 42 | id (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer buffer); 43 | id (UNITY_INTERFACE_API * AAResolvedTextureFromRenderBuffer)(UnityRenderBuffer buffer); 44 | id (UNITY_INTERFACE_API * StencilTextureFromRenderBuffer)(UnityRenderBuffer buffer); 45 | 46 | }; 47 | UNITY_REGISTER_INTERFACE_GUID(0x992C8EAEA95811E5ULL,0x9A62C4B5B9876117ULL,IUnityGraphicsMetal) 48 | -------------------------------------------------------------------------------- /source/Unity/IUnityInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Unity native plugin API 4 | // Compatible with C99 5 | 6 | #if defined(__CYGWIN32__) 7 | #define UNITY_INTERFACE_API __stdcall 8 | #define UNITY_INTERFACE_EXPORT __declspec(dllexport) 9 | #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY) 10 | #define UNITY_INTERFACE_API __stdcall 11 | #define UNITY_INTERFACE_EXPORT __declspec(dllexport) 12 | #elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(__QNX__) 13 | #define UNITY_INTERFACE_API 14 | #define UNITY_INTERFACE_EXPORT 15 | #else 16 | #define UNITY_INTERFACE_API 17 | #define UNITY_INTERFACE_EXPORT 18 | #endif 19 | 20 | 21 | 22 | // Unity Interface GUID 23 | // Ensures cross plugin uniqueness. 24 | // 25 | // Template specialization is used to produce a means of looking up a GUID from it's payload type at compile time. 26 | // The net result should compile down to passing around the GUID. 27 | // 28 | // UNITY_REGISTER_INTERFACE_GUID should be placed in the header file of any payload definition outside of all namespaces. 29 | // The payload structure and the registration GUID are all that is required to expose the interface to other systems. 30 | struct UnityInterfaceGUID 31 | { 32 | #ifdef __cplusplus 33 | UnityInterfaceGUID(unsigned long long high, unsigned long long low) 34 | : m_GUIDHigh(high) 35 | , m_GUIDLow(low) 36 | { 37 | } 38 | 39 | UnityInterfaceGUID(const UnityInterfaceGUID& other) 40 | { 41 | m_GUIDHigh = other.m_GUIDHigh; 42 | m_GUIDLow = other.m_GUIDLow; 43 | } 44 | 45 | UnityInterfaceGUID& operator=(const UnityInterfaceGUID& other) 46 | { 47 | m_GUIDHigh = other.m_GUIDHigh; 48 | m_GUIDLow = other.m_GUIDLow; 49 | return *this; 50 | } 51 | 52 | bool Equals(const UnityInterfaceGUID& other) const { return m_GUIDHigh == other.m_GUIDHigh && m_GUIDLow == other.m_GUIDLow; } 53 | bool LessThan(const UnityInterfaceGUID& other) const { return m_GUIDHigh < other.m_GUIDHigh || (m_GUIDHigh == other.m_GUIDHigh && m_GUIDLow < other.m_GUIDLow); } 54 | #endif 55 | unsigned long long m_GUIDHigh; 56 | unsigned long long m_GUIDLow; 57 | }; 58 | #ifdef __cplusplus 59 | inline bool operator==(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return left.Equals(right); } 60 | inline bool operator!=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !left.Equals(right); } 61 | inline bool operator< (const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return left.LessThan(right); } 62 | inline bool operator> (const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return right.LessThan(left); } 63 | inline bool operator>=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !operator< (left,right); } 64 | inline bool operator<=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !operator> (left,right); } 65 | #else 66 | typedef struct UnityInterfaceGUID UnityInterfaceGUID; 67 | #endif 68 | 69 | 70 | 71 | #define UNITY_GET_INTERFACE_GUID(TYPE) TYPE##_GUID 72 | #define UNITY_GET_INTERFACE(INTERFACES, TYPE) (TYPE*)INTERFACES->GetInterface(UNITY_GET_INTERFACE_GUID(TYPE)); 73 | 74 | #ifdef __cplusplus 75 | #define UNITY_DECLARE_INTERFACE(NAME) \ 76 | struct NAME : IUnityInterface 77 | 78 | template \ 79 | inline const UnityInterfaceGUID GetUnityInterfaceGUID(); \ 80 | 81 | #define UNITY_REGISTER_INTERFACE_GUID(HASHH, HASHL, TYPE) \ 82 | const UnityInterfaceGUID TYPE##_GUID(HASHH, HASHL); \ 83 | template<> \ 84 | inline const UnityInterfaceGUID GetUnityInterfaceGUID() \ 85 | { \ 86 | return UNITY_GET_INTERFACE_GUID(TYPE); \ 87 | } 88 | #else 89 | #define UNITY_DECLARE_INTERFACE(NAME) \ 90 | typedef struct NAME NAME; \ 91 | struct NAME 92 | 93 | #define UNITY_REGISTER_INTERFACE_GUID(HASHH, HASHL, TYPE) \ 94 | const UnityInterfaceGUID TYPE##_GUID = {HASHH, HASHL}; 95 | #endif 96 | 97 | 98 | 99 | #ifdef __cplusplus 100 | struct IUnityInterface 101 | { 102 | }; 103 | #else 104 | typedef void IUnityInterface; 105 | #endif 106 | 107 | 108 | 109 | typedef struct IUnityInterfaces 110 | { 111 | // Returns an interface matching the guid. 112 | // Returns nullptr if the given interface is unavailable in the active Unity runtime. 113 | IUnityInterface* (UNITY_INTERFACE_API * GetInterface)(UnityInterfaceGUID guid); 114 | 115 | // Registers a new interface. 116 | void (UNITY_INTERFACE_API * RegisterInterface)(UnityInterfaceGUID guid, IUnityInterface* ptr); 117 | 118 | #ifdef __cplusplus 119 | // Helper for GetInterface. 120 | template 121 | INTERFACE* Get() 122 | { 123 | return static_cast(GetInterface(GetUnityInterfaceGUID())); 124 | } 125 | 126 | // Helper for RegisterInterface. 127 | template 128 | void Register(IUnityInterface* ptr) 129 | { 130 | RegisterInterface(GetUnityInterfaceGUID(), ptr); 131 | } 132 | #endif 133 | } IUnityInterfaces; 134 | 135 | 136 | 137 | #ifdef __cplusplus 138 | extern "C" { 139 | #endif 140 | 141 | // If exported by a plugin, this function will be called when the plugin is loaded. 142 | void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnityInterfaces* unityInterfaces); 143 | // If exported by a plugin, this function will be called when the plugin is about to be unloaded. 144 | void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload(); 145 | 146 | #ifdef __cplusplus 147 | } 148 | #endif 149 | -------------------------------------------------------------------------------- /source/UnityTextureSink.cpp: -------------------------------------------------------------------------------- 1 | #include "UnityTextureSink.h" 2 | #include "RTSPUnityPluginSingleton.h" 3 | 4 | rtsp_unity_plugin::UnityTextureSink::UnityTextureSink(void* textureHandle, const char * id, int height, int width) 5 | : MediaSink(height,width, AV_PIX_FMT_RGBA) 6 | { 7 | //AV_PIX_FMT_ARGB != textureformat ARGB32 8 | //AV_PIX_FMT_RGBA ?= textureformat RGBA32 9 | m_id = id; 10 | m_pTextureHandle = textureHandle; 11 | 12 | } 13 | 14 | rtsp_unity_plugin::UnityTextureSink::~UnityTextureSink() 15 | { 16 | } 17 | 18 | int rtsp_unity_plugin::UnityTextureSink::WriteAudio(AVFrame * audio_frame) 19 | { 20 | //TODO : not yet implemented 21 | return 0; 22 | } 23 | //to test texture manipulation 24 | void rtsp_unity_plugin::UnityTextureSink::draw_plasma(RenderAPI* render_api) { 25 | 26 | int width = m_Width; 27 | int height = m_Height; 28 | if (!m_pTextureHandle) 29 | return; 30 | 31 | int textureRowPitch; 32 | void* textureDataPtr = (unsigned char*)render_api->BeginModifyTexture(m_pTextureHandle, width, height, &textureRowPitch); 33 | if (!textureDataPtr) 34 | return; 35 | 36 | rtsp_unity_plugin::RTSPPluginSingleton& ffmpegClassPtr = rtsp_unity_plugin::RTSPPluginSingleton::Instance(); 37 | const float t = ffmpegClassPtr.getTime() *4.0f; 38 | 39 | unsigned char* dst = (unsigned char*)textureDataPtr; 40 | for (int y = 0; y < height; ++y) 41 | { 42 | unsigned char* ptr = dst; 43 | for (int x = 0; x < width; ++x) 44 | { 45 | // Simple "plasma effect": several combined sine waves 46 | int vv = int( 47 | (127.0f + (127.0f * sinf(x / 7.0f + t))) + 48 | (127.0f + (127.0f * sinf(y / 5.0f - t))) + 49 | (127.0f + (127.0f * sinf((x + y) / 6.0f - t))) + 50 | (127.0f + (127.0f * sinf(sqrtf(float(x*x + y*y)) / 4.0f - t))) 51 | ) / 4; 52 | 53 | // Write the texture pixel 54 | ptr[0] = vv; 55 | ptr[1] = 0; 56 | ptr[2] = 0; 57 | ptr[3] = 127; 58 | 59 | // To next pixel (our pixels are 4 bpp) 60 | ptr += 4; 61 | } 62 | 63 | // To next image row 64 | dst += textureRowPitch; 65 | } 66 | render_api->EndModifyTexture(m_pTextureHandle, m_Width, m_Height, textureRowPitch, textureDataPtr); 67 | 68 | } 69 | 70 | int rtsp_unity_plugin::UnityTextureSink::WriteVideo(RenderAPI* render_api, AVFrame * Video_frame) 71 | { 72 | 73 | int test = 0; 74 | 75 | //draw_plasma(render_api); 76 | //return 0; 77 | 78 | if (!m_pTextureHandle) 79 | return -2; 80 | //TODO adjust time here 81 | // Convert the image from its native format to RGB 82 | sws_scale( 83 | m_pSwsContext, 84 | (const uint8_t* const*)Video_frame->data, 85 | Video_frame->linesize, 86 | 0, 87 | Video_frame->height, 88 | m_pFrameDst->data, 89 | m_pFrameDst->linesize); 90 | 91 | 92 | int textureRowPitch; 93 | void* textureDataPtr = (uint8_t*)render_api->BeginModifyTexture(m_pTextureHandle, m_Width, m_Height, &textureRowPitch); 94 | if (!textureDataPtr) 95 | return -1; 96 | 97 | unsigned char* dst = (unsigned char*)textureDataPtr; 98 | unsigned char* src = (unsigned char*)m_pFrameDst->data[0]; 99 | 100 | for (int y = 0; y < m_Height; ++y) 101 | { 102 | unsigned char* ptr_dst = dst; 103 | unsigned char* ptr_src = src; 104 | for (int x = 0; x < m_Width; ++x) 105 | { 106 | // Simple "plasma effect": several combined sine waves 107 | 108 | // Write the texture pixel 109 | ptr_dst[0] = ptr_src[0]; 110 | ptr_dst[1] = ptr_src[1]; 111 | ptr_dst[2] = ptr_src[2]; 112 | ptr_dst[3] = 127; 113 | 114 | // To next pixel (our pixels are 4 bpp) 115 | ptr_dst += 4; 116 | ptr_src += 4; 117 | } 118 | // To next image row 119 | dst += textureRowPitch; 120 | src += m_pFrameDst->linesize[0]; 121 | } 122 | 123 | render_api->EndModifyTexture(m_pTextureHandle, m_Width, m_Height, textureRowPitch, textureDataPtr ); 124 | 125 | return test; 126 | 127 | } 128 | 129 | -------------------------------------------------------------------------------- /source/UnityTextureSink.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MediaSink.h" 3 | #include "RenderAPI.h" 4 | 5 | 6 | namespace rtsp_unity_plugin { 7 | 8 | 9 | 10 | class UnityTextureSink 11 | : public MediaSink 12 | { 13 | private: 14 | const char *m_id; 15 | void* m_pTextureHandle; 16 | 17 | //todo : initialize current api and unityGfxRenderer 18 | 19 | public: 20 | UnityTextureSink(void* textureHandle, const char* id, int height, int width); 21 | ~UnityTextureSink(); 22 | 23 | int WriteAudio(AVFrame* audio_frame); 24 | int WriteVideo(RenderAPI* render_api,AVFrame* Video_frame); 25 | private: 26 | void draw_plasma(RenderAPI * render_api); 27 | }; 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /source/ffmpegenv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | //============================= 5 | // Includes 6 | //----------------------------- 7 | // FFMPEG is writen in C so we need to use extern "C" 8 | //----------------------------- 9 | extern "C" { 10 | //#define INT64_C(x) (x ## LL) 11 | //#define UINT64_C(x) (x ## ULL) 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /source/unityenv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Unity/IUnityGraphics.h" 4 | struct IUnityInterfaces; 5 | 6 | --------------------------------------------------------------------------------