├── GLM.md ├── README.md ├── Using ANGLE for Windows and using the OpenGLES2.0 API.md ├── android下EGL使用 └── native-activity │ ├── AndroidManifest.xml │ ├── default.properties │ ├── jni │ ├── Android.mk │ ├── Application.mk │ └── main.c │ └── res │ └── values │ └── strings.xml ├── glfw-OpenGL └── glfwDemo │ ├── Code │ └── glfwDemo │ │ ├── glfwDemo.vcxproj │ │ ├── glfwDemo.vcxproj.filters │ │ └── glfwTest.cpp │ ├── Include │ └── GLFW │ │ ├── glfw3.h │ │ └── glfw3native.h │ ├── Lib │ ├── glfw3.dll │ ├── glfw3.lib │ └── glfw3dll.lib │ └── glfwDemo.sln ├── ios下EGL使用 └── IOS_OPENGLES_EGL │ ├── IOS_OPENGLES_EGL.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcuserdata │ │ └── wangf.xcuserdatad │ │ └── xcschemes │ │ ├── IOS_OPENGLES_EGL.xcscheme │ │ └── xcschememanagement.plist │ └── IOS_OPENGLES_EGL │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── ViewUsingEAGL.h │ ├── ViewUsingEAGL.m │ └── main.m ├── ios工程属性文件(UserInterfaceState.xcuserstate 这个不要 其他都要).png ├── vs2015 跨平台.jpg ├── win32下EGL使用 └── Win32EGL │ ├── Bin │ └── Debug │ │ ├── libEGL.dll │ │ └── libGLESv2.dll │ ├── Code │ └── Win32EGL │ │ ├── CELLWinApp.hpp │ │ ├── ReadMe.txt │ │ ├── Resource.h │ │ ├── Win32EGL.cpp │ │ ├── Win32EGL.h │ │ ├── Win32EGL.ico │ │ ├── Win32EGL.rc │ │ ├── Win32EGL.vcxproj │ │ ├── Win32EGL.vcxproj.filters │ │ ├── small.ico │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h │ ├── Include │ ├── KHR │ │ └── khrplatform.h │ ├── egl │ │ ├── egl.h │ │ ├── eglplatform.h │ │ └── khrplatform.h │ └── gles2 │ │ ├── gl2.h │ │ ├── gl2platform.h │ │ └── khrplatform.h │ ├── Lib │ ├── libEGL.lib │ └── libGLESv2.lib │ ├── Win32EGL.sln │ └── Win32EGL.v12.suo ├── win7系统下显卡驱动未安装正确.jpg ├── windows下使用OpenGL └── wglText │ ├── Bin │ └── Debug │ │ ├── FreeImage.dll │ │ ├── loading0.png │ │ ├── loading1.png │ │ └── loading2.png │ ├── depends │ ├── include │ │ ├── freeImage │ │ │ └── FreeImage.h │ │ └── glew │ │ │ ├── eglew.h │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ └── lib │ │ └── windows │ │ └── x86 │ │ └── FreeImage.lib │ ├── wglText.sdf │ ├── wglText.sln │ └── wglText │ ├── CELLMath.hpp │ ├── CELLShader.hpp │ ├── GLContext.h │ ├── Thread.hpp │ ├── Timestamp.hpp │ ├── glew.c │ ├── main.cpp │ ├── wglText.vcxproj │ ├── wglText.vcxproj.filters │ └── wglText.vcxproj.user ├── windows下无lib的情况下使用gles └── textXp │ ├── Depends │ ├── Include │ │ ├── KHR │ │ │ └── khrplatform.h │ │ ├── egl │ │ │ ├── egl.h │ │ │ └── eglplatform.h │ │ ├── freeImage │ │ │ └── FreeImage.h │ │ └── gles2 │ │ │ ├── gl2.h │ │ │ └── gl2platform.h │ └── Lib │ │ └── windows │ │ └── x86 │ │ └── FreeImage.lib │ ├── README.md │ ├── bin │ └── Debug │ │ ├── FreeImage.dll │ │ ├── d3dcompiler_43.dll │ │ ├── d3dcompiler_46.dll │ │ ├── libEGL.dll │ │ ├── libGLESv2.dll │ │ └── main.jpg │ ├── testXp.sdf │ ├── testXp.sln │ └── testXp │ ├── CELLMath.hpp │ ├── CELLShader.hpp │ ├── CELLWinApp.hpp │ ├── CGLESAdapter.hpp │ ├── ReadMe.txt │ ├── Resource.h │ ├── main.cpp │ ├── small.ico │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ ├── testXp.cpp │ ├── testXp.h │ ├── testXp.ico │ ├── testXp.rc │ ├── testXp.vcxproj │ └── testXp.vcxproj.filters └── 简单的使用EGL.md /GLM.md: -------------------------------------------------------------------------------- 1 | OpenGl中在进行图形变换的时候需要使用几何数学库,可以使用第三方数学库GLM。   2 | 3 | github地址:https://github.com/g-truc/glm 4 | 5 | ``` 6 | OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. 7 | 8 | GLM provides classes and functions designed and implemented with the same naming conventions and functionality than GLSL so that anyone who knows GLSL, can use GLM as well in C++. 9 | 10 | This project isn't limited to GLSL features. An extension system, based on the GLSL extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc... 11 | 12 | This library works perfectly with OpenGL but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physic simulations and any development context that requires a simple and convenient mathematics library. 13 | 14 | GLM is written in C++ 98 but can take advantage of C++ 11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers: 15 | 16 | Apple Clang 6.0 and higher 17 | GCC 4.7 and higher 18 | Intel C++ Composer XE 2013 and higher 19 | LLVM 3.4 and higher 20 | Visual C++ 2013 and higher 21 | CUDA 7.0 and higher (experimental) 22 | Any C++11 compiler 23 | For more information about GLM, please have a look at the manual and the API reference documentation. The source code and the documentation are licensed under both the Happy Bunny License (Modified MIT) or the MIT License. 24 | 25 | Thanks for contributing to the project by submitting issues for bug reports and feature requests. Any feedback is welcome at glm@g-truc.net. 26 | ``` 27 | 28 | ``` 29 | OpenGL Mathematics (GLM) 是基于OpenGL着色语言(GLSL)规范的图形软件的头文件C++数学库。 30 | 31 | GLM提供的类和函数使用与GLSL相同的命名约定和功能设计和实现,因此任何知道GLSL的人都可以在C++中使用GLM。 32 | 33 | 这个项目不限于GLSL的功能。基于GLSL扩展约定的扩展系统提供扩展能力:矩阵变换,四元数,数据打包,随机数,噪声等等。 34 | 35 | 这个库与OpenGL完美地工作,但它也确保与其他第三方库和SDK的互操作性。它是软件渲染(光线追踪/光栅化),图像处理,物理模拟和任何需要简单方便的数学库的开发上下文的良好候选。 36 | 37 | GLM是用C++ 98编写的,但是当编译器支持时可以利用C++ 11。它是一个没有依赖的平台独立库,它正式支持以下编译器: 38 | ● 苹果Clang 6.0及更高版本 39 | ● GCC 4.7及以上 40 | ● 英特尔C++ Composer XE 2013及更高版本 41 | ● LLVM 3.4及更高版本 42 | ● Visual C++ 2013及更高版本 43 | ● CUDA 7.0及更高版本(实验版) 44 | ● 任何C++ 11编译器 45 | 46 | 有关GLM的更多信息,请查看手册和API参考文档。 源代码和文档根据Happy Bunny License (Modified MIT)或MIT许可证授权。 47 | 48 | 感谢您通过提交错误报告和功能请求的问题为项目做出贡献。 欢迎任何反馈在glm@g-truc.net。 49 | 50 | ``` 51 | ```c++ 52 | 使用案例: 53 | 54 | #include // glm::vec3 55 | #include // glm::vec4 56 | #include // glm::mat4 57 | #include // glm::translate, glm::rotate, glm::scale, glm::perspective 58 | #include // glm::pi 59 | 60 | glm::mat4 camera(float Translate, glm::vec2 const & Rotate) 61 | { 62 | glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f); 63 | glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); 64 | View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); 65 | View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); 66 | glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); 67 | return Projection * View * Model; 68 | } 69 | ``` 70 | 71 | ```c++ 72 | 使用案例: 73 | 74 | GLuint positionLocation, modelMatrixLocation, viewMatrixLocation, projectionMatrixLocation; 75 | glm::mat4 modelMatrix, viewMatrix, projectionMatrix; 76 | 77 | { 78 | glUniformMatrix4fv(modelMatrixLocation, 1, GL_FALSE, glm::value_ptr(modelMatrix)); 79 | glUniformMatrix4fv(viewMatrixLocation, 1, GL_FALSE, glm::value_ptr(viewMatrix)); 80 | glUniformMatrix4fv(projectionMatrixLocation, 1, GL_FALSE, glm::value_ptr(projectionMatrix)); 81 | } 82 | ``` 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenGLES2.0在windows平台的实现 2 | 3 | 接口是OpenGLES的,真正的实现是d3d   4 | windows平台最后调用的是d3d: 5 | xp: d3dcompiler_43.dll 6 | win7: d3dcompiler_46.dll/d3dcompiler_47.dll 7 | 8 | - # Version 1.0 9 | ``` 10 | EGL version 1.0, approved on July 23, 2003, is the original version of EGL. EGL 11 | was loosely based on GLX 1.3, generalized to be implementable on many different 12 | operating systems and window systems and simplified to reflect the needs of 13 | embedded devices running OpenGL ES. 14 | ``` 15 | 16 | - # Version 1.1 17 | ``` 18 | EGL version 1.1, approved on August 5, 2004, is the second release of EGL. It 19 | adds power management and swap control functionality based on vendor extensions 20 | from Imagination Technologies, and optional render-to-texture functionality 21 | based on the WGL_ARB_render_texture extension defined by the OpenGL 22 | ARB for desktop OpenGL. 23 | B.1 Revision 1.1.2 24 | EGL version 1.1.2 (revision 2 of EGL 1.1), approved on November 10, 2004, clarified 25 | that vertex buffer objects are shared among contexts in the same fashion as 26 | texture objects 27 | ``` 28 | 29 | - # Version 1.2 30 | ``` 31 | EGL version 1.2, approved on July 8, 2005, is the third release of EGL. It adds 32 | support for the OpenVG 2D client API, in addition to support for OpenGL ES, and 33 | generalizes EGL concepts to enable supporting other client APIs in the future. 34 | ``` 35 | 36 | - # Version 1.3 37 | ``` 38 | EGL version 1.3 was voted out of the OpenKODE Working Group on December 39 | 4, 2006, and formally approval by the Khronos Board of Promoters on February 8, 40 | 2007. EGL 1.3 is the fourth release of EGL. 41 | ``` 42 | 43 | - # Version 1.4 44 | ``` 45 | EGL version 1.4 was voted out of the Khronos Technical Working Group on March 46 | 25, 2008, and formally approved by the Khronos Board of Promoters on May 29, 47 | 2008. 48 | ``` 49 | 50 | - # Version 1.5 51 | ``` 52 | EGL version 1.5 was voted out of the Khronos Technical Working Group on January 31, 2014, 53 | and formally approved by the Khronos Board of Promoters on 54 | March 14, 2014. 55 | ``` 56 | 57 | - # 老显卡,opengl es2.0 映射非2^n宽高的纹理   58 | 部分xp win7系统用户游戏画面是黑的,后来发现是显卡太老,不支持不规则纹理。     59 | 解决方案: 60 | 在绑定纹理后,添加下面四行代码   61 | ```c++ 62 | unsigned textureId = 0; 63 | glGenTextures( 1, &textureId ); 64 | glBindTexture( GL_TEXTURE_2D, textureId ); 65 | 66 | glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); 67 | glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 68 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);//用边缘的像素填充 69 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 70 | ``` 71 | 72 | - # win7用户无画面   73 | 代码问题:   74 | ```c++ 75 | const EGLint attribs[] = 76 | { 77 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 78 | EGL_BLUE_SIZE, 8, 79 | EGL_GREEN_SIZE, 8, 80 | EGL_RED_SIZE, 8, 81 | EGL_DEPTH_SIZE,24, 82 | EGL_NONE 83 | }; 84 | EGLint format(0); 85 | EGLint numConfigs(0); 86 | EGLint major; 87 | EGLint minor; 88 | 89 |      bool bRet = eglInitialize(_display, &major, &minor);//返回false 90 |      EGLint nErr = eglGetError();//返回12289 --> 0x3001 91 |      错误号0x3001: EGL_NOT_INITIALIZED EGL is not or could not be inititialized, for the specified display 92 |      将EGL_DEPTH_SIZE改为 16 8返回一样错误号 93 | ``` 94 | 95 | 查看设备管理器: 96 | 97 | ![](https://github.com/havenow/OpenGLES/blob/master/win7%E7%B3%BB%E7%BB%9F%E4%B8%8B%E6%98%BE%E5%8D%A1%E9%A9%B1%E5%8A%A8%E6%9C%AA%E5%AE%89%E8%A3%85%E6%AD%A3%E7%A1%AE.jpg) 98 | 99 | 显卡驱动未安装好,用ghost安装的系统,显卡驱动会安装不正确,显卡驱动安装成功,是可以查看到显卡厂商的。   100 | 下载一个驱动精灵,安装好显卡驱动就可以了。     101 | 安装成功后,显示适配器是: Intel(R) HD Graphics 4600 102 | 103 | - # 部分xp用户无法启动游戏 104 | xp自带dx可能比较老,可能gles用的是比较新的dx sdk,安装一个DXSDK_Jun10,就可以启动游戏了。 105 | 106 | 107 | - # vs2015 Community 108 | vs2015社区版,功能全但是不能是商业用途。 109 | URL:   110 | https://www.visualstudio.com/downloads/download-visual-studio-vs 111 | 112 | Visual Studio 2015 Community ISO 文件实际的下载地址为: 113 | http://download.microsoft.com/download/0/B/C/0BC321A4-013F-479C-84E6-4A2F90B11269/vs2015.com_enu.iso 114 | 115 | 新建项目(控制台应用程序)时,新建空项目,就不会生成一些和windows平台相关的代码,更利于跨平台的开发。 116 | 117 | - # pdb文件 118 | PDB文件是“程序数据库”Program Data Base的简称,包含的程序的代码信息 119 | 通过这个文件我们可以查看对应断点的位置,堆栈信息等内容 120 | 使用PDB使得我们无需代码也可以掌握程序的堆栈运行状态。 121 | 通常当我们编译代码后会自动生成一个PDB文件。 122 | 在VS的工程属性面板中选择“链接器”-》“调试”,则可以设置是否对pdb进行输出,并指定pdb的输出路径。 123 | 124 | - # dump文件 125 | dump文件是附加堆栈信息的存储文件的简称,文件扩展名是”.dmp”,通过dump文件我们可以得到程序运行某一时刻的堆栈数据。 126 | 当程序意外崩溃后,通常程序会立即中断运行,此时我们生成这一时刻的dump文件就可以通过此时的堆栈进行分析,找到崩溃的代码并分析原因。 127 | 128 | 如何得到dump文件 129 | 在vs中进入调试状态后中断,在菜单中选择“调试”-》“将转储另存为”即可生成dump文件 130 | 如何写代码生成dump文件 131 | 132 | 如何加载pdb文件 133 | 在VS中我们选择“菜单”-》工具-》选项,选项窗口中选择调试-》符号 134 | 设置pdb所在目录,当调试时vs会自动加载模块对应的pdb文件。 135 | 136 | - # 利用PDB和dump进行调试 137 | 收集输出dmp文件 138 | 设置程序pdb文件目录 139 | 打开dmp文件,运行dmp 140 | 通过堆栈定位问题函数 141 | 通过代码定位问题函数具体代码位置 142 | 143 | - # VS远程调试 附加到进程 144 | Visual Studio 远程调试 145 | 使用自带工具+附加进程     146 | 注意需要右键以管理员权限运行msvsmon.exe 147 | 148 | - # FreeType 149 | https://www.freetype.org/freetype2/docs/tutorial/step2.html#section-1 150 | 151 | 152 | - # VLD的配置文件 153 | 使用cef时,调用CefShutdown();会导致内存泄漏信息不会输出?? 154 | 和cef没关系,vs工程后来可以输出内存泄漏信息,但是未找到原因。     155 | 156 | 配置文件在安装目录下(vld.ini),修改配置文件将会影响所有使用到 VLD 的工程。 157 | 另外一种做法,将 vld.ini 复制到你的工程目录下(Visual Studio C++工程Debug目录),然后修改,只会影响你的所在工程配置。 158 | 159 | vld.ini 配置有几个选项,我只说一下我感觉很有用的: 160 | 161 | - VLD:选择VLD的打开与关闭。在Debug模式下运行,关闭以后会有一行VLD关闭的提示信息。默认为 on。 162 | - AggregateDuplicates:这个非常有用,设置为 yes 时,相同地方产生内存泄漏只输出一次,但是会统计发生的次数。默认是 no 。 163 | - MaxDataDump:输出的dump数据个数,默认为 256。 164 | - MaxTraceFrames:官方文档解释的非常复杂,我的理解就是输出的调用栈的层数。默认是 64。 165 | - ReportEncoding :report 文件的编码格式,可选有 ascii, unicode,默认是 ascii 。 166 | - ReportFile :report 文件的路径。默认是 “.\memory_leak_report.txt” 167 | - ReportTo :这个也是一个很有用的参数,可选有 debugger, file, both,debugger 表示输出到 debug模式下的输出窗口;file 表示只输出到文件中; both顾名思义,全都都输出。默认是 debugger 。具体用那个参数,看你的内存泄漏出现的多少了,自己衡量吧。 168 | 169 | - # glew库 170 | 支持opengl4.3的glew库glew-1.9.0-win32.zip 171 | 截止2012年8月7日,Khronos Group公布了最新的OpenGL 4.3规范。glew-1.9.0-win32.zip支持OpenGL4.3 172 | http://sourceforge.net/projects/glew/ 173 | 174 | - # OpenGL相关信息的获取 175 | 下面代码在Windows下面实现的。 176 | ```c++ 177 | GLenum err = glewInit(); 178 | if (err != GLEW_OK) 179 | { 180 | printf("glewInit error: %s\n", glewGetErrorString(err)); 181 | } 182 | 183 | const char* szVendorName = reinterpret_cast(glGetString(GL_VENDOR));//返回负责当前OpenGL实现厂商的名字 184 | const char* szRenderer = reinterpret_cast(glGetString(GL_RENDERER));//返回一个渲染器标识符,通常是个硬件平台 185 | const char* szOpenGLVersion = reinterpret_cast(glGetString(GL_VERSION)); //返回当前OpenGL实现的版本号 186 | const char* szExtString = reinterpret_cast(glGetString(GL_EXTENSIONS)); 187 | 188 | int nNumOfExt; 189 | glGetIntegerv(GL_NUM_EXTENSIONS, &nNumOfExt); 190 | for (int i = 0; i < nNumOfExt; i++) 191 | { 192 | const GLubyte *ext = glGetStringi(GL_EXTENSIONS, i); 193 | printf("%s\n", ext); 194 | } 195 | 196 | bool isSupport = glewIsSupported("GL_EXT_framebuffer_object"); //是否支持帧缓冲 197 | isSupport = glewIsSupported("GL_VERSION_2_0"); 198 | 199 | if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader) 200 | printf("Ready for GLSL: GLEW_ARB_vertex_shader GLEW_ARB_fragment_shader\n"); 201 | 202 | printf( 203 | "OpenGL Version GLSL Version\n" 204 | " 2.0 110\n" 205 | " 2.1 120\n" 206 | " 3.0 130\n" 207 | " 3.1 140\n" 208 | " 3.2 150\n" 209 | " 3.3 330\n" 210 | " 4.0 400\n" 211 | " 4.1 410\n" 212 | " 4.2 420\n" 213 | " 4.3 430\n" 214 | "\n" 215 | "\n" 216 | "OpenGL ES Version GLSL ES Version\n" 217 | " 2.0 100\n" 218 | " 3.0 300\n"); 219 | ``` 220 | 221 | 222 | -------------------------------------------------------------------------------- /android下EGL使用/native-activity/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /android下EGL使用/native-activity/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-10 12 | -------------------------------------------------------------------------------- /android下EGL使用/native-activity/jni/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2010 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | LOCAL_PATH := $(call my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | 19 | LOCAL_MODULE := native-activity 20 | LOCAL_SRC_FILES := main.c 21 | LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM 22 | LOCAL_STATIC_LIBRARIES := android_native_app_glue 23 | 24 | include $(BUILD_SHARED_LIBRARY) 25 | 26 | $(call import-module,android/native_app_glue) 27 | -------------------------------------------------------------------------------- /android下EGL使用/native-activity/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_PLATFORM := android-10 3 | -------------------------------------------------------------------------------- /android下EGL使用/native-activity/jni/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | //BEGIN_INCLUDE(all) 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "native-activity", __VA_ARGS__)) 30 | #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "native-activity", __VA_ARGS__)) 31 | 32 | /** 33 | * Our saved state data. 34 | */ 35 | struct saved_state { 36 | float angle; 37 | int32_t x; 38 | int32_t y; 39 | }; 40 | 41 | /** 42 | * Shared state for our app. 43 | */ 44 | struct engine { 45 | struct android_app* app; 46 | 47 | ASensorManager* sensorManager; 48 | const ASensor* accelerometerSensor; 49 | ASensorEventQueue* sensorEventQueue; 50 | 51 | int animating; 52 | EGLDisplay display; 53 | EGLSurface surface; 54 | EGLContext context; 55 | int32_t width; 56 | int32_t height; 57 | struct saved_state state; 58 | }; 59 | 60 | /** 61 | * Initialize an EGL context for the current display. 62 | */ 63 | static int engine_init_display(struct engine* engine) { 64 | // initialize OpenGL ES and EGL 65 | 66 | /* 67 | * Here specify the attributes of the desired configuration. 68 | * Below, we select an EGLConfig with at least 8 bits per color 69 | * component compatible with on-screen windows 70 | */ 71 | const EGLint attribs[] = { 72 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 73 | EGL_BLUE_SIZE, 8, 74 | EGL_GREEN_SIZE, 8, 75 | EGL_RED_SIZE, 8, 76 | EGL_NONE 77 | }; 78 | EGLint w, h, dummy, format; 79 | EGLint numConfigs; 80 | EGLConfig config; 81 | EGLSurface surface; 82 | EGLContext context; 83 | 84 | EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); 85 | 86 | eglInitialize(display, 0, 0); 87 | 88 | /* Here, the application chooses the configuration it desires. In this 89 | * sample, we have a very simplified selection process, where we pick 90 | * the first EGLConfig that matches our criteria */ 91 | eglChooseConfig(display, attribs, &config, 1, &numConfigs); 92 | 93 | /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is 94 | * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). 95 | * As soon as we picked a EGLConfig, we can safely reconfigure the 96 | * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */ 97 | eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format); 98 | 99 | ANativeWindow_setBuffersGeometry(engine->app->window, 0, 0, format); 100 | 101 | surface = eglCreateWindowSurface(display, config, engine->app->window, NULL); 102 | context = eglCreateContext(display, config, NULL, NULL); 103 | 104 | if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) { 105 | LOGW("Unable to eglMakeCurrent"); 106 | return -1; 107 | } 108 | 109 | eglQuerySurface(display, surface, EGL_WIDTH, &w); 110 | eglQuerySurface(display, surface, EGL_HEIGHT, &h); 111 | 112 | engine->display = display; 113 | engine->context = context; 114 | engine->surface = surface; 115 | engine->width = w; 116 | engine->height = h; 117 | engine->state.angle = 0; 118 | 119 | // Initialize GL state. 120 | glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); 121 | glEnable(GL_CULL_FACE); 122 | glShadeModel(GL_SMOOTH); 123 | glDisable(GL_DEPTH_TEST); 124 | 125 | return 0; 126 | } 127 | 128 | /** 129 | * Just the current frame in the display. 130 | */ 131 | static void engine_draw_frame(struct engine* engine) { 132 | if (engine->display == NULL) { 133 | // No display. 134 | return; 135 | } 136 | 137 | // Just fill the screen with a color. 138 | glClearColor(((float)engine->state.x)/engine->width, engine->state.angle, 139 | ((float)engine->state.y)/engine->height, 1); 140 | glClear(GL_COLOR_BUFFER_BIT); 141 | 142 | eglSwapBuffers(engine->display, engine->surface); 143 | } 144 | 145 | /** 146 | * Tear down the EGL context currently associated with the display. 147 | */ 148 | static void engine_term_display(struct engine* engine) { 149 | if (engine->display != EGL_NO_DISPLAY) { 150 | eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); 151 | if (engine->context != EGL_NO_CONTEXT) { 152 | eglDestroyContext(engine->display, engine->context); 153 | } 154 | if (engine->surface != EGL_NO_SURFACE) { 155 | eglDestroySurface(engine->display, engine->surface); 156 | } 157 | eglTerminate(engine->display); 158 | } 159 | engine->animating = 0; 160 | engine->display = EGL_NO_DISPLAY; 161 | engine->context = EGL_NO_CONTEXT; 162 | engine->surface = EGL_NO_SURFACE; 163 | } 164 | 165 | /** 166 | * Process the next input event. 167 | */ 168 | static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) { 169 | struct engine* engine = (struct engine*)app->userData; 170 | if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) { 171 | engine->animating = 1; 172 | engine->state.x = AMotionEvent_getX(event, 0); 173 | engine->state.y = AMotionEvent_getY(event, 0); 174 | return 1; 175 | } 176 | return 0; 177 | } 178 | 179 | /** 180 | * Process the next main command. 181 | */ 182 | static void engine_handle_cmd(struct android_app* app, int32_t cmd) { 183 | struct engine* engine = (struct engine*)app->userData; 184 | switch (cmd) { 185 | case APP_CMD_SAVE_STATE: 186 | // The system has asked us to save our current state. Do so. 187 | engine->app->savedState = malloc(sizeof(struct saved_state)); 188 | *((struct saved_state*)engine->app->savedState) = engine->state; 189 | engine->app->savedStateSize = sizeof(struct saved_state); 190 | break; 191 | case APP_CMD_INIT_WINDOW: 192 | // The window is being shown, get it ready. 193 | if (engine->app->window != NULL) { 194 | engine_init_display(engine); 195 | engine_draw_frame(engine); 196 | } 197 | break; 198 | case APP_CMD_TERM_WINDOW: 199 | // The window is being hidden or closed, clean it up. 200 | engine_term_display(engine); 201 | break; 202 | case APP_CMD_GAINED_FOCUS: 203 | // When our app gains focus, we start monitoring the accelerometer. 204 | if (engine->accelerometerSensor != NULL) { 205 | ASensorEventQueue_enableSensor(engine->sensorEventQueue, 206 | engine->accelerometerSensor); 207 | // We'd like to get 60 events per second (in us). 208 | ASensorEventQueue_setEventRate(engine->sensorEventQueue, 209 | engine->accelerometerSensor, (1000L/60)*1000); 210 | } 211 | break; 212 | case APP_CMD_LOST_FOCUS: 213 | // When our app loses focus, we stop monitoring the accelerometer. 214 | // This is to avoid consuming battery while not being used. 215 | if (engine->accelerometerSensor != NULL) { 216 | ASensorEventQueue_disableSensor(engine->sensorEventQueue, 217 | engine->accelerometerSensor); 218 | } 219 | // Also stop animating. 220 | engine->animating = 0; 221 | engine_draw_frame(engine); 222 | break; 223 | } 224 | } 225 | 226 | /** 227 | * This is the main entry point of a native application that is using 228 | * android_native_app_glue. It runs in its own thread, with its own 229 | * event loop for receiving input events and doing other things. 230 | */ 231 | void android_main(struct android_app* state) { 232 | struct engine engine; 233 | 234 | // Make sure glue isn't stripped. 235 | app_dummy(); 236 | 237 | memset(&engine, 0, sizeof(engine)); 238 | state->userData = &engine; 239 | state->onAppCmd = engine_handle_cmd; 240 | state->onInputEvent = engine_handle_input; 241 | engine.app = state; 242 | 243 | // Prepare to monitor accelerometer 244 | engine.sensorManager = ASensorManager_getInstance(); 245 | engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager, 246 | ASENSOR_TYPE_ACCELEROMETER); 247 | engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager, 248 | state->looper, LOOPER_ID_USER, NULL, NULL); 249 | 250 | if (state->savedState != NULL) { 251 | // We are starting with a previous saved state; restore from it. 252 | engine.state = *(struct saved_state*)state->savedState; 253 | } 254 | 255 | // loop waiting for stuff to do. 256 | 257 | while (1) { 258 | // Read all pending events. 259 | int ident; 260 | int events; 261 | struct android_poll_source* source; 262 | 263 | // If not animating, we will block forever waiting for events. 264 | // If animating, we loop until all events are read, then continue 265 | // to draw the next frame of animation. 266 | while ((ident=ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events, 267 | (void**)&source)) >= 0) { 268 | 269 | // Process this event. 270 | if (source != NULL) { 271 | source->process(state, source); 272 | } 273 | 274 | // If a sensor has data, process it now. 275 | if (ident == LOOPER_ID_USER) { 276 | if (engine.accelerometerSensor != NULL) { 277 | ASensorEvent event; 278 | while (ASensorEventQueue_getEvents(engine.sensorEventQueue, 279 | &event, 1) > 0) { 280 | LOGI("accelerometer: x=%f y=%f z=%f", 281 | event.acceleration.x, event.acceleration.y, 282 | event.acceleration.z); 283 | } 284 | } 285 | } 286 | 287 | // Check if we are exiting. 288 | if (state->destroyRequested != 0) { 289 | engine_term_display(&engine); 290 | return; 291 | } 292 | } 293 | 294 | if (engine.animating) { 295 | // Done with events; draw next animation frame. 296 | engine.state.angle += .01f; 297 | if (engine.state.angle > 1) { 298 | engine.state.angle = 0; 299 | } 300 | 301 | // Drawing is throttled to the screen update rate, so there 302 | // is no need to do timing here. 303 | engine_draw_frame(&engine); 304 | } 305 | } 306 | } 307 | //END_INCLUDE(all) 308 | -------------------------------------------------------------------------------- /android下EGL使用/native-activity/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | NativeActivity 4 | 5 | -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Code/glfwDemo/glfwDemo.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {2F96F953-FFCC-45A4-A400-78595BD61A0B} 15 | glfwDemo 16 | 17 | 18 | 19 | Application 20 | true 21 | v120 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | v120 28 | true 29 | MultiByte 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ..\..\Bin\$(Configuration)\ 43 | ..\..\Obj\$(Configuration)\$(ProjectName) 44 | $(ProjectName)D 45 | 46 | 47 | ..\..\Bin\$(Configuration)\ 48 | ..\..\Obj\$(Configuration)\$(ProjectName) 49 | 50 | 51 | 52 | Level3 53 | Disabled 54 | true 55 | ..\..\Include; 56 | _DEBUG;%(PreprocessorDefinitions) 57 | 58 | 59 | true 60 | ..\..\Lib; 61 | opengl32.lib;glfw3.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 62 | 63 | 64 | 65 | 66 | Level3 67 | MaxSpeed 68 | true 69 | true 70 | true 71 | ..\..\Include; 72 | 73 | 74 | true 75 | true 76 | true 77 | opengl32.lib;glfw3.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 78 | ..\..\Lib; 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Code/glfwDemo/glfwDemo.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 | 18 | 19 | 源文件 20 | 21 | 22 | -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Code/glfwDemo/glfwTest.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/glfw-OpenGL/glfwDemo/Code/glfwDemo/glfwTest.cpp -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Include/GLFW/glfw3native.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * GLFW 3.2 - www.glfw.org 3 | * A library for OpenGL, window and input 4 | *------------------------------------------------------------------------ 5 | * Copyright (c) 2002-2006 Marcus Geelnard 6 | * Copyright (c) 2006-2016 Camilla Berglund 7 | * 8 | * This software is provided 'as-is', without any express or implied 9 | * warranty. In no event will the authors be held liable for any damages 10 | * arising from the use of this software. 11 | * 12 | * Permission is granted to anyone to use this software for any purpose, 13 | * including commercial applications, and to alter it and redistribute it 14 | * freely, subject to the following restrictions: 15 | * 16 | * 1. The origin of this software must not be misrepresented; you must not 17 | * claim that you wrote the original software. If you use this software 18 | * in a product, an acknowledgment in the product documentation would 19 | * be appreciated but is not required. 20 | * 21 | * 2. Altered source versions must be plainly marked as such, and must not 22 | * be misrepresented as being the original software. 23 | * 24 | * 3. This notice may not be removed or altered from any source 25 | * distribution. 26 | * 27 | *************************************************************************/ 28 | 29 | #ifndef _glfw3_native_h_ 30 | #define _glfw3_native_h_ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | 37 | /************************************************************************* 38 | * Doxygen documentation 39 | *************************************************************************/ 40 | 41 | /*! @file glfw3native.h 42 | * @brief The header of the native access functions. 43 | * 44 | * This is the header file of the native access functions. See @ref native for 45 | * more information. 46 | */ 47 | /*! @defgroup native Native access 48 | * 49 | * **By using the native access functions you assert that you know what you're 50 | * doing and how to fix problems caused by using them. If you don't, you 51 | * shouldn't be using them.** 52 | * 53 | * Before the inclusion of @ref glfw3native.h, you may define exactly one 54 | * window system API macro and zero or more context creation API macros. 55 | * 56 | * The chosen backends must match those the library was compiled for. Failure 57 | * to do this will cause a link-time error. 58 | * 59 | * The available window API macros are: 60 | * * `GLFW_EXPOSE_NATIVE_WIN32` 61 | * * `GLFW_EXPOSE_NATIVE_COCOA` 62 | * * `GLFW_EXPOSE_NATIVE_X11` 63 | * * `GLFW_EXPOSE_NATIVE_WAYLAND` 64 | * * `GLFW_EXPOSE_NATIVE_MIR` 65 | * 66 | * The available context API macros are: 67 | * * `GLFW_EXPOSE_NATIVE_WGL` 68 | * * `GLFW_EXPOSE_NATIVE_NSGL` 69 | * * `GLFW_EXPOSE_NATIVE_GLX` 70 | * * `GLFW_EXPOSE_NATIVE_EGL` 71 | * 72 | * These macros select which of the native access functions that are declared 73 | * and which platform-specific headers to include. It is then up your (by 74 | * definition platform-specific) code to handle which of these should be 75 | * defined. 76 | */ 77 | 78 | 79 | /************************************************************************* 80 | * System headers and types 81 | *************************************************************************/ 82 | 83 | #if defined(GLFW_EXPOSE_NATIVE_WIN32) 84 | // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for 85 | // example to allow applications to correctly declare a GL_ARB_debug_output 86 | // callback) but windows.h assumes no one will define APIENTRY before it does 87 | #undef APIENTRY 88 | #include 89 | #elif defined(GLFW_EXPOSE_NATIVE_COCOA) 90 | #include 91 | #if defined(__OBJC__) 92 | #import 93 | #else 94 | typedef void* id; 95 | #endif 96 | #elif defined(GLFW_EXPOSE_NATIVE_X11) 97 | #include 98 | #include 99 | #elif defined(GLFW_EXPOSE_NATIVE_WAYLAND) 100 | #include 101 | #elif defined(GLFW_EXPOSE_NATIVE_MIR) 102 | #include 103 | #endif 104 | 105 | #if defined(GLFW_EXPOSE_NATIVE_WGL) 106 | /* WGL is declared by windows.h */ 107 | #endif 108 | #if defined(GLFW_EXPOSE_NATIVE_NSGL) 109 | /* NSGL is declared by Cocoa.h */ 110 | #endif 111 | #if defined(GLFW_EXPOSE_NATIVE_GLX) 112 | #include 113 | #endif 114 | #if defined(GLFW_EXPOSE_NATIVE_EGL) 115 | #include 116 | #endif 117 | 118 | 119 | /************************************************************************* 120 | * Functions 121 | *************************************************************************/ 122 | 123 | #if defined(GLFW_EXPOSE_NATIVE_WIN32) 124 | /*! @brief Returns the adapter device name of the specified monitor. 125 | * 126 | * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`) 127 | * of the specified monitor, or `NULL` if an [error](@ref error_handling) 128 | * occurred. 129 | * 130 | * @thread_safety This function may be called from any thread. Access is not 131 | * synchronized. 132 | * 133 | * @since Added in version 3.1. 134 | * 135 | * @ingroup native 136 | */ 137 | GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor); 138 | 139 | /*! @brief Returns the display device name of the specified monitor. 140 | * 141 | * @return The UTF-8 encoded display device name (for example 142 | * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an 143 | * [error](@ref error_handling) occurred. 144 | * 145 | * @thread_safety This function may be called from any thread. Access is not 146 | * synchronized. 147 | * 148 | * @since Added in version 3.1. 149 | * 150 | * @ingroup native 151 | */ 152 | GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor); 153 | 154 | /*! @brief Returns the `HWND` of the specified window. 155 | * 156 | * @return The `HWND` of the specified window, or `NULL` if an 157 | * [error](@ref error_handling) occurred. 158 | * 159 | * @thread_safety This function may be called from any thread. Access is not 160 | * synchronized. 161 | * 162 | * @since Added in version 3.0. 163 | * 164 | * @ingroup native 165 | */ 166 | GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); 167 | #endif 168 | 169 | #if defined(GLFW_EXPOSE_NATIVE_WGL) 170 | /*! @brief Returns the `HGLRC` of the specified window. 171 | * 172 | * @return The `HGLRC` of the specified window, or `NULL` if an 173 | * [error](@ref error_handling) occurred. 174 | * 175 | * @thread_safety This function may be called from any thread. Access is not 176 | * synchronized. 177 | * 178 | * @since Added in version 3.0. 179 | * 180 | * @ingroup native 181 | */ 182 | GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); 183 | #endif 184 | 185 | #if defined(GLFW_EXPOSE_NATIVE_COCOA) 186 | /*! @brief Returns the `CGDirectDisplayID` of the specified monitor. 187 | * 188 | * @return The `CGDirectDisplayID` of the specified monitor, or 189 | * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred. 190 | * 191 | * @thread_safety This function may be called from any thread. Access is not 192 | * synchronized. 193 | * 194 | * @since Added in version 3.1. 195 | * 196 | * @ingroup native 197 | */ 198 | GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); 199 | 200 | /*! @brief Returns the `NSWindow` of the specified window. 201 | * 202 | * @return The `NSWindow` of the specified window, or `nil` if an 203 | * [error](@ref error_handling) occurred. 204 | * 205 | * @thread_safety This function may be called from any thread. Access is not 206 | * synchronized. 207 | * 208 | * @since Added in version 3.0. 209 | * 210 | * @ingroup native 211 | */ 212 | GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); 213 | #endif 214 | 215 | #if defined(GLFW_EXPOSE_NATIVE_NSGL) 216 | /*! @brief Returns the `NSOpenGLContext` of the specified window. 217 | * 218 | * @return The `NSOpenGLContext` of the specified window, or `nil` if an 219 | * [error](@ref error_handling) occurred. 220 | * 221 | * @thread_safety This function may be called from any thread. Access is not 222 | * synchronized. 223 | * 224 | * @since Added in version 3.0. 225 | * 226 | * @ingroup native 227 | */ 228 | GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); 229 | #endif 230 | 231 | #if defined(GLFW_EXPOSE_NATIVE_X11) 232 | /*! @brief Returns the `Display` used by GLFW. 233 | * 234 | * @return The `Display` used by GLFW, or `NULL` if an 235 | * [error](@ref error_handling) occurred. 236 | * 237 | * @thread_safety This function may be called from any thread. Access is not 238 | * synchronized. 239 | * 240 | * @since Added in version 3.0. 241 | * 242 | * @ingroup native 243 | */ 244 | GLFWAPI Display* glfwGetX11Display(void); 245 | 246 | /*! @brief Returns the `RRCrtc` of the specified monitor. 247 | * 248 | * @return The `RRCrtc` of the specified monitor, or `None` if an 249 | * [error](@ref error_handling) occurred. 250 | * 251 | * @thread_safety This function may be called from any thread. Access is not 252 | * synchronized. 253 | * 254 | * @since Added in version 3.1. 255 | * 256 | * @ingroup native 257 | */ 258 | GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor); 259 | 260 | /*! @brief Returns the `RROutput` of the specified monitor. 261 | * 262 | * @return The `RROutput` of the specified monitor, or `None` if an 263 | * [error](@ref error_handling) occurred. 264 | * 265 | * @thread_safety This function may be called from any thread. Access is not 266 | * synchronized. 267 | * 268 | * @since Added in version 3.1. 269 | * 270 | * @ingroup native 271 | */ 272 | GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor); 273 | 274 | /*! @brief Returns the `Window` of the specified window. 275 | * 276 | * @return The `Window` of the specified window, or `None` if an 277 | * [error](@ref error_handling) occurred. 278 | * 279 | * @thread_safety This function may be called from any thread. Access is not 280 | * synchronized. 281 | * 282 | * @since Added in version 3.0. 283 | * 284 | * @ingroup native 285 | */ 286 | GLFWAPI Window glfwGetX11Window(GLFWwindow* window); 287 | #endif 288 | 289 | #if defined(GLFW_EXPOSE_NATIVE_GLX) 290 | /*! @brief Returns the `GLXContext` of the specified window. 291 | * 292 | * @return The `GLXContext` of the specified window, or `NULL` if an 293 | * [error](@ref error_handling) occurred. 294 | * 295 | * @thread_safety This function may be called from any thread. Access is not 296 | * synchronized. 297 | * 298 | * @since Added in version 3.0. 299 | * 300 | * @ingroup native 301 | */ 302 | GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); 303 | 304 | /*! @brief Returns the `GLXWindow` of the specified window. 305 | * 306 | * @return The `GLXWindow` of the specified window, or `None` if an 307 | * [error](@ref error_handling) occurred. 308 | * 309 | * @thread_safety This function may be called from any thread. Access is not 310 | * synchronized. 311 | * 312 | * @since Added in version 3.2. 313 | * 314 | * @ingroup native 315 | */ 316 | GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window); 317 | #endif 318 | 319 | #if defined(GLFW_EXPOSE_NATIVE_WAYLAND) 320 | /*! @brief Returns the `struct wl_display*` used by GLFW. 321 | * 322 | * @return The `struct wl_display*` used by GLFW, or `NULL` if an 323 | * [error](@ref error_handling) occurred. 324 | * 325 | * @thread_safety This function may be called from any thread. Access is not 326 | * synchronized. 327 | * 328 | * @since Added in version 3.2. 329 | * 330 | * @ingroup native 331 | */ 332 | GLFWAPI struct wl_display* glfwGetWaylandDisplay(void); 333 | 334 | /*! @brief Returns the `struct wl_output*` of the specified monitor. 335 | * 336 | * @return The `struct wl_output*` of the specified monitor, or `NULL` if an 337 | * [error](@ref error_handling) occurred. 338 | * 339 | * @thread_safety This function may be called from any thread. Access is not 340 | * synchronized. 341 | * 342 | * @since Added in version 3.2. 343 | * 344 | * @ingroup native 345 | */ 346 | GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor); 347 | 348 | /*! @brief Returns the main `struct wl_surface*` of the specified window. 349 | * 350 | * @return The main `struct wl_surface*` of the specified window, or `NULL` if 351 | * an [error](@ref error_handling) occurred. 352 | * 353 | * @thread_safety This function may be called from any thread. Access is not 354 | * synchronized. 355 | * 356 | * @since Added in version 3.2. 357 | * 358 | * @ingroup native 359 | */ 360 | GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window); 361 | #endif 362 | 363 | #if defined(GLFW_EXPOSE_NATIVE_MIR) 364 | /*! @brief Returns the `MirConnection*` used by GLFW. 365 | * 366 | * @return The `MirConnection*` used by GLFW, or `NULL` if an 367 | * [error](@ref error_handling) occurred. 368 | * 369 | * @thread_safety This function may be called from any thread. Access is not 370 | * synchronized. 371 | * 372 | * @since Added in version 3.2. 373 | * 374 | * @ingroup native 375 | */ 376 | GLFWAPI MirConnection* glfwGetMirDisplay(void); 377 | 378 | /*! @brief Returns the Mir output ID of the specified monitor. 379 | * 380 | * @return The Mir output ID of the specified monitor, or zero if an 381 | * [error](@ref error_handling) occurred. 382 | * 383 | * @thread_safety This function may be called from any thread. Access is not 384 | * synchronized. 385 | * 386 | * @since Added in version 3.2. 387 | * 388 | * @ingroup native 389 | */ 390 | GLFWAPI int glfwGetMirMonitor(GLFWmonitor* monitor); 391 | 392 | /*! @brief Returns the `MirSurface*` of the specified window. 393 | * 394 | * @return The `MirSurface*` of the specified window, or `NULL` if an 395 | * [error](@ref error_handling) occurred. 396 | * 397 | * @thread_safety This function may be called from any thread. Access is not 398 | * synchronized. 399 | * 400 | * @since Added in version 3.2. 401 | * 402 | * @ingroup native 403 | */ 404 | GLFWAPI MirSurface* glfwGetMirWindow(GLFWwindow* window); 405 | #endif 406 | 407 | #if defined(GLFW_EXPOSE_NATIVE_EGL) 408 | /*! @brief Returns the `EGLDisplay` used by GLFW. 409 | * 410 | * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an 411 | * [error](@ref error_handling) occurred. 412 | * 413 | * @thread_safety This function may be called from any thread. Access is not 414 | * synchronized. 415 | * 416 | * @since Added in version 3.0. 417 | * 418 | * @ingroup native 419 | */ 420 | GLFWAPI EGLDisplay glfwGetEGLDisplay(void); 421 | 422 | /*! @brief Returns the `EGLContext` of the specified window. 423 | * 424 | * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an 425 | * [error](@ref error_handling) occurred. 426 | * 427 | * @thread_safety This function may be called from any thread. Access is not 428 | * synchronized. 429 | * 430 | * @since Added in version 3.0. 431 | * 432 | * @ingroup native 433 | */ 434 | GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window); 435 | 436 | /*! @brief Returns the `EGLSurface` of the specified window. 437 | * 438 | * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an 439 | * [error](@ref error_handling) occurred. 440 | * 441 | * @thread_safety This function may be called from any thread. Access is not 442 | * synchronized. 443 | * 444 | * @since Added in version 3.0. 445 | * 446 | * @ingroup native 447 | */ 448 | GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window); 449 | #endif 450 | 451 | #ifdef __cplusplus 452 | } 453 | #endif 454 | 455 | #endif /* _glfw3_native_h_ */ 456 | 457 | -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Lib/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/glfw-OpenGL/glfwDemo/Lib/glfw3.dll -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Lib/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/glfw-OpenGL/glfwDemo/Lib/glfw3.lib -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/Lib/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/glfw-OpenGL/glfwDemo/Lib/glfw3dll.lib -------------------------------------------------------------------------------- /glfw-OpenGL/glfwDemo/glfwDemo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glfwDemo", "Code\glfwDemo\glfwDemo.vcxproj", "{2F96F953-FFCC-45A4-A400-78595BD61A0B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2F96F953-FFCC-45A4-A400-78595BD61A0B}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {2F96F953-FFCC-45A4-A400-78595BD61A0B}.Debug|Win32.Build.0 = Debug|Win32 16 | {2F96F953-FFCC-45A4-A400-78595BD61A0B}.Release|Win32.ActiveCfg = Release|Win32 17 | {2F96F953-FFCC-45A4-A400-78595BD61A0B}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7128239A1D766A3300B1F0E8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 712823991D766A3300B1F0E8 /* main.m */; }; 11 | 7128239D1D766A3300B1F0E8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7128239C1D766A3300B1F0E8 /* AppDelegate.m */; }; 12 | 712823A31D766A3300B1F0E8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 712823A11D766A3300B1F0E8 /* Main.storyboard */; }; 13 | 712823A51D766A3300B1F0E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 712823A41D766A3300B1F0E8 /* Assets.xcassets */; }; 14 | 712823A81D766A3300B1F0E8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 712823A61D766A3300B1F0E8 /* LaunchScreen.storyboard */; }; 15 | 712823B01D766A8D00B1F0E8 /* ViewUsingEAGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 712823AF1D766A8D00B1F0E8 /* ViewUsingEAGL.m */; }; 16 | 712823B31D766AEB00B1F0E8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 712823B21D766AEB00B1F0E8 /* OpenGLES.framework */; }; 17 | 712823B51D766AF300B1F0E8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 712823B41D766AF300B1F0E8 /* QuartzCore.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 712823951D766A3300B1F0E8 /* IOS_OPENGLES_EGL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IOS_OPENGLES_EGL.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 712823991D766A3300B1F0E8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | 7128239B1D766A3300B1F0E8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | 7128239C1D766A3300B1F0E8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | 712823A21D766A3300B1F0E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 712823A41D766A3300B1F0E8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 712823A71D766A3300B1F0E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 712823A91D766A3300B1F0E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 712823AF1D766A8D00B1F0E8 /* ViewUsingEAGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewUsingEAGL.m; sourceTree = ""; }; 30 | 712823B11D766AC600B1F0E8 /* ViewUsingEAGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewUsingEAGL.h; sourceTree = ""; }; 31 | 712823B21D766AEB00B1F0E8 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 32 | 712823B41D766AF300B1F0E8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 712823921D766A3300B1F0E8 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | 712823B51D766AF300B1F0E8 /* QuartzCore.framework in Frameworks */, 41 | 712823B31D766AEB00B1F0E8 /* OpenGLES.framework in Frameworks */, 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 7128238C1D766A3300B1F0E8 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 712823B41D766AF300B1F0E8 /* QuartzCore.framework */, 52 | 712823B21D766AEB00B1F0E8 /* OpenGLES.framework */, 53 | 712823971D766A3300B1F0E8 /* IOS_OPENGLES_EGL */, 54 | 712823961D766A3300B1F0E8 /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | 712823961D766A3300B1F0E8 /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 712823951D766A3300B1F0E8 /* IOS_OPENGLES_EGL.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | 712823971D766A3300B1F0E8 /* IOS_OPENGLES_EGL */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 7128239B1D766A3300B1F0E8 /* AppDelegate.h */, 70 | 7128239C1D766A3300B1F0E8 /* AppDelegate.m */, 71 | 712823B11D766AC600B1F0E8 /* ViewUsingEAGL.h */, 72 | 712823AF1D766A8D00B1F0E8 /* ViewUsingEAGL.m */, 73 | 712823A11D766A3300B1F0E8 /* Main.storyboard */, 74 | 712823A41D766A3300B1F0E8 /* Assets.xcassets */, 75 | 712823A61D766A3300B1F0E8 /* LaunchScreen.storyboard */, 76 | 712823A91D766A3300B1F0E8 /* Info.plist */, 77 | 712823981D766A3300B1F0E8 /* Supporting Files */, 78 | ); 79 | path = IOS_OPENGLES_EGL; 80 | sourceTree = ""; 81 | }; 82 | 712823981D766A3300B1F0E8 /* Supporting Files */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 712823991D766A3300B1F0E8 /* main.m */, 86 | ); 87 | name = "Supporting Files"; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | 712823941D766A3300B1F0E8 /* IOS_OPENGLES_EGL */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 712823AC1D766A3300B1F0E8 /* Build configuration list for PBXNativeTarget "IOS_OPENGLES_EGL" */; 96 | buildPhases = ( 97 | 712823911D766A3300B1F0E8 /* Sources */, 98 | 712823921D766A3300B1F0E8 /* Frameworks */, 99 | 712823931D766A3300B1F0E8 /* Resources */, 100 | ); 101 | buildRules = ( 102 | ); 103 | dependencies = ( 104 | ); 105 | name = IOS_OPENGLES_EGL; 106 | productName = IOS_OPENGLES_EGL; 107 | productReference = 712823951D766A3300B1F0E8 /* IOS_OPENGLES_EGL.app */; 108 | productType = "com.apple.product-type.application"; 109 | }; 110 | /* End PBXNativeTarget section */ 111 | 112 | /* Begin PBXProject section */ 113 | 7128238D1D766A3300B1F0E8 /* Project object */ = { 114 | isa = PBXProject; 115 | attributes = { 116 | LastUpgradeCheck = 0730; 117 | ORGANIZATIONNAME = wangf; 118 | TargetAttributes = { 119 | 712823941D766A3300B1F0E8 = { 120 | CreatedOnToolsVersion = 7.3.1; 121 | }; 122 | }; 123 | }; 124 | buildConfigurationList = 712823901D766A3300B1F0E8 /* Build configuration list for PBXProject "IOS_OPENGLES_EGL" */; 125 | compatibilityVersion = "Xcode 3.2"; 126 | developmentRegion = English; 127 | hasScannedForEncodings = 0; 128 | knownRegions = ( 129 | en, 130 | Base, 131 | ); 132 | mainGroup = 7128238C1D766A3300B1F0E8; 133 | productRefGroup = 712823961D766A3300B1F0E8 /* Products */; 134 | projectDirPath = ""; 135 | projectRoot = ""; 136 | targets = ( 137 | 712823941D766A3300B1F0E8 /* IOS_OPENGLES_EGL */, 138 | ); 139 | }; 140 | /* End PBXProject section */ 141 | 142 | /* Begin PBXResourcesBuildPhase section */ 143 | 712823931D766A3300B1F0E8 /* Resources */ = { 144 | isa = PBXResourcesBuildPhase; 145 | buildActionMask = 2147483647; 146 | files = ( 147 | 712823A81D766A3300B1F0E8 /* LaunchScreen.storyboard in Resources */, 148 | 712823A51D766A3300B1F0E8 /* Assets.xcassets in Resources */, 149 | 712823A31D766A3300B1F0E8 /* Main.storyboard in Resources */, 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXResourcesBuildPhase section */ 154 | 155 | /* Begin PBXSourcesBuildPhase section */ 156 | 712823911D766A3300B1F0E8 /* Sources */ = { 157 | isa = PBXSourcesBuildPhase; 158 | buildActionMask = 2147483647; 159 | files = ( 160 | 712823B01D766A8D00B1F0E8 /* ViewUsingEAGL.m in Sources */, 161 | 7128239D1D766A3300B1F0E8 /* AppDelegate.m in Sources */, 162 | 7128239A1D766A3300B1F0E8 /* main.m in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin PBXVariantGroup section */ 169 | 712823A11D766A3300B1F0E8 /* Main.storyboard */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | 712823A21D766A3300B1F0E8 /* Base */, 173 | ); 174 | name = Main.storyboard; 175 | sourceTree = ""; 176 | }; 177 | 712823A61D766A3300B1F0E8 /* LaunchScreen.storyboard */ = { 178 | isa = PBXVariantGroup; 179 | children = ( 180 | 712823A71D766A3300B1F0E8 /* Base */, 181 | ); 182 | name = LaunchScreen.storyboard; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXVariantGroup section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | 712823AA1D766A3300B1F0E8 /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_ANALYZER_NONNULL = YES; 193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 194 | CLANG_CXX_LIBRARY = "libc++"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_CONSTANT_CONVERSION = YES; 199 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 200 | CLANG_WARN_EMPTY_BODY = YES; 201 | CLANG_WARN_ENUM_CONVERSION = YES; 202 | CLANG_WARN_INT_CONVERSION = YES; 203 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 204 | CLANG_WARN_UNREACHABLE_CODE = YES; 205 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 206 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 207 | COPY_PHASE_STRIP = NO; 208 | DEBUG_INFORMATION_FORMAT = dwarf; 209 | ENABLE_STRICT_OBJC_MSGSEND = YES; 210 | ENABLE_TESTABILITY = YES; 211 | GCC_C_LANGUAGE_STANDARD = gnu99; 212 | GCC_DYNAMIC_NO_PIC = NO; 213 | GCC_NO_COMMON_BLOCKS = YES; 214 | GCC_OPTIMIZATION_LEVEL = 0; 215 | GCC_PREPROCESSOR_DEFINITIONS = ( 216 | "DEBUG=1", 217 | "$(inherited)", 218 | ); 219 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 220 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 221 | GCC_WARN_UNDECLARED_SELECTOR = YES; 222 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 223 | GCC_WARN_UNUSED_FUNCTION = YES; 224 | GCC_WARN_UNUSED_VARIABLE = YES; 225 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 226 | MTL_ENABLE_DEBUG_INFO = YES; 227 | ONLY_ACTIVE_ARCH = YES; 228 | SDKROOT = iphoneos; 229 | TARGETED_DEVICE_FAMILY = "1,2"; 230 | }; 231 | name = Debug; 232 | }; 233 | 712823AB1D766A3300B1F0E8 /* Release */ = { 234 | isa = XCBuildConfiguration; 235 | buildSettings = { 236 | ALWAYS_SEARCH_USER_PATHS = NO; 237 | CLANG_ANALYZER_NONNULL = YES; 238 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 239 | CLANG_CXX_LIBRARY = "libc++"; 240 | CLANG_ENABLE_MODULES = YES; 241 | CLANG_ENABLE_OBJC_ARC = YES; 242 | CLANG_WARN_BOOL_CONVERSION = YES; 243 | CLANG_WARN_CONSTANT_CONVERSION = YES; 244 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 245 | CLANG_WARN_EMPTY_BODY = YES; 246 | CLANG_WARN_ENUM_CONVERSION = YES; 247 | CLANG_WARN_INT_CONVERSION = YES; 248 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 249 | CLANG_WARN_UNREACHABLE_CODE = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 252 | COPY_PHASE_STRIP = NO; 253 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 254 | ENABLE_NS_ASSERTIONS = NO; 255 | ENABLE_STRICT_OBJC_MSGSEND = YES; 256 | GCC_C_LANGUAGE_STANDARD = gnu99; 257 | GCC_NO_COMMON_BLOCKS = YES; 258 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 259 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 260 | GCC_WARN_UNDECLARED_SELECTOR = YES; 261 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 262 | GCC_WARN_UNUSED_FUNCTION = YES; 263 | GCC_WARN_UNUSED_VARIABLE = YES; 264 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 265 | MTL_ENABLE_DEBUG_INFO = NO; 266 | SDKROOT = iphoneos; 267 | TARGETED_DEVICE_FAMILY = "1,2"; 268 | VALIDATE_PRODUCT = YES; 269 | }; 270 | name = Release; 271 | }; 272 | 712823AD1D766A3300B1F0E8 /* Debug */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 276 | INFOPLIST_FILE = IOS_OPENGLES_EGL/Info.plist; 277 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 278 | PRODUCT_BUNDLE_IDENTIFIER = "com.wf.IOS-OPENGLES-EGL"; 279 | PRODUCT_NAME = "$(TARGET_NAME)"; 280 | }; 281 | name = Debug; 282 | }; 283 | 712823AE1D766A3300B1F0E8 /* Release */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 287 | INFOPLIST_FILE = IOS_OPENGLES_EGL/Info.plist; 288 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 289 | PRODUCT_BUNDLE_IDENTIFIER = "com.wf.IOS-OPENGLES-EGL"; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | }; 292 | name = Release; 293 | }; 294 | /* End XCBuildConfiguration section */ 295 | 296 | /* Begin XCConfigurationList section */ 297 | 712823901D766A3300B1F0E8 /* Build configuration list for PBXProject "IOS_OPENGLES_EGL" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | 712823AA1D766A3300B1F0E8 /* Debug */, 301 | 712823AB1D766A3300B1F0E8 /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | 712823AC1D766A3300B1F0E8 /* Build configuration list for PBXNativeTarget "IOS_OPENGLES_EGL" */ = { 307 | isa = XCConfigurationList; 308 | buildConfigurations = ( 309 | 712823AD1D766A3300B1F0E8 /* Debug */, 310 | 712823AE1D766A3300B1F0E8 /* Release */, 311 | ); 312 | defaultConfigurationIsVisible = 0; 313 | }; 314 | /* End XCConfigurationList section */ 315 | }; 316 | rootObject = 7128238D1D766A3300B1F0E8 /* Project object */; 317 | } 318 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL.xcodeproj/xcuserdata/wangf.xcuserdatad/xcschemes/IOS_OPENGLES_EGL.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL.xcodeproj/xcuserdata/wangf.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IOS_OPENGLES_EGL.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 712823941D766A3300B1F0E8 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // IOS_OPENGLES_EGL 4 | // 5 | // Created by wangf on 16/8/31. 6 | // Copyright © 2016年 wangf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ViewUsingEAGL.h" 11 | 12 | @interface AppDelegate : UIResponder 13 | { 14 | ViewUsingEAGL* _glView; 15 | } 16 | 17 | 18 | @property (strong, nonatomic) UIWindow *window;//等价于EGLDispaly 19 | @property (strong, retain) IBOutlet ViewUsingEAGL *glView;//等价于EGLSurface 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // IOS_OPENGLES_EGL 4 | // 5 | // Created by wangf on 16/8/31. 6 | // Copyright © 2016年 wangf. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | @synthesize window = _window; 18 | @synthesize glView = _glView; 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | // Override point for customization after application launch. 23 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 24 | 25 | CGRect screenBounds = [[UIScreen mainScreen] bounds]; 26 | self.glView = [[ViewUsingEAGL alloc] initWithFrame:screenBounds]; 27 | [self.window addSubview:self.glView]; 28 | 29 | self.window.backgroundColor = [UIColor whiteColor]; 30 | [self.window makeKeyAndVisible]; 31 | return YES; 32 | } 33 | 34 | - (void)applicationWillResignActive:(UIApplication *)application { 35 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 36 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 37 | } 38 | 39 | - (void)applicationDidEnterBackground:(UIApplication *)application { 40 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | } 43 | 44 | - (void)applicationWillEnterForeground:(UIApplication *)application { 45 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 46 | } 47 | 48 | - (void)applicationDidBecomeActive:(UIApplication *)application { 49 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 50 | } 51 | 52 | - (void)applicationWillTerminate:(UIApplication *)application { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/ViewUsingEAGL.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewUsingEAGL.h 3 | // IOS_OPENGLES_EGL 4 | // 5 | // Created by wangf on 16/8/31. 6 | // Copyright © 2016年 wangf. All rights reserved. 7 | //参考 http://blog.csdn.net/kesalin/article/details/8221393 8 | // http://blog.db-in.com/khronos-egl-and-apple-eagl/ 9 | //oc语法: 10 | //http://blog.csdn.net/yuhailong626/article/details/9081815 11 | //http://blog.csdn.net/cherry609195946/article/details/19609485 12 | //http://www.cnblogs.com/QianChia/p/5780653.html 13 | 14 | #ifndef ViewUsingEAGL_h 15 | #define ViewUsingEAGL_h 16 | 17 | #import 18 | #import 19 | #include 20 | #include 21 | 22 | @interface ViewUsingEAGL : UIView { 23 | CAEAGLLayer* _eaglLayer; 24 | EAGLContext* _context; 25 | GLuint _colorRenderBuffer; 26 | GLuint _frameBuffer; 27 | } 28 | 29 | @end 30 | 31 | #endif /* ViewUsingEAGL_h */ 32 | -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/ViewUsingEAGL.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewUsingEAGL.m 3 | // IOS_OPENGLES_EGL 4 | // 5 | // Created by wangf on 16/8/31. 6 | // Copyright © 2016年 wangf. All rights reserved. 7 | // 8 | 9 | #import "ViewUsingEAGL.h" 10 | 11 | @interface ViewUsingEAGL() 12 | 13 | - (void)setupLayer; 14 | - (void)setupContext; 15 | - (void)setupRenderBuffer; 16 | - (void)setupFrameBuffer; 17 | - (void)destoryRenderAndFrameBuffer; 18 | - (void)render; 19 | 20 | @end 21 | 22 | @implementation ViewUsingEAGL 23 | 24 | + (Class)layerClass { 25 | // 只有 [CAEAGLLayer class] 类型的 layer 才支持在其上描绘 OpenGL 内容。 26 | return [CAEAGLLayer class]; 27 | } 28 | 29 | - (void)setupLayer 30 | { 31 | _eaglLayer = (CAEAGLLayer*) self.layer; 32 | 33 | // CALayer 默认是透明的,必须将它设为不透明才能让其可见 34 | _eaglLayer.opaque = YES; 35 | 36 | // 设置描绘属性,在这里设置不维持渲染内容以及颜色格式为 RGBA8 37 | _eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: 38 | [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; 39 | } 40 | 41 | - (void)setupContext { 42 | // 指定 OpenGL 渲染 API 的版本,在这里我们使用 OpenGL ES 2.0 43 | EAGLRenderingAPI api = kEAGLRenderingAPIOpenGLES2; 44 | _context = [[EAGLContext alloc] initWithAPI:api]; 45 | if (!_context) { 46 | NSLog(@"Failed to initialize OpenGLES 2.0 context"); 47 | exit(1); 48 | } 49 | 50 | // 设置为当前上下文 51 | if (![EAGLContext setCurrentContext:_context]) { 52 | _context = nil; 53 | 54 | NSLog(@"Failed to set current OpenGL context"); 55 | exit(1); 56 | } 57 | } 58 | 59 | - (void)setupRenderBuffer { 60 | glGenRenderbuffers(1, &_colorRenderBuffer); 61 | // 设置为当前 renderbuffer 62 | glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderBuffer); 63 | // 为 color renderbuffer 分配存储空间 64 | [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:_eaglLayer]; 65 | } 66 | 67 | - (void)setupFrameBuffer { 68 | glGenFramebuffers(1, &_frameBuffer); 69 | // 设置为当前 framebuffer 70 | glBindFramebuffer(GL_FRAMEBUFFER, _frameBuffer); 71 | // 将 _colorRenderBuffer 装配到 GL_COLOR_ATTACHMENT0 这个装配点上 72 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 73 | GL_RENDERBUFFER, _colorRenderBuffer); 74 | } 75 | 76 | - (void)destoryRenderAndFrameBuffer 77 | { 78 | glDeleteFramebuffers(1, &_frameBuffer); 79 | _frameBuffer = 0; 80 | glDeleteRenderbuffers(1, &_colorRenderBuffer); 81 | _colorRenderBuffer = 0; 82 | } 83 | 84 | - (void)render { 85 | glClearColor(0, 1.0, 0, 1.0); 86 | glClear(GL_COLOR_BUFFER_BIT); 87 | 88 | [_context presentRenderbuffer:GL_RENDERBUFFER]; 89 | } 90 | 91 | - (id)initWithFrame:(CGRect)frame 92 | { 93 | self = [super initWithFrame:frame]; 94 | if (self) { 95 | [self setupLayer]; 96 | [self setupContext]; 97 | } 98 | return self; 99 | } 100 | 101 | - (void)layoutSubviews { 102 | [EAGLContext setCurrentContext:_context]; 103 | 104 | [self destoryRenderAndFrameBuffer]; 105 | 106 | [self setupRenderBuffer]; 107 | [self setupFrameBuffer]; 108 | 109 | [self render]; 110 | } 111 | 112 | 113 | @end -------------------------------------------------------------------------------- /ios下EGL使用/IOS_OPENGLES_EGL/IOS_OPENGLES_EGL/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IOS_OPENGLES_EGL 4 | // 5 | // Created by wangf on 16/8/31. 6 | // Copyright © 2016年 wangf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios工程属性文件(UserInterfaceState.xcuserstate 这个不要 其他都要).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/ios工程属性文件(UserInterfaceState.xcuserstate 这个不要 其他都要).png -------------------------------------------------------------------------------- /vs2015 跨平台.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/vs2015 跨平台.jpg -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Bin/Debug/libEGL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Bin/Debug/libEGL.dll -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Bin/Debug/libGLESv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Bin/Debug/libGLESv2.dll -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/CELLWinApp.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/CELLWinApp.hpp -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | WIN32 应用程序:Win32EGL 项目概述 3 | ======================================================================== 4 | 5 | 应用程序向导已为您创建了此 Win32EGL 应用程序。 6 | 7 | 本文件概要介绍组成 Win32EGL 应用程序的每个文件的内容。 8 | 9 | 10 | Win32EGL.vcxproj 11 | 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 12 | 13 | Win32EGL.vcxproj.filters 14 | 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 15 | 16 | Win32EGL.cpp 17 | 这是主应用程序源文件。 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | 应用程序向导创建了下列资源: 21 | 22 | Win32EGL.rc 23 | 这是程序使用的所有 Microsoft Windows 资源的列表。它包括 RES 子目录中存储的图标、位图和光标。此文件可以直接在 Microsoft Visual C++ 中进行编辑。 24 | 25 | Resource.h 26 | 这是标准头文件,可用于定义新的资源 ID。Microsoft Visual C++ 将读取并更新此文件。 27 | 28 | Win32EGL.ico 29 | 这是用作应用程序图标 (32x32) 的图标文件。此图标包括在主资源文件 Win32EGL.rc 中。 30 | 31 | small.ico 32 | 这是一个图标文件,其中包含应用程序的图标的较小版本 (16x16)。此图标包括在主资源文件 Win32EGL.rc 中。 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | 其他标准文件: 36 | 37 | StdAfx.h, StdAfx.cpp 38 | 这些文件用于生成名为 Win32EGL.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | 其他注释: 42 | 43 | 应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 44 | 45 | ///////////////////////////////////////////////////////////////////////////// 46 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/Resource.h -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.cpp -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.ico -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.rc -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {50ECD8E5-725C-4AFF-B30A-426630C4D62E} 15 | Win32Proj 16 | Win32EGL 17 | 18 | 19 | 20 | Application 21 | true 22 | v120 23 | MultiByte 24 | 25 | 26 | Application 27 | false 28 | v120 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | ..\..\Bin\$(Configuration)\ 45 | ..\..\Obj\$(Configuration)\$(ProjectName) 46 | $(ProjectName)D 47 | 48 | 49 | false 50 | 51 | 52 | 53 | Use 54 | Level3 55 | Disabled 56 | WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 57 | true 58 | ..\..\Include; 59 | 60 | 61 | Windows 62 | true 63 | ..\..\Lib; 64 | libEGL.lib;libGLESv2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 65 | 66 | 67 | 68 | 69 | Level3 70 | Use 71 | MaxSpeed 72 | true 73 | true 74 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 75 | true 76 | 77 | 78 | Windows 79 | true 80 | true 81 | true 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | Create 97 | Create 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/Win32EGL.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 | 18 | 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 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/small.ico -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/stdafx.cpp -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/stdafx.h -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Code/Win32EGL/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Code/Win32EGL/targetver.h -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Include/KHR/khrplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __khrplatform_h_ 2 | #define __khrplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2008-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Platform-specific types and definitions. 28 | * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ 29 | * 30 | * Adopters may modify this file to suit their platform. Adopters are 31 | * encouraged to submit platform specific modifications to the Khronos 32 | * group so that they can be included in future versions of this file. 33 | * Please submit changes by sending them to the public Khronos Bugzilla 34 | * (http://khronos.org/bugzilla) by filing a bug against product 35 | * "Khronos (general)" component "Registry". 36 | * 37 | * A predefined template which fills in some of the bug fields can be 38 | * reached using http://tinyurl.com/khrplatform-h-bugreport, but you 39 | * must create a Bugzilla login first. 40 | * 41 | * 42 | * See the Implementer's Guidelines for information about where this file 43 | * should be located on your system. 44 | * http://www.khronos.org/registry/implementers_guide.pdf 45 | * 46 | * 47 | * This file should be included as 48 | * #include 49 | * by the Khronos API header file that uses its types and defines. 50 | * 51 | * The types in this file should only be used to define API-specific types. 52 | * Types defined in this file: 53 | * khronos_int8_t signed 8 bit 54 | * khronos_uint8_t unsigned 8 bit 55 | * khronos_int16_t signed 16 bit 56 | * khronos_uint16_t unsigned 16 bit 57 | * khronos_int32_t signed 32 bit 58 | * khronos_uint32_t unsigned 32 bit 59 | * khronos_int64_t signed 64 bit 60 | * khronos_uint64_t unsigned 64 bit 61 | * khronos_intptr_t signed same number of bits as a pointer 62 | * khronos_uintptr_t unsigned same number of bits as a pointer 63 | * khronos_ssize_t signed size 64 | * khronos_usize_t unsigned size 65 | * khronos_float_t signed 32 bit floating point 66 | * khronos_time_ns_t unsigned 64 bit time in nanoseconds 67 | * khronos_utime_nanoseconds_t unsigned time interval or absolute time in 68 | * nanoseconds 69 | * khronos_stime_nanoseconds_t signed time interval in nanoseconds 70 | * 71 | * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. 72 | * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. 73 | * 74 | * 75 | * Macros defined in this file: 76 | * KHRONOS_APICALL 77 | * KHRONOS_APIENTRY 78 | * KHRONOS_APIATTRIBUTES 79 | * These may be used in function prototypes as: 80 | * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( 81 | * int arg1, 82 | * int arg2) KHRONOS_APIATTRIBUTES; 83 | */ 84 | 85 | /*------------------------------------------------------------------------- 86 | * Definition of KHRONOS_APICALL 87 | *------------------------------------------------------------------------- 88 | * This precedes the return type of the function in the function prototype. 89 | */ 90 | #if defined(_WIN32) && !defined(__SCITECH_SNAP__) 91 | # define KHRONOS_APICALL __declspec(dllimport) 92 | #elif defined (__SYMBIAN32__) 93 | # define KHRONOS_APICALL IMPORT_C 94 | #elif defined(__ANDROID__) 95 | # include 96 | # define KHRONOS_APICALL __attribute__((visibility("default"))) __NDK_FPABI__ 97 | #else 98 | # define KHRONOS_APICALL 99 | #endif 100 | 101 | /*------------------------------------------------------------------------- 102 | * Definition of KHRONOS_APIENTRY 103 | *------------------------------------------------------------------------- 104 | * This follows the return type of the function and precedes the function 105 | * name in the function prototype. 106 | */ 107 | #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) 108 | /* Win32 but not WinCE */ 109 | # define KHRONOS_APIENTRY __stdcall 110 | #else 111 | # define KHRONOS_APIENTRY 112 | #endif 113 | 114 | /*------------------------------------------------------------------------- 115 | * Definition of KHRONOS_APIATTRIBUTES 116 | *------------------------------------------------------------------------- 117 | * This follows the closing parenthesis of the function prototype arguments. 118 | */ 119 | #if defined (__ARMCC_2__) 120 | #define KHRONOS_APIATTRIBUTES __softfp 121 | #else 122 | #define KHRONOS_APIATTRIBUTES 123 | #endif 124 | 125 | /*------------------------------------------------------------------------- 126 | * basic type definitions 127 | *-----------------------------------------------------------------------*/ 128 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) 129 | 130 | 131 | /* 132 | * Using 133 | */ 134 | #include 135 | typedef int32_t khronos_int32_t; 136 | typedef uint32_t khronos_uint32_t; 137 | typedef int64_t khronos_int64_t; 138 | typedef uint64_t khronos_uint64_t; 139 | #define KHRONOS_SUPPORT_INT64 1 140 | #define KHRONOS_SUPPORT_FLOAT 1 141 | 142 | #elif defined(__VMS ) || defined(__sgi) 143 | 144 | /* 145 | * Using 146 | */ 147 | #include 148 | typedef int32_t khronos_int32_t; 149 | typedef uint32_t khronos_uint32_t; 150 | typedef int64_t khronos_int64_t; 151 | typedef uint64_t khronos_uint64_t; 152 | #define KHRONOS_SUPPORT_INT64 1 153 | #define KHRONOS_SUPPORT_FLOAT 1 154 | 155 | #elif defined(_WIN32) && !defined(__SCITECH_SNAP__) 156 | 157 | /* 158 | * Win32 159 | */ 160 | typedef __int32 khronos_int32_t; 161 | typedef unsigned __int32 khronos_uint32_t; 162 | typedef __int64 khronos_int64_t; 163 | typedef unsigned __int64 khronos_uint64_t; 164 | #define KHRONOS_SUPPORT_INT64 1 165 | #define KHRONOS_SUPPORT_FLOAT 1 166 | 167 | #elif defined(__sun__) || defined(__digital__) 168 | 169 | /* 170 | * Sun or Digital 171 | */ 172 | typedef int khronos_int32_t; 173 | typedef unsigned int khronos_uint32_t; 174 | #if defined(__arch64__) || defined(_LP64) 175 | typedef long int khronos_int64_t; 176 | typedef unsigned long int khronos_uint64_t; 177 | #else 178 | typedef long long int khronos_int64_t; 179 | typedef unsigned long long int khronos_uint64_t; 180 | #endif /* __arch64__ */ 181 | #define KHRONOS_SUPPORT_INT64 1 182 | #define KHRONOS_SUPPORT_FLOAT 1 183 | 184 | #elif 0 185 | 186 | /* 187 | * Hypothetical platform with no float or int64 support 188 | */ 189 | typedef int khronos_int32_t; 190 | typedef unsigned int khronos_uint32_t; 191 | #define KHRONOS_SUPPORT_INT64 0 192 | #define KHRONOS_SUPPORT_FLOAT 0 193 | 194 | #else 195 | 196 | /* 197 | * Generic fallback 198 | */ 199 | #include 200 | typedef int32_t khronos_int32_t; 201 | typedef uint32_t khronos_uint32_t; 202 | typedef int64_t khronos_int64_t; 203 | typedef uint64_t khronos_uint64_t; 204 | #define KHRONOS_SUPPORT_INT64 1 205 | #define KHRONOS_SUPPORT_FLOAT 1 206 | 207 | #endif 208 | 209 | 210 | /* 211 | * Types that are (so far) the same on all platforms 212 | */ 213 | typedef signed char khronos_int8_t; 214 | typedef unsigned char khronos_uint8_t; 215 | typedef signed short int khronos_int16_t; 216 | typedef unsigned short int khronos_uint16_t; 217 | typedef signed long int khronos_intptr_t; 218 | typedef unsigned long int khronos_uintptr_t; 219 | typedef signed long int khronos_ssize_t; 220 | typedef unsigned long int khronos_usize_t; 221 | 222 | #if KHRONOS_SUPPORT_FLOAT 223 | /* 224 | * Float type 225 | */ 226 | typedef float khronos_float_t; 227 | #endif 228 | 229 | #if KHRONOS_SUPPORT_INT64 230 | /* Time types 231 | * 232 | * These types can be used to represent a time interval in nanoseconds or 233 | * an absolute Unadjusted System Time. Unadjusted System Time is the number 234 | * of nanoseconds since some arbitrary system event (e.g. since the last 235 | * time the system booted). The Unadjusted System Time is an unsigned 236 | * 64 bit value that wraps back to 0 every 584 years. Time intervals 237 | * may be either signed or unsigned. 238 | */ 239 | typedef khronos_uint64_t khronos_utime_nanoseconds_t; 240 | typedef khronos_int64_t khronos_stime_nanoseconds_t; 241 | #endif 242 | 243 | 244 | #endif /* __khrplatform_h_ */ 245 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Include/egl/egl.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; tab-width: 8; -*- */ 2 | /* vi: set sw=4 ts=8: */ 3 | /* Reference version of egl.h for EGL 1.4. 4 | * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ 5 | */ 6 | 7 | /* 8 | ** Copyright (c) 2007-2009 The Khronos Group Inc. 9 | ** 10 | ** Permission is hereby granted, free of charge, to any person obtaining a 11 | ** copy of this software and/or associated documentation files (the 12 | ** "Materials"), to deal in the Materials without restriction, including 13 | ** without limitation the rights to use, copy, modify, merge, publish, 14 | ** distribute, sublicense, and/or sell copies of the Materials, and to 15 | ** permit persons to whom the Materials are furnished to do so, subject to 16 | ** the following conditions: 17 | ** 18 | ** The above copyright notice and this permission notice shall be included 19 | ** in all copies or substantial portions of the Materials. 20 | ** 21 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 25 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 28 | */ 29 | 30 | #ifndef __egl_h_ 31 | #define __egl_h_ 32 | 33 | /* All platform-dependent types and macro boilerplate (such as EGLAPI 34 | * and EGLAPIENTRY) should go in eglplatform.h. 35 | */ 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* EGL Types */ 43 | /* EGLint is defined in eglplatform.h */ 44 | typedef unsigned int EGLBoolean; 45 | typedef unsigned int EGLenum; 46 | typedef void *EGLConfig; 47 | typedef void *EGLContext; 48 | typedef void *EGLDisplay; 49 | typedef void *EGLSurface; 50 | typedef void *EGLClientBuffer; 51 | 52 | /* EGL Versioning */ 53 | #define EGL_VERSION_1_0 1 54 | #define EGL_VERSION_1_1 1 55 | #define EGL_VERSION_1_2 1 56 | #define EGL_VERSION_1_3 1 57 | #define EGL_VERSION_1_4 1 58 | 59 | /* EGL Enumerants. Bitmasks and other exceptional cases aside, most 60 | * enums are assigned unique values starting at 0x3000. 61 | */ 62 | 63 | /* EGL aliases */ 64 | #define EGL_FALSE 0 65 | #define EGL_TRUE 1 66 | 67 | /* Out-of-band handle values */ 68 | #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) 69 | #define EGL_NO_CONTEXT ((EGLContext)0) 70 | #define EGL_NO_DISPLAY ((EGLDisplay)0) 71 | #define EGL_NO_SURFACE ((EGLSurface)0) 72 | 73 | /* Out-of-band attribute value */ 74 | #define EGL_DONT_CARE ((EGLint)-1) 75 | 76 | /* Errors / GetError return values */ 77 | #define EGL_SUCCESS 0x3000 78 | #define EGL_NOT_INITIALIZED 0x3001 79 | #define EGL_BAD_ACCESS 0x3002 80 | #define EGL_BAD_ALLOC 0x3003 81 | #define EGL_BAD_ATTRIBUTE 0x3004 82 | #define EGL_BAD_CONFIG 0x3005 83 | #define EGL_BAD_CONTEXT 0x3006 84 | #define EGL_BAD_CURRENT_SURFACE 0x3007 85 | #define EGL_BAD_DISPLAY 0x3008 86 | #define EGL_BAD_MATCH 0x3009 87 | #define EGL_BAD_NATIVE_PIXMAP 0x300A 88 | #define EGL_BAD_NATIVE_WINDOW 0x300B 89 | #define EGL_BAD_PARAMETER 0x300C 90 | #define EGL_BAD_SURFACE 0x300D 91 | #define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ 92 | 93 | /* Reserved 0x300F-0x301F for additional errors */ 94 | 95 | /* Config attributes */ 96 | #define EGL_BUFFER_SIZE 0x3020 97 | #define EGL_ALPHA_SIZE 0x3021 98 | #define EGL_BLUE_SIZE 0x3022 99 | #define EGL_GREEN_SIZE 0x3023 100 | #define EGL_RED_SIZE 0x3024 101 | #define EGL_DEPTH_SIZE 0x3025 102 | #define EGL_STENCIL_SIZE 0x3026 103 | #define EGL_CONFIG_CAVEAT 0x3027 104 | #define EGL_CONFIG_ID 0x3028 105 | #define EGL_LEVEL 0x3029 106 | #define EGL_MAX_PBUFFER_HEIGHT 0x302A 107 | #define EGL_MAX_PBUFFER_PIXELS 0x302B 108 | #define EGL_MAX_PBUFFER_WIDTH 0x302C 109 | #define EGL_NATIVE_RENDERABLE 0x302D 110 | #define EGL_NATIVE_VISUAL_ID 0x302E 111 | #define EGL_NATIVE_VISUAL_TYPE 0x302F 112 | #define EGL_SAMPLES 0x3031 113 | #define EGL_SAMPLE_BUFFERS 0x3032 114 | #define EGL_SURFACE_TYPE 0x3033 115 | #define EGL_TRANSPARENT_TYPE 0x3034 116 | #define EGL_TRANSPARENT_BLUE_VALUE 0x3035 117 | #define EGL_TRANSPARENT_GREEN_VALUE 0x3036 118 | #define EGL_TRANSPARENT_RED_VALUE 0x3037 119 | #define EGL_NONE 0x3038 /* Attrib list terminator */ 120 | #define EGL_BIND_TO_TEXTURE_RGB 0x3039 121 | #define EGL_BIND_TO_TEXTURE_RGBA 0x303A 122 | #define EGL_MIN_SWAP_INTERVAL 0x303B 123 | #define EGL_MAX_SWAP_INTERVAL 0x303C 124 | #define EGL_LUMINANCE_SIZE 0x303D 125 | #define EGL_ALPHA_MASK_SIZE 0x303E 126 | #define EGL_COLOR_BUFFER_TYPE 0x303F 127 | #define EGL_RENDERABLE_TYPE 0x3040 128 | #define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ 129 | #define EGL_CONFORMANT 0x3042 130 | 131 | /* Reserved 0x3041-0x304F for additional config attributes */ 132 | 133 | /* Config attribute values */ 134 | #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ 135 | #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ 136 | #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ 137 | #define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ 138 | #define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ 139 | 140 | /* More config attribute values, for EGL_TEXTURE_FORMAT */ 141 | #define EGL_NO_TEXTURE 0x305C 142 | #define EGL_TEXTURE_RGB 0x305D 143 | #define EGL_TEXTURE_RGBA 0x305E 144 | #define EGL_TEXTURE_2D 0x305F 145 | 146 | /* Config attribute mask bits */ 147 | #define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ 148 | #define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ 149 | #define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ 150 | #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ 151 | #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ 152 | #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ 153 | #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ 154 | 155 | #define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ 156 | #define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ 157 | #define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ 158 | #define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ 159 | 160 | /* QueryString targets */ 161 | #define EGL_VENDOR 0x3053 162 | #define EGL_VERSION 0x3054 163 | #define EGL_EXTENSIONS 0x3055 164 | #define EGL_CLIENT_APIS 0x308D 165 | 166 | /* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ 167 | #define EGL_HEIGHT 0x3056 168 | #define EGL_WIDTH 0x3057 169 | #define EGL_LARGEST_PBUFFER 0x3058 170 | #define EGL_TEXTURE_FORMAT 0x3080 171 | #define EGL_TEXTURE_TARGET 0x3081 172 | #define EGL_MIPMAP_TEXTURE 0x3082 173 | #define EGL_MIPMAP_LEVEL 0x3083 174 | #define EGL_RENDER_BUFFER 0x3086 175 | #define EGL_VG_COLORSPACE 0x3087 176 | #define EGL_VG_ALPHA_FORMAT 0x3088 177 | #define EGL_HORIZONTAL_RESOLUTION 0x3090 178 | #define EGL_VERTICAL_RESOLUTION 0x3091 179 | #define EGL_PIXEL_ASPECT_RATIO 0x3092 180 | #define EGL_SWAP_BEHAVIOR 0x3093 181 | #define EGL_MULTISAMPLE_RESOLVE 0x3099 182 | 183 | /* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ 184 | #define EGL_BACK_BUFFER 0x3084 185 | #define EGL_SINGLE_BUFFER 0x3085 186 | 187 | /* OpenVG color spaces */ 188 | #define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ 189 | #define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ 190 | 191 | /* OpenVG alpha formats */ 192 | #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ 193 | #define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ 194 | 195 | /* Constant scale factor by which fractional display resolutions & 196 | * aspect ratio are scaled when queried as integer values. 197 | */ 198 | #define EGL_DISPLAY_SCALING 10000 199 | 200 | /* Unknown display resolution/aspect ratio */ 201 | #define EGL_UNKNOWN ((EGLint)-1) 202 | 203 | /* Back buffer swap behaviors */ 204 | #define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ 205 | #define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ 206 | 207 | /* CreatePbufferFromClientBuffer buffer types */ 208 | #define EGL_OPENVG_IMAGE 0x3096 209 | 210 | /* QueryContext targets */ 211 | #define EGL_CONTEXT_CLIENT_TYPE 0x3097 212 | 213 | /* CreateContext attributes */ 214 | #define EGL_CONTEXT_CLIENT_VERSION 0x3098 215 | 216 | /* Multisample resolution behaviors */ 217 | #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ 218 | #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ 219 | 220 | /* BindAPI/QueryAPI targets */ 221 | #define EGL_OPENGL_ES_API 0x30A0 222 | #define EGL_OPENVG_API 0x30A1 223 | #define EGL_OPENGL_API 0x30A2 224 | 225 | /* GetCurrentSurface targets */ 226 | #define EGL_DRAW 0x3059 227 | #define EGL_READ 0x305A 228 | 229 | /* WaitNative engines */ 230 | #define EGL_CORE_NATIVE_ENGINE 0x305B 231 | 232 | /* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ 233 | #define EGL_COLORSPACE EGL_VG_COLORSPACE 234 | #define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT 235 | #define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB 236 | #define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR 237 | #define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE 238 | #define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE 239 | 240 | /* EGL extensions must request enum blocks from the Khronos 241 | * API Registrar, who maintains the enumerant registry. Submit 242 | * a bug in Khronos Bugzilla against task "Registry". 243 | */ 244 | 245 | 246 | 247 | /* EGL Functions */ 248 | 249 | EGLAPI EGLint EGLAPIENTRY eglGetError(void); 250 | 251 | EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); 252 | EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); 253 | EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); 254 | 255 | EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); 256 | 257 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, 258 | EGLint config_size, EGLint *num_config); 259 | EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, 260 | EGLConfig *configs, EGLint config_size, 261 | EGLint *num_config); 262 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, 263 | EGLint attribute, EGLint *value); 264 | 265 | EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, 266 | EGLNativeWindowType win, 267 | const EGLint *attrib_list); 268 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, 269 | const EGLint *attrib_list); 270 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, 271 | EGLNativePixmapType pixmap, 272 | const EGLint *attrib_list); 273 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); 274 | EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, 275 | EGLint attribute, EGLint *value); 276 | 277 | EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); 278 | EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); 279 | 280 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); 281 | 282 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); 283 | 284 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( 285 | EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, 286 | EGLConfig config, const EGLint *attrib_list); 287 | 288 | EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, 289 | EGLint attribute, EGLint value); 290 | EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 291 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 292 | 293 | 294 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); 295 | 296 | 297 | EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, 298 | EGLContext share_context, 299 | const EGLint *attrib_list); 300 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); 301 | EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, 302 | EGLSurface read, EGLContext ctx); 303 | 304 | EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); 305 | EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); 306 | EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); 307 | EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, 308 | EGLint attribute, EGLint *value); 309 | 310 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); 311 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); 312 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); 313 | EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, 314 | EGLNativePixmapType target); 315 | 316 | /* This is a generic function pointer type, whose name indicates it must 317 | * be cast to the proper type *and calling convention* before use. 318 | */ 319 | typedef void (*__eglMustCastToProperFunctionPointerType)(void); 320 | 321 | /* Now, define eglGetProcAddress using the generic function ptr. type */ 322 | EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY 323 | eglGetProcAddress(const char *procname); 324 | 325 | #ifdef __cplusplus 326 | } 327 | #endif 328 | 329 | #endif /* __egl_h_ */ 330 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Include/egl/eglplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __eglplatform_h_ 2 | #define __eglplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2007-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Platform-specific types and definitions for egl.h 28 | * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $ 29 | * 30 | * Adopters may modify khrplatform.h and this file to suit their platform. 31 | * You are encouraged to submit all modifications to the Khronos group so that 32 | * they can be included in future versions of this file. Please submit changes 33 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 34 | * by filing a bug against product "EGL" component "Registry". 35 | */ 36 | 37 | #include 38 | 39 | /* Macros used in EGL function prototype declarations. 40 | * 41 | * EGL functions should be prototyped as: 42 | * 43 | * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); 44 | * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); 45 | * 46 | * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h 47 | */ 48 | 49 | #ifndef EGLAPI 50 | #define EGLAPI KHRONOS_APICALL 51 | #endif 52 | 53 | #ifndef EGLAPIENTRY 54 | #define EGLAPIENTRY KHRONOS_APIENTRY 55 | #endif 56 | #define EGLAPIENTRYP EGLAPIENTRY* 57 | 58 | /* The types NativeDisplayType, NativeWindowType, and NativePixmapType 59 | * are aliases of window-system-dependent types, such as X Display * or 60 | * Windows Device Context. They must be defined in platform-specific 61 | * code below. The EGL-prefixed versions of Native*Type are the same 62 | * types, renamed in EGL 1.3 so all types in the API start with "EGL". 63 | */ 64 | 65 | #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ 66 | #ifndef WIN32_LEAN_AND_MEAN 67 | #define WIN32_LEAN_AND_MEAN 1 68 | #endif 69 | #include 70 | 71 | typedef HDC EGLNativeDisplayType; 72 | typedef HBITMAP EGLNativePixmapType; 73 | typedef HWND EGLNativeWindowType; 74 | 75 | #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ 76 | 77 | typedef int EGLNativeDisplayType; 78 | typedef void *EGLNativeWindowType; 79 | typedef void *EGLNativePixmapType; 80 | 81 | #elif defined(__unix__) 82 | 83 | /* X11 (tentative) */ 84 | #include 85 | #include 86 | 87 | typedef Display *EGLNativeDisplayType; 88 | typedef Pixmap EGLNativePixmapType; 89 | typedef Window EGLNativeWindowType; 90 | 91 | #else 92 | #error "Platform not recognized" 93 | #endif 94 | 95 | /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ 96 | typedef EGLNativeDisplayType NativeDisplayType; 97 | typedef EGLNativePixmapType NativePixmapType; 98 | typedef EGLNativeWindowType NativeWindowType; 99 | 100 | 101 | /* Define EGLint. This must be a signed integral type large enough to contain 102 | * all legal attribute names and values passed into and out of EGL, whether 103 | * their type is boolean, bitmask, enumerant (symbolic constant), integer, 104 | * handle, or other. While in general a 32-bit integer will suffice, if 105 | * handles are 64 bit types, then EGLint should be defined as a signed 64-bit 106 | * integer type. 107 | */ 108 | typedef khronos_int32_t EGLint; 109 | 110 | #endif /* __eglplatform_h */ 111 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Include/egl/khrplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __khrplatform_h_ 2 | #define __khrplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2008-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Khronos platform-specific types and definitions. 28 | * 29 | * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ 30 | * 31 | * Adopters may modify this file to suit their platform. Adopters are 32 | * encouraged to submit platform specific modifications to the Khronos 33 | * group so that they can be included in future versions of this file. 34 | * Please submit changes by sending them to the public Khronos Bugzilla 35 | * (http://khronos.org/bugzilla) by filing a bug against product 36 | * "Khronos (general)" component "Registry". 37 | * 38 | * A predefined template which fills in some of the bug fields can be 39 | * reached using http://tinyurl.com/khrplatform-h-bugreport, but you 40 | * must create a Bugzilla login first. 41 | * 42 | * 43 | * See the Implementer's Guidelines for information about where this file 44 | * should be located on your system and for more details of its use: 45 | * http://www.khronos.org/registry/implementers_guide.pdf 46 | * 47 | * This file should be included as 48 | * #include 49 | * by Khronos client API header files that use its types and defines. 50 | * 51 | * The types in khrplatform.h should only be used to define API-specific types. 52 | * 53 | * Types defined in khrplatform.h: 54 | * khronos_int8_t signed 8 bit 55 | * khronos_uint8_t unsigned 8 bit 56 | * khronos_int16_t signed 16 bit 57 | * khronos_uint16_t unsigned 16 bit 58 | * khronos_int32_t signed 32 bit 59 | * khronos_uint32_t unsigned 32 bit 60 | * khronos_int64_t signed 64 bit 61 | * khronos_uint64_t unsigned 64 bit 62 | * khronos_intptr_t signed same number of bits as a pointer 63 | * khronos_uintptr_t unsigned same number of bits as a pointer 64 | * khronos_ssize_t signed size 65 | * khronos_usize_t unsigned size 66 | * khronos_float_t signed 32 bit floating point 67 | * khronos_time_ns_t unsigned 64 bit time in nanoseconds 68 | * khronos_utime_nanoseconds_t unsigned time interval or absolute time in 69 | * nanoseconds 70 | * khronos_stime_nanoseconds_t signed time interval in nanoseconds 71 | * khronos_boolean_enum_t enumerated boolean type. This should 72 | * only be used as a base type when a client API's boolean type is 73 | * an enum. Client APIs which use an integer or other type for 74 | * booleans cannot use this as the base type for their boolean. 75 | * 76 | * Tokens defined in khrplatform.h: 77 | * 78 | * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. 79 | * 80 | * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. 81 | * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. 82 | * 83 | * Calling convention macros defined in this file: 84 | * KHRONOS_APICALL 85 | * KHRONOS_APIENTRY 86 | * KHRONOS_APIATTRIBUTES 87 | * 88 | * These may be used in function prototypes as: 89 | * 90 | * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( 91 | * int arg1, 92 | * int arg2) KHRONOS_APIATTRIBUTES; 93 | */ 94 | 95 | /*------------------------------------------------------------------------- 96 | * Definition of KHRONOS_APICALL 97 | *------------------------------------------------------------------------- 98 | * This precedes the return type of the function in the function prototype. 99 | */ 100 | #if defined(_WIN32) && !defined(__SCITECH_SNAP__) 101 | # if !defined (_DLL) && !defined (_LIB) 102 | # define KHRONOS_APICALL __declspec(dllimport) 103 | # else 104 | # define KHRONOS_APICALL 105 | # endif 106 | #elif defined (__SYMBIAN32__) 107 | # define KHRONOS_APICALL IMPORT_C 108 | #else 109 | # define KHRONOS_APICALL 110 | #endif 111 | 112 | /*------------------------------------------------------------------------- 113 | * Definition of KHRONOS_APIENTRY 114 | *------------------------------------------------------------------------- 115 | * This follows the return type of the function and precedes the function 116 | * name in the function prototype. 117 | */ 118 | #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) 119 | /* Win32 but not WinCE */ 120 | # define KHRONOS_APIENTRY __stdcall 121 | #else 122 | # define KHRONOS_APIENTRY 123 | #endif 124 | 125 | /*------------------------------------------------------------------------- 126 | * Definition of KHRONOS_APIATTRIBUTES 127 | *------------------------------------------------------------------------- 128 | * This follows the closing parenthesis of the function prototype arguments. 129 | */ 130 | #if defined (__ARMCC_2__) 131 | #define KHRONOS_APIATTRIBUTES __softfp 132 | #else 133 | #define KHRONOS_APIATTRIBUTES 134 | #endif 135 | 136 | /*------------------------------------------------------------------------- 137 | * basic type definitions 138 | *-----------------------------------------------------------------------*/ 139 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) 140 | 141 | 142 | /* 143 | * Using 144 | */ 145 | #include 146 | typedef int32_t khronos_int32_t; 147 | typedef uint32_t khronos_uint32_t; 148 | typedef int64_t khronos_int64_t; 149 | typedef uint64_t khronos_uint64_t; 150 | #define KHRONOS_SUPPORT_INT64 1 151 | #define KHRONOS_SUPPORT_FLOAT 1 152 | 153 | #elif defined(__VMS ) || defined(__sgi) 154 | 155 | /* 156 | * Using 157 | */ 158 | #include 159 | typedef int32_t khronos_int32_t; 160 | typedef uint32_t khronos_uint32_t; 161 | typedef int64_t khronos_int64_t; 162 | typedef uint64_t khronos_uint64_t; 163 | #define KHRONOS_SUPPORT_INT64 1 164 | #define KHRONOS_SUPPORT_FLOAT 1 165 | 166 | #elif defined(_WIN32) && !defined(__SCITECH_SNAP__) 167 | 168 | /* 169 | * Win32 170 | */ 171 | typedef __int32 khronos_int32_t; 172 | typedef unsigned __int32 khronos_uint32_t; 173 | typedef __int64 khronos_int64_t; 174 | typedef unsigned __int64 khronos_uint64_t; 175 | #define KHRONOS_SUPPORT_INT64 1 176 | #define KHRONOS_SUPPORT_FLOAT 1 177 | 178 | #elif defined(__sun__) || defined(__digital__) 179 | 180 | /* 181 | * Sun or Digital 182 | */ 183 | typedef int khronos_int32_t; 184 | typedef unsigned int khronos_uint32_t; 185 | #if defined(__arch64__) || defined(_LP64) 186 | typedef long int khronos_int64_t; 187 | typedef unsigned long int khronos_uint64_t; 188 | #else 189 | typedef long long int khronos_int64_t; 190 | typedef unsigned long long int khronos_uint64_t; 191 | #endif /* __arch64__ */ 192 | #define KHRONOS_SUPPORT_INT64 1 193 | #define KHRONOS_SUPPORT_FLOAT 1 194 | 195 | #elif 0 196 | 197 | /* 198 | * Hypothetical platform with no float or int64 support 199 | */ 200 | typedef int khronos_int32_t; 201 | typedef unsigned int khronos_uint32_t; 202 | #define KHRONOS_SUPPORT_INT64 0 203 | #define KHRONOS_SUPPORT_FLOAT 0 204 | 205 | #else 206 | 207 | /* 208 | * Generic fallback 209 | */ 210 | #include 211 | typedef int32_t khronos_int32_t; 212 | typedef uint32_t khronos_uint32_t; 213 | typedef int64_t khronos_int64_t; 214 | typedef uint64_t khronos_uint64_t; 215 | #define KHRONOS_SUPPORT_INT64 1 216 | #define KHRONOS_SUPPORT_FLOAT 1 217 | 218 | #endif 219 | 220 | 221 | /* 222 | * Types that are (so far) the same on all platforms 223 | */ 224 | typedef signed char khronos_int8_t; 225 | typedef unsigned char khronos_uint8_t; 226 | typedef signed short int khronos_int16_t; 227 | typedef unsigned short int khronos_uint16_t; 228 | typedef signed long int khronos_intptr_t; 229 | typedef unsigned long int khronos_uintptr_t; 230 | typedef signed long int khronos_ssize_t; 231 | typedef unsigned long int khronos_usize_t; 232 | 233 | #if KHRONOS_SUPPORT_FLOAT 234 | /* 235 | * Float type 236 | */ 237 | typedef float khronos_float_t; 238 | #endif 239 | 240 | #if KHRONOS_SUPPORT_INT64 241 | /* Time types 242 | * 243 | * These types can be used to represent a time interval in nanoseconds or 244 | * an absolute Unadjusted System Time. Unadjusted System Time is the number 245 | * of nanoseconds since some arbitrary system event (e.g. since the last 246 | * time the system booted). The Unadjusted System Time is an unsigned 247 | * 64 bit value that wraps back to 0 every 584 years. Time intervals 248 | * may be either signed or unsigned. 249 | */ 250 | typedef khronos_uint64_t khronos_utime_nanoseconds_t; 251 | typedef khronos_int64_t khronos_stime_nanoseconds_t; 252 | #endif 253 | 254 | /* 255 | * Dummy value used to pad enum types to 32 bits. 256 | */ 257 | #ifndef KHRONOS_MAX_ENUM 258 | #define KHRONOS_MAX_ENUM 0x7FFFFFFF 259 | #endif 260 | 261 | /* 262 | * Enumerated boolean type 263 | * 264 | * Values other than zero should be considered to be true. Therefore 265 | * comparisons should not be made against KHRONOS_TRUE. 266 | */ 267 | typedef enum { 268 | KHRONOS_FALSE = 0, 269 | KHRONOS_TRUE = 1, 270 | KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM 271 | } khronos_boolean_enum_t; 272 | 273 | #endif /* __khrplatform_h_ */ 274 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Include/gles2/gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | #include 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Include/gles2/khrplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __khrplatform_h_ 2 | #define __khrplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2008-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Khronos platform-specific types and definitions. 28 | * 29 | * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ 30 | * 31 | * Adopters may modify this file to suit their platform. Adopters are 32 | * encouraged to submit platform specific modifications to the Khronos 33 | * group so that they can be included in future versions of this file. 34 | * Please submit changes by sending them to the public Khronos Bugzilla 35 | * (http://khronos.org/bugzilla) by filing a bug against product 36 | * "Khronos (general)" component "Registry". 37 | * 38 | * A predefined template which fills in some of the bug fields can be 39 | * reached using http://tinyurl.com/khrplatform-h-bugreport, but you 40 | * must create a Bugzilla login first. 41 | * 42 | * 43 | * See the Implementer's Guidelines for information about where this file 44 | * should be located on your system and for more details of its use: 45 | * http://www.khronos.org/registry/implementers_guide.pdf 46 | * 47 | * This file should be included as 48 | * #include 49 | * by Khronos client API header files that use its types and defines. 50 | * 51 | * The types in khrplatform.h should only be used to define API-specific types. 52 | * 53 | * Types defined in khrplatform.h: 54 | * khronos_int8_t signed 8 bit 55 | * khronos_uint8_t unsigned 8 bit 56 | * khronos_int16_t signed 16 bit 57 | * khronos_uint16_t unsigned 16 bit 58 | * khronos_int32_t signed 32 bit 59 | * khronos_uint32_t unsigned 32 bit 60 | * khronos_int64_t signed 64 bit 61 | * khronos_uint64_t unsigned 64 bit 62 | * khronos_intptr_t signed same number of bits as a pointer 63 | * khronos_uintptr_t unsigned same number of bits as a pointer 64 | * khronos_ssize_t signed size 65 | * khronos_usize_t unsigned size 66 | * khronos_float_t signed 32 bit floating point 67 | * khronos_time_ns_t unsigned 64 bit time in nanoseconds 68 | * khronos_utime_nanoseconds_t unsigned time interval or absolute time in 69 | * nanoseconds 70 | * khronos_stime_nanoseconds_t signed time interval in nanoseconds 71 | * khronos_boolean_enum_t enumerated boolean type. This should 72 | * only be used as a base type when a client API's boolean type is 73 | * an enum. Client APIs which use an integer or other type for 74 | * booleans cannot use this as the base type for their boolean. 75 | * 76 | * Tokens defined in khrplatform.h: 77 | * 78 | * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. 79 | * 80 | * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. 81 | * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. 82 | * 83 | * Calling convention macros defined in this file: 84 | * KHRONOS_APICALL 85 | * KHRONOS_APIENTRY 86 | * KHRONOS_APIATTRIBUTES 87 | * 88 | * These may be used in function prototypes as: 89 | * 90 | * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( 91 | * int arg1, 92 | * int arg2) KHRONOS_APIATTRIBUTES; 93 | */ 94 | 95 | /*------------------------------------------------------------------------- 96 | * Definition of KHRONOS_APICALL 97 | *------------------------------------------------------------------------- 98 | * This precedes the return type of the function in the function prototype. 99 | */ 100 | #if defined(_WIN32) && !defined(__SCITECH_SNAP__) 101 | # if !defined (_DLL) && !defined (_LIB) 102 | # define KHRONOS_APICALL __declspec(dllimport) 103 | # else 104 | # define KHRONOS_APICALL 105 | # endif 106 | #elif defined (__SYMBIAN32__) 107 | # define KHRONOS_APICALL IMPORT_C 108 | #else 109 | # define KHRONOS_APICALL 110 | #endif 111 | 112 | /*------------------------------------------------------------------------- 113 | * Definition of KHRONOS_APIENTRY 114 | *------------------------------------------------------------------------- 115 | * This follows the return type of the function and precedes the function 116 | * name in the function prototype. 117 | */ 118 | #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) 119 | /* Win32 but not WinCE */ 120 | # define KHRONOS_APIENTRY __stdcall 121 | #else 122 | # define KHRONOS_APIENTRY 123 | #endif 124 | 125 | /*------------------------------------------------------------------------- 126 | * Definition of KHRONOS_APIATTRIBUTES 127 | *------------------------------------------------------------------------- 128 | * This follows the closing parenthesis of the function prototype arguments. 129 | */ 130 | #if defined (__ARMCC_2__) 131 | #define KHRONOS_APIATTRIBUTES __softfp 132 | #else 133 | #define KHRONOS_APIATTRIBUTES 134 | #endif 135 | 136 | /*------------------------------------------------------------------------- 137 | * basic type definitions 138 | *-----------------------------------------------------------------------*/ 139 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) 140 | 141 | 142 | /* 143 | * Using 144 | */ 145 | #include 146 | typedef int32_t khronos_int32_t; 147 | typedef uint32_t khronos_uint32_t; 148 | typedef int64_t khronos_int64_t; 149 | typedef uint64_t khronos_uint64_t; 150 | #define KHRONOS_SUPPORT_INT64 1 151 | #define KHRONOS_SUPPORT_FLOAT 1 152 | 153 | #elif defined(__VMS ) || defined(__sgi) 154 | 155 | /* 156 | * Using 157 | */ 158 | #include 159 | typedef int32_t khronos_int32_t; 160 | typedef uint32_t khronos_uint32_t; 161 | typedef int64_t khronos_int64_t; 162 | typedef uint64_t khronos_uint64_t; 163 | #define KHRONOS_SUPPORT_INT64 1 164 | #define KHRONOS_SUPPORT_FLOAT 1 165 | 166 | #elif defined(_WIN32) && !defined(__SCITECH_SNAP__) 167 | 168 | /* 169 | * Win32 170 | */ 171 | typedef __int32 khronos_int32_t; 172 | typedef unsigned __int32 khronos_uint32_t; 173 | typedef __int64 khronos_int64_t; 174 | typedef unsigned __int64 khronos_uint64_t; 175 | #define KHRONOS_SUPPORT_INT64 1 176 | #define KHRONOS_SUPPORT_FLOAT 1 177 | 178 | #elif defined(__sun__) || defined(__digital__) 179 | 180 | /* 181 | * Sun or Digital 182 | */ 183 | typedef int khronos_int32_t; 184 | typedef unsigned int khronos_uint32_t; 185 | #if defined(__arch64__) || defined(_LP64) 186 | typedef long int khronos_int64_t; 187 | typedef unsigned long int khronos_uint64_t; 188 | #else 189 | typedef long long int khronos_int64_t; 190 | typedef unsigned long long int khronos_uint64_t; 191 | #endif /* __arch64__ */ 192 | #define KHRONOS_SUPPORT_INT64 1 193 | #define KHRONOS_SUPPORT_FLOAT 1 194 | 195 | #elif 0 196 | 197 | /* 198 | * Hypothetical platform with no float or int64 support 199 | */ 200 | typedef int khronos_int32_t; 201 | typedef unsigned int khronos_uint32_t; 202 | #define KHRONOS_SUPPORT_INT64 0 203 | #define KHRONOS_SUPPORT_FLOAT 0 204 | 205 | #else 206 | 207 | /* 208 | * Generic fallback 209 | */ 210 | #include 211 | typedef int32_t khronos_int32_t; 212 | typedef uint32_t khronos_uint32_t; 213 | typedef int64_t khronos_int64_t; 214 | typedef uint64_t khronos_uint64_t; 215 | #define KHRONOS_SUPPORT_INT64 1 216 | #define KHRONOS_SUPPORT_FLOAT 1 217 | 218 | #endif 219 | 220 | 221 | /* 222 | * Types that are (so far) the same on all platforms 223 | */ 224 | typedef signed char khronos_int8_t; 225 | typedef unsigned char khronos_uint8_t; 226 | typedef signed short int khronos_int16_t; 227 | typedef unsigned short int khronos_uint16_t; 228 | typedef signed long int khronos_intptr_t; 229 | typedef unsigned long int khronos_uintptr_t; 230 | typedef signed long int khronos_ssize_t; 231 | typedef unsigned long int khronos_usize_t; 232 | 233 | #if KHRONOS_SUPPORT_FLOAT 234 | /* 235 | * Float type 236 | */ 237 | typedef float khronos_float_t; 238 | #endif 239 | 240 | #if KHRONOS_SUPPORT_INT64 241 | /* Time types 242 | * 243 | * These types can be used to represent a time interval in nanoseconds or 244 | * an absolute Unadjusted System Time. Unadjusted System Time is the number 245 | * of nanoseconds since some arbitrary system event (e.g. since the last 246 | * time the system booted). The Unadjusted System Time is an unsigned 247 | * 64 bit value that wraps back to 0 every 584 years. Time intervals 248 | * may be either signed or unsigned. 249 | */ 250 | typedef khronos_uint64_t khronos_utime_nanoseconds_t; 251 | typedef khronos_int64_t khronos_stime_nanoseconds_t; 252 | #endif 253 | 254 | /* 255 | * Dummy value used to pad enum types to 32 bits. 256 | */ 257 | #ifndef KHRONOS_MAX_ENUM 258 | #define KHRONOS_MAX_ENUM 0x7FFFFFFF 259 | #endif 260 | 261 | /* 262 | * Enumerated boolean type 263 | * 264 | * Values other than zero should be considered to be true. Therefore 265 | * comparisons should not be made against KHRONOS_TRUE. 266 | */ 267 | typedef enum { 268 | KHRONOS_FALSE = 0, 269 | KHRONOS_TRUE = 1, 270 | KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM 271 | } khronos_boolean_enum_t; 272 | 273 | #endif /* __khrplatform_h_ */ 274 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Lib/libEGL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Lib/libEGL.lib -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Lib/libGLESv2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Lib/libGLESv2.lib -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Win32EGL.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Win32EGL", "Code\Win32EGL\Win32EGL.vcxproj", "{50ECD8E5-725C-4AFF-B30A-426630C4D62E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {50ECD8E5-725C-4AFF-B30A-426630C4D62E}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {50ECD8E5-725C-4AFF-B30A-426630C4D62E}.Debug|Win32.Build.0 = Debug|Win32 16 | {50ECD8E5-725C-4AFF-B30A-426630C4D62E}.Release|Win32.ActiveCfg = Release|Win32 17 | {50ECD8E5-725C-4AFF-B30A-426630C4D62E}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /win32下EGL使用/Win32EGL/Win32EGL.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win32下EGL使用/Win32EGL/Win32EGL.v12.suo -------------------------------------------------------------------------------- /win7系统下显卡驱动未安装正确.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/win7系统下显卡驱动未安装正确.jpg -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/Bin/Debug/FreeImage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/Bin/Debug/FreeImage.dll -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/Bin/Debug/loading0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/Bin/Debug/loading0.png -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/Bin/Debug/loading1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/Bin/Debug/loading1.png -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/Bin/Debug/loading2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/Bin/Debug/loading2.png -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/depends/include/freeImage/FreeImage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/depends/include/freeImage/FreeImage.h -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/depends/lib/windows/x86/FreeImage.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/depends/lib/windows/x86/FreeImage.lib -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText.sdf -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wglText", "wglText\wglText.vcxproj", "{E5F9640C-2D08-4615-8099-1AF916278E87}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {E5F9640C-2D08-4615-8099-1AF916278E87}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {E5F9640C-2D08-4615-8099-1AF916278E87}.Debug|Win32.Build.0 = Debug|Win32 14 | {E5F9640C-2D08-4615-8099-1AF916278E87}.Release|Win32.ActiveCfg = Release|Win32 15 | {E5F9640C-2D08-4615-8099-1AF916278E87}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/CELLMath.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText/CELLMath.hpp -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/CELLShader.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText/CELLShader.hpp -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/GLContext.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText/GLContext.h -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/Thread.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText/Thread.hpp -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/Timestamp.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText/Timestamp.hpp -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下使用OpenGL/wglText/wglText/main.cpp -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/wglText.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {E5F9640C-2D08-4615-8099-1AF916278E87} 15 | Win32Proj 16 | wglText 17 | 18 | 19 | 20 | Application 21 | true 22 | MultiByte 23 | 24 | 25 | Application 26 | false 27 | true 28 | MultiByte 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | true 42 | ..\Bin\$(Configuration)\ 43 | ..\Obj\$(Configuration)\$(ProjectName) 44 | 45 | 46 | false 47 | ..\Bin\$(Configuration)\ 48 | ..\Obj\$(Configuration)\$(ProjectName) 49 | 50 | 51 | 52 | 53 | 54 | Level3 55 | Disabled 56 | GLEW_STATIC;_WIN32;__STDC_CONSTANT_MACROS;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) 57 | ../depends/include;../depends/include/glew; 58 | 59 | 60 | Windows 61 | true 62 | FreeImage.lib;OpenGL32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 63 | ../depends/lib/windows/x86 64 | 65 | 66 | 67 | 68 | Level3 69 | 70 | 71 | MaxSpeed 72 | true 73 | true 74 | GLEW_STATIC;_WIN32;__STDC_CONSTANT_MACROS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 75 | ../depends/include; 76 | 77 | 78 | Windows 79 | true 80 | true 81 | true 82 | FreeImage.lib;OpenGL32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 83 | ../depends/lib/windows/x86 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/wglText.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;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 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 35 | 36 | 源文件 37 | 38 | 39 | 源文件 40 | 41 | 42 | -------------------------------------------------------------------------------- /windows下使用OpenGL/wglText/wglText/wglText.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/Depends/Include/KHR/khrplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __khrplatform_h_ 2 | #define __khrplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2008-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Platform-specific types and definitions. 28 | * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ 29 | * 30 | * Adopters may modify this file to suit their platform. Adopters are 31 | * encouraged to submit platform specific modifications to the Khronos 32 | * group so that they can be included in future versions of this file. 33 | * Please submit changes by sending them to the public Khronos Bugzilla 34 | * (http://khronos.org/bugzilla) by filing a bug against product 35 | * "Khronos (general)" component "Registry". 36 | * 37 | * A predefined template which fills in some of the bug fields can be 38 | * reached using http://tinyurl.com/khrplatform-h-bugreport, but you 39 | * must create a Bugzilla login first. 40 | * 41 | * 42 | * See the Implementer's Guidelines for information about where this file 43 | * should be located on your system. 44 | * http://www.khronos.org/registry/implementers_guide.pdf 45 | * 46 | * 47 | * This file should be included as 48 | * #include 49 | * by the Khronos API header file that uses its types and defines. 50 | * 51 | * The types in this file should only be used to define API-specific types. 52 | * Types defined in this file: 53 | * khronos_int8_t signed 8 bit 54 | * khronos_uint8_t unsigned 8 bit 55 | * khronos_int16_t signed 16 bit 56 | * khronos_uint16_t unsigned 16 bit 57 | * khronos_int32_t signed 32 bit 58 | * khronos_uint32_t unsigned 32 bit 59 | * khronos_int64_t signed 64 bit 60 | * khronos_uint64_t unsigned 64 bit 61 | * khronos_intptr_t signed same number of bits as a pointer 62 | * khronos_uintptr_t unsigned same number of bits as a pointer 63 | * khronos_ssize_t signed size 64 | * khronos_usize_t unsigned size 65 | * khronos_float_t signed 32 bit floating point 66 | * khronos_time_ns_t unsigned 64 bit time in nanoseconds 67 | * khronos_utime_nanoseconds_t unsigned time interval or absolute time in 68 | * nanoseconds 69 | * khronos_stime_nanoseconds_t signed time interval in nanoseconds 70 | * 71 | * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. 72 | * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. 73 | * 74 | * 75 | * Macros defined in this file: 76 | * KHRONOS_APICALL 77 | * KHRONOS_APIENTRY 78 | * KHRONOS_APIATTRIBUTES 79 | * These may be used in function prototypes as: 80 | * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( 81 | * int arg1, 82 | * int arg2) KHRONOS_APIATTRIBUTES; 83 | */ 84 | 85 | /*------------------------------------------------------------------------- 86 | * Definition of KHRONOS_APICALL 87 | *------------------------------------------------------------------------- 88 | * This precedes the return type of the function in the function prototype. 89 | */ 90 | #if defined(_WIN32) && !defined(__SCITECH_SNAP__) 91 | # define KHRONOS_APICALL __declspec(dllimport) 92 | #elif defined (__SYMBIAN32__) 93 | # define KHRONOS_APICALL IMPORT_C 94 | #elif defined(__ANDROID__) 95 | # include 96 | # define KHRONOS_APICALL __attribute__((visibility("default"))) __NDK_FPABI__ 97 | #else 98 | # define KHRONOS_APICALL 99 | #endif 100 | 101 | /*------------------------------------------------------------------------- 102 | * Definition of KHRONOS_APIENTRY 103 | *------------------------------------------------------------------------- 104 | * This follows the return type of the function and precedes the function 105 | * name in the function prototype. 106 | */ 107 | #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) 108 | /* Win32 but not WinCE */ 109 | # define KHRONOS_APIENTRY __stdcall 110 | #else 111 | # define KHRONOS_APIENTRY 112 | #endif 113 | 114 | /*------------------------------------------------------------------------- 115 | * Definition of KHRONOS_APIATTRIBUTES 116 | *------------------------------------------------------------------------- 117 | * This follows the closing parenthesis of the function prototype arguments. 118 | */ 119 | #if defined (__ARMCC_2__) 120 | #define KHRONOS_APIATTRIBUTES __softfp 121 | #else 122 | #define KHRONOS_APIATTRIBUTES 123 | #endif 124 | 125 | /*------------------------------------------------------------------------- 126 | * basic type definitions 127 | *-----------------------------------------------------------------------*/ 128 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) 129 | 130 | 131 | /* 132 | * Using 133 | */ 134 | #include 135 | typedef int32_t khronos_int32_t; 136 | typedef uint32_t khronos_uint32_t; 137 | typedef int64_t khronos_int64_t; 138 | typedef uint64_t khronos_uint64_t; 139 | #define KHRONOS_SUPPORT_INT64 1 140 | #define KHRONOS_SUPPORT_FLOAT 1 141 | 142 | #elif defined(__VMS ) || defined(__sgi) 143 | 144 | /* 145 | * Using 146 | */ 147 | #include 148 | typedef int32_t khronos_int32_t; 149 | typedef uint32_t khronos_uint32_t; 150 | typedef int64_t khronos_int64_t; 151 | typedef uint64_t khronos_uint64_t; 152 | #define KHRONOS_SUPPORT_INT64 1 153 | #define KHRONOS_SUPPORT_FLOAT 1 154 | 155 | #elif defined(_WIN32) && !defined(__SCITECH_SNAP__) 156 | 157 | /* 158 | * Win32 159 | */ 160 | typedef __int32 khronos_int32_t; 161 | typedef unsigned __int32 khronos_uint32_t; 162 | typedef __int64 khronos_int64_t; 163 | typedef unsigned __int64 khronos_uint64_t; 164 | #define KHRONOS_SUPPORT_INT64 1 165 | #define KHRONOS_SUPPORT_FLOAT 1 166 | 167 | #elif defined(__sun__) || defined(__digital__) 168 | 169 | /* 170 | * Sun or Digital 171 | */ 172 | typedef int khronos_int32_t; 173 | typedef unsigned int khronos_uint32_t; 174 | #if defined(__arch64__) || defined(_LP64) 175 | typedef long int khronos_int64_t; 176 | typedef unsigned long int khronos_uint64_t; 177 | #else 178 | typedef long long int khronos_int64_t; 179 | typedef unsigned long long int khronos_uint64_t; 180 | #endif /* __arch64__ */ 181 | #define KHRONOS_SUPPORT_INT64 1 182 | #define KHRONOS_SUPPORT_FLOAT 1 183 | 184 | #elif 0 185 | 186 | /* 187 | * Hypothetical platform with no float or int64 support 188 | */ 189 | typedef int khronos_int32_t; 190 | typedef unsigned int khronos_uint32_t; 191 | #define KHRONOS_SUPPORT_INT64 0 192 | #define KHRONOS_SUPPORT_FLOAT 0 193 | 194 | #else 195 | 196 | /* 197 | * Generic fallback 198 | */ 199 | #include 200 | typedef int32_t khronos_int32_t; 201 | typedef uint32_t khronos_uint32_t; 202 | typedef int64_t khronos_int64_t; 203 | typedef uint64_t khronos_uint64_t; 204 | #define KHRONOS_SUPPORT_INT64 1 205 | #define KHRONOS_SUPPORT_FLOAT 1 206 | 207 | #endif 208 | 209 | 210 | /* 211 | * Types that are (so far) the same on all platforms 212 | */ 213 | typedef signed char khronos_int8_t; 214 | typedef unsigned char khronos_uint8_t; 215 | typedef signed short int khronos_int16_t; 216 | typedef unsigned short int khronos_uint16_t; 217 | typedef signed long int khronos_intptr_t; 218 | typedef unsigned long int khronos_uintptr_t; 219 | typedef signed long int khronos_ssize_t; 220 | typedef unsigned long int khronos_usize_t; 221 | 222 | #if KHRONOS_SUPPORT_FLOAT 223 | /* 224 | * Float type 225 | */ 226 | typedef float khronos_float_t; 227 | #endif 228 | 229 | #if KHRONOS_SUPPORT_INT64 230 | /* Time types 231 | * 232 | * These types can be used to represent a time interval in nanoseconds or 233 | * an absolute Unadjusted System Time. Unadjusted System Time is the number 234 | * of nanoseconds since some arbitrary system event (e.g. since the last 235 | * time the system booted). The Unadjusted System Time is an unsigned 236 | * 64 bit value that wraps back to 0 every 584 years. Time intervals 237 | * may be either signed or unsigned. 238 | */ 239 | typedef khronos_uint64_t khronos_utime_nanoseconds_t; 240 | typedef khronos_int64_t khronos_stime_nanoseconds_t; 241 | #endif 242 | 243 | 244 | #endif /* __khrplatform_h_ */ 245 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/Depends/Include/egl/egl.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; tab-width: 8; -*- */ 2 | /* vi: set sw=4 ts=8: */ 3 | /* Reference version of egl.h for EGL 1.4. 4 | * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ 5 | */ 6 | 7 | /* 8 | ** Copyright (c) 2007-2009 The Khronos Group Inc. 9 | ** 10 | ** Permission is hereby granted, free of charge, to any person obtaining a 11 | ** copy of this software and/or associated documentation files (the 12 | ** "Materials"), to deal in the Materials without restriction, including 13 | ** without limitation the rights to use, copy, modify, merge, publish, 14 | ** distribute, sublicense, and/or sell copies of the Materials, and to 15 | ** permit persons to whom the Materials are furnished to do so, subject to 16 | ** the following conditions: 17 | ** 18 | ** The above copyright notice and this permission notice shall be included 19 | ** in all copies or substantial portions of the Materials. 20 | ** 21 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 25 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 28 | */ 29 | 30 | #ifndef __egl_h_ 31 | #define __egl_h_ 32 | 33 | /* All platform-dependent types and macro boilerplate (such as EGLAPI 34 | * and EGLAPIENTRY) should go in eglplatform.h. 35 | */ 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* EGL Types */ 43 | /* EGLint is defined in eglplatform.h */ 44 | typedef unsigned int EGLBoolean; 45 | typedef unsigned int EGLenum; 46 | typedef void *EGLConfig; 47 | typedef void *EGLContext; 48 | typedef void *EGLDisplay; 49 | typedef void *EGLSurface; 50 | typedef void *EGLClientBuffer; 51 | 52 | /* EGL Versioning */ 53 | #define EGL_VERSION_1_0 1 54 | #define EGL_VERSION_1_1 1 55 | #define EGL_VERSION_1_2 1 56 | #define EGL_VERSION_1_3 1 57 | #define EGL_VERSION_1_4 1 58 | 59 | /* EGL Enumerants. Bitmasks and other exceptional cases aside, most 60 | * enums are assigned unique values starting at 0x3000. 61 | */ 62 | 63 | /* EGL aliases */ 64 | #define EGL_FALSE 0 65 | #define EGL_TRUE 1 66 | 67 | /* Out-of-band handle values */ 68 | #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) 69 | #define EGL_NO_CONTEXT ((EGLContext)0) 70 | #define EGL_NO_DISPLAY ((EGLDisplay)0) 71 | #define EGL_NO_SURFACE ((EGLSurface)0) 72 | 73 | /* Out-of-band attribute value */ 74 | #define EGL_DONT_CARE ((EGLint)-1) 75 | 76 | /* Errors / GetError return values */ 77 | #define EGL_SUCCESS 0x3000 78 | #define EGL_NOT_INITIALIZED 0x3001 79 | #define EGL_BAD_ACCESS 0x3002 80 | #define EGL_BAD_ALLOC 0x3003 81 | #define EGL_BAD_ATTRIBUTE 0x3004 82 | #define EGL_BAD_CONFIG 0x3005 83 | #define EGL_BAD_CONTEXT 0x3006 84 | #define EGL_BAD_CURRENT_SURFACE 0x3007 85 | #define EGL_BAD_DISPLAY 0x3008 86 | #define EGL_BAD_MATCH 0x3009 87 | #define EGL_BAD_NATIVE_PIXMAP 0x300A 88 | #define EGL_BAD_NATIVE_WINDOW 0x300B 89 | #define EGL_BAD_PARAMETER 0x300C 90 | #define EGL_BAD_SURFACE 0x300D 91 | #define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ 92 | 93 | /* Reserved 0x300F-0x301F for additional errors */ 94 | 95 | /* Config attributes */ 96 | #define EGL_BUFFER_SIZE 0x3020 97 | #define EGL_ALPHA_SIZE 0x3021 98 | #define EGL_BLUE_SIZE 0x3022 99 | #define EGL_GREEN_SIZE 0x3023 100 | #define EGL_RED_SIZE 0x3024 101 | #define EGL_DEPTH_SIZE 0x3025 102 | #define EGL_STENCIL_SIZE 0x3026 103 | #define EGL_CONFIG_CAVEAT 0x3027 104 | #define EGL_CONFIG_ID 0x3028 105 | #define EGL_LEVEL 0x3029 106 | #define EGL_MAX_PBUFFER_HEIGHT 0x302A 107 | #define EGL_MAX_PBUFFER_PIXELS 0x302B 108 | #define EGL_MAX_PBUFFER_WIDTH 0x302C 109 | #define EGL_NATIVE_RENDERABLE 0x302D 110 | #define EGL_NATIVE_VISUAL_ID 0x302E 111 | #define EGL_NATIVE_VISUAL_TYPE 0x302F 112 | #define EGL_SAMPLES 0x3031 113 | #define EGL_SAMPLE_BUFFERS 0x3032 114 | #define EGL_SURFACE_TYPE 0x3033 115 | #define EGL_TRANSPARENT_TYPE 0x3034 116 | #define EGL_TRANSPARENT_BLUE_VALUE 0x3035 117 | #define EGL_TRANSPARENT_GREEN_VALUE 0x3036 118 | #define EGL_TRANSPARENT_RED_VALUE 0x3037 119 | #define EGL_NONE 0x3038 /* Attrib list terminator */ 120 | #define EGL_BIND_TO_TEXTURE_RGB 0x3039 121 | #define EGL_BIND_TO_TEXTURE_RGBA 0x303A 122 | #define EGL_MIN_SWAP_INTERVAL 0x303B 123 | #define EGL_MAX_SWAP_INTERVAL 0x303C 124 | #define EGL_LUMINANCE_SIZE 0x303D 125 | #define EGL_ALPHA_MASK_SIZE 0x303E 126 | #define EGL_COLOR_BUFFER_TYPE 0x303F 127 | #define EGL_RENDERABLE_TYPE 0x3040 128 | #define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ 129 | #define EGL_CONFORMANT 0x3042 130 | 131 | /* Reserved 0x3041-0x304F for additional config attributes */ 132 | 133 | /* Config attribute values */ 134 | #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ 135 | #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ 136 | #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ 137 | #define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ 138 | #define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ 139 | 140 | /* More config attribute values, for EGL_TEXTURE_FORMAT */ 141 | #define EGL_NO_TEXTURE 0x305C 142 | #define EGL_TEXTURE_RGB 0x305D 143 | #define EGL_TEXTURE_RGBA 0x305E 144 | #define EGL_TEXTURE_2D 0x305F 145 | 146 | /* Config attribute mask bits */ 147 | #define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ 148 | #define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ 149 | #define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ 150 | #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ 151 | #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ 152 | #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ 153 | #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ 154 | 155 | #define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ 156 | #define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ 157 | #define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ 158 | #define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ 159 | 160 | /* QueryString targets */ 161 | #define EGL_VENDOR 0x3053 162 | #define EGL_VERSION 0x3054 163 | #define EGL_EXTENSIONS 0x3055 164 | #define EGL_CLIENT_APIS 0x308D 165 | 166 | /* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ 167 | #define EGL_HEIGHT 0x3056 168 | #define EGL_WIDTH 0x3057 169 | #define EGL_LARGEST_PBUFFER 0x3058 170 | #define EGL_TEXTURE_FORMAT 0x3080 171 | #define EGL_TEXTURE_TARGET 0x3081 172 | #define EGL_MIPMAP_TEXTURE 0x3082 173 | #define EGL_MIPMAP_LEVEL 0x3083 174 | #define EGL_RENDER_BUFFER 0x3086 175 | #define EGL_VG_COLORSPACE 0x3087 176 | #define EGL_VG_ALPHA_FORMAT 0x3088 177 | #define EGL_HORIZONTAL_RESOLUTION 0x3090 178 | #define EGL_VERTICAL_RESOLUTION 0x3091 179 | #define EGL_PIXEL_ASPECT_RATIO 0x3092 180 | #define EGL_SWAP_BEHAVIOR 0x3093 181 | #define EGL_MULTISAMPLE_RESOLVE 0x3099 182 | 183 | /* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ 184 | #define EGL_BACK_BUFFER 0x3084 185 | #define EGL_SINGLE_BUFFER 0x3085 186 | 187 | /* OpenVG color spaces */ 188 | #define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ 189 | #define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ 190 | 191 | /* OpenVG alpha formats */ 192 | #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ 193 | #define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ 194 | 195 | /* Constant scale factor by which fractional display resolutions & 196 | * aspect ratio are scaled when queried as integer values. 197 | */ 198 | #define EGL_DISPLAY_SCALING 10000 199 | 200 | /* Unknown display resolution/aspect ratio */ 201 | #define EGL_UNKNOWN ((EGLint)-1) 202 | 203 | /* Back buffer swap behaviors */ 204 | #define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ 205 | #define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ 206 | 207 | /* CreatePbufferFromClientBuffer buffer types */ 208 | #define EGL_OPENVG_IMAGE 0x3096 209 | 210 | /* QueryContext targets */ 211 | #define EGL_CONTEXT_CLIENT_TYPE 0x3097 212 | 213 | /* CreateContext attributes */ 214 | #define EGL_CONTEXT_CLIENT_VERSION 0x3098 215 | 216 | /* Multisample resolution behaviors */ 217 | #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ 218 | #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ 219 | 220 | /* BindAPI/QueryAPI targets */ 221 | #define EGL_OPENGL_ES_API 0x30A0 222 | #define EGL_OPENVG_API 0x30A1 223 | #define EGL_OPENGL_API 0x30A2 224 | 225 | /* GetCurrentSurface targets */ 226 | #define EGL_DRAW 0x3059 227 | #define EGL_READ 0x305A 228 | 229 | /* WaitNative engines */ 230 | #define EGL_CORE_NATIVE_ENGINE 0x305B 231 | 232 | /* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ 233 | #define EGL_COLORSPACE EGL_VG_COLORSPACE 234 | #define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT 235 | #define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB 236 | #define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR 237 | #define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE 238 | #define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE 239 | 240 | /* EGL extensions must request enum blocks from the Khronos 241 | * API Registrar, who maintains the enumerant registry. Submit 242 | * a bug in Khronos Bugzilla against task "Registry". 243 | */ 244 | 245 | 246 | 247 | /* EGL Functions */ 248 | 249 | EGLAPI EGLint EGLAPIENTRY eglGetError(void); 250 | 251 | EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); 252 | EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); 253 | EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); 254 | 255 | EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); 256 | 257 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, 258 | EGLint config_size, EGLint *num_config); 259 | EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, 260 | EGLConfig *configs, EGLint config_size, 261 | EGLint *num_config); 262 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, 263 | EGLint attribute, EGLint *value); 264 | 265 | EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, 266 | EGLNativeWindowType win, 267 | const EGLint *attrib_list); 268 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, 269 | const EGLint *attrib_list); 270 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, 271 | EGLNativePixmapType pixmap, 272 | const EGLint *attrib_list); 273 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); 274 | EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, 275 | EGLint attribute, EGLint *value); 276 | 277 | EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); 278 | EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); 279 | 280 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); 281 | 282 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); 283 | 284 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( 285 | EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, 286 | EGLConfig config, const EGLint *attrib_list); 287 | 288 | EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, 289 | EGLint attribute, EGLint value); 290 | EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 291 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 292 | 293 | 294 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); 295 | 296 | 297 | EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, 298 | EGLContext share_context, 299 | const EGLint *attrib_list); 300 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); 301 | EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, 302 | EGLSurface read, EGLContext ctx); 303 | 304 | EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); 305 | EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); 306 | EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); 307 | EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, 308 | EGLint attribute, EGLint *value); 309 | 310 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); 311 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); 312 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); 313 | EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, 314 | EGLNativePixmapType target); 315 | 316 | /* This is a generic function pointer type, whose name indicates it must 317 | * be cast to the proper type *and calling convention* before use. 318 | */ 319 | typedef void (*__eglMustCastToProperFunctionPointerType)(void); 320 | 321 | /* Now, define eglGetProcAddress using the generic function ptr. type */ 322 | EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY 323 | eglGetProcAddress(const char *procname); 324 | 325 | #ifdef __cplusplus 326 | } 327 | #endif 328 | 329 | #endif /* __egl_h_ */ 330 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/Depends/Include/egl/eglplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __eglplatform_h_ 2 | #define __eglplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2007-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Platform-specific types and definitions for egl.h 28 | * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $ 29 | * 30 | * Adopters may modify khrplatform.h and this file to suit their platform. 31 | * You are encouraged to submit all modifications to the Khronos group so that 32 | * they can be included in future versions of this file. Please submit changes 33 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 34 | * by filing a bug against product "EGL" component "Registry". 35 | */ 36 | 37 | #include 38 | 39 | /* Macros used in EGL function prototype declarations. 40 | * 41 | * EGL functions should be prototyped as: 42 | * 43 | * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); 44 | * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); 45 | * 46 | * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h 47 | */ 48 | 49 | #ifndef EGLAPI 50 | #define EGLAPI KHRONOS_APICALL 51 | #endif 52 | 53 | #ifndef EGLAPIENTRY 54 | #define EGLAPIENTRY KHRONOS_APIENTRY 55 | #endif 56 | #define EGLAPIENTRYP EGLAPIENTRY* 57 | 58 | /* The types NativeDisplayType, NativeWindowType, and NativePixmapType 59 | * are aliases of window-system-dependent types, such as X Display * or 60 | * Windows Device Context. They must be defined in platform-specific 61 | * code below. The EGL-prefixed versions of Native*Type are the same 62 | * types, renamed in EGL 1.3 so all types in the API start with "EGL". 63 | */ 64 | 65 | #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ 66 | #ifndef WIN32_LEAN_AND_MEAN 67 | #define WIN32_LEAN_AND_MEAN 1 68 | #endif 69 | #include 70 | 71 | typedef HDC EGLNativeDisplayType; 72 | typedef HBITMAP EGLNativePixmapType; 73 | typedef HWND EGLNativeWindowType; 74 | 75 | #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ 76 | 77 | typedef int EGLNativeDisplayType; 78 | typedef void *EGLNativeWindowType; 79 | typedef void *EGLNativePixmapType; 80 | 81 | #elif defined(__unix__) 82 | 83 | /* X11 (tentative) */ 84 | #include 85 | #include 86 | 87 | typedef Display *EGLNativeDisplayType; 88 | typedef Pixmap EGLNativePixmapType; 89 | typedef Window EGLNativeWindowType; 90 | 91 | #else 92 | #error "Platform not recognized" 93 | #endif 94 | 95 | /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ 96 | typedef EGLNativeDisplayType NativeDisplayType; 97 | typedef EGLNativePixmapType NativePixmapType; 98 | typedef EGLNativeWindowType NativeWindowType; 99 | 100 | 101 | /* Define EGLint. This must be a signed integral type large enough to contain 102 | * all legal attribute names and values passed into and out of EGL, whether 103 | * their type is boolean, bitmask, enumerant (symbolic constant), integer, 104 | * handle, or other. While in general a 32-bit integer will suffice, if 105 | * handles are 64 bit types, then EGLint should be defined as a signed 64-bit 106 | * integer type. 107 | */ 108 | typedef khronos_int32_t EGLint; 109 | 110 | #endif /* __eglplatform_h */ 111 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/Depends/Include/freeImage/FreeImage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/Depends/Include/freeImage/FreeImage.h -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/Depends/Include/gles2/gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | #include 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/Depends/Lib/windows/x86/FreeImage.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/Depends/Lib/windows/x86/FreeImage.lib -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/README.md: -------------------------------------------------------------------------------- 1 | - # windows下无lib时调用OpenGLES2.0的接口 2 | 3 | ```c++ 4 | 5 | //1、加载dll 6 | HINSTANCE hDll_EGL; 7 | HINSTANCE hDll_GLES; 8 | hDll_EGL=LoadLibrary(L"libEGL.dll"); 9 | hDll_GLES=LoadLibrary(L"libGLESv2.dll"); 10 | 11 | //2、定义函数指针 12 | typedef void (GL_APIENTRY* fun_glUseProgram) (GLuint program); 13 | 14 | 15 | //3、定义函数实现 16 | void GL_APIENTRY call_glUseProgram(GLuint program) 17 | { 18 | fun_glUseProgram function = (fun_glUseProgram)GetProcAddress(m_hDll_GLES, "glUseProgram"); 19 | function(program); 20 | } 21 | 22 | //4、调用封装的函数   23 |  调用 call_glUseProgram()函数即可 24 | ``` 25 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/bin/Debug/FreeImage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/bin/Debug/FreeImage.dll -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/bin/Debug/d3dcompiler_43.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/bin/Debug/d3dcompiler_43.dll -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/bin/Debug/d3dcompiler_46.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/bin/Debug/d3dcompiler_46.dll -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/bin/Debug/libEGL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/bin/Debug/libEGL.dll -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/bin/Debug/libGLESv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/bin/Debug/libGLESv2.dll -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/bin/Debug/main.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/bin/Debug/main.jpg -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp.sdf -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testXp", "testXp\testXp.vcxproj", "{22C70E54-14B0-4147-B3A6-04A110E09449}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {22C70E54-14B0-4147-B3A6-04A110E09449}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {22C70E54-14B0-4147-B3A6-04A110E09449}.Debug|Win32.Build.0 = Debug|Win32 14 | {22C70E54-14B0-4147-B3A6-04A110E09449}.Release|Win32.ActiveCfg = Release|Win32 15 | {22C70E54-14B0-4147-B3A6-04A110E09449}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/CELLMath.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/CELLMath.hpp -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/CELLShader.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/CELLShader.hpp -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/CELLWinApp.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/CELLWinApp.hpp -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/CGLESAdapter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "egl/egl.h" 3 | 4 | typedef void (GL_APIENTRY* fun_glUseProgram) (GLuint program); 5 | typedef int (GL_APIENTRY* fun_glGetUniformLocation) (GLuint program, const GLchar* name); 6 | typedef int (GL_APIENTRY* fun_glGetAttribLocation) (GLuint program, const GLchar* name); 7 | typedef void (GL_APIENTRY* fun_glDeleteProgram) (GLuint program); 8 | typedef void (GL_APIENTRY* fun_glDeleteShader) (GLuint shader); 9 | typedef void (GL_APIENTRY* fun_glGetProgramInfoLog) (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); 10 | typedef void (GL_APIENTRY* fun_glGetProgramiv) (GLuint program, GLenum pname, GLint* params); 11 | typedef void (GL_APIENTRY* fun_glLinkProgram) (GLuint program); 12 | typedef void (GL_APIENTRY* fun_glAttachShader) (GLuint program, GLuint shader); 13 | typedef GLuint (GL_APIENTRY* fun_glCreateProgram) (void); 14 | typedef void (GL_APIENTRY* fun_glGetShaderInfoLog) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); 15 | typedef void (GL_APIENTRY* fun_glGetShaderiv) (GLuint shader, GLenum pname, GLint* params); 16 | typedef void (GL_APIENTRY* fun_glCompileShader) (GLuint shader); 17 | typedef void (GL_APIENTRY* fun_glShaderSource) (GLuint shader, GLsizei count, const GLchar** string, const GLint* length); 18 | typedef GLuint (GL_APIENTRY* fun_glCreateShader) (GLenum type); 19 | typedef void (GL_APIENTRY* fun_glEnableVertexAttribArray) (GLuint index); 20 | typedef void (GL_APIENTRY* fun_glDisableVertexAttribArray) (GLuint index); 21 | typedef void (GL_APIENTRY* fun_glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); 22 | typedef void (GL_APIENTRY* fun_glTexParameteri) (GLenum target, GLenum pname, GLint param); 23 | typedef void (GL_APIENTRY* fun_glBindTexture) (GLenum target, GLuint texture); 24 | typedef void (GL_APIENTRY* fun_glGenTextures) (GLsizei n, GLuint* textures); 25 | typedef void (GL_APIENTRY* fun_glDrawArrays) (GLenum mode, GLint first, GLsizei count); 26 | typedef void (GL_APIENTRY* fun_glVertexAttribPointer) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); 27 | typedef void (GL_APIENTRY* fun_glUniform1i) (GLint location, GLint x); 28 | typedef void (GL_APIENTRY* fun_glUniformMatrix4fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 29 | typedef void (GL_APIENTRY* fun_glViewport) (GLint x, GLint y, GLsizei width, GLsizei height); 30 | typedef void (GL_APIENTRY* fun_glClear) (GLbitfield mask); 31 | typedef void (GL_APIENTRY* fun_glUniform4f) (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 32 | 33 | typedef EGLBoolean (EGLAPIENTRY* fun_eglSwapBuffers)(EGLDisplay dpy, EGLSurface surface); 34 | typedef EGLBoolean (EGLAPIENTRY* fun_eglQuerySurface)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); 35 | typedef EGLBoolean (EGLAPIENTRY* fun_eglMakeCurrent)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); 36 | typedef EGLContext (EGLAPIENTRY* fun_eglCreateContext)(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); 37 | typedef EGLSurface (EGLAPIENTRY* fun_eglCreateWindowSurface)(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); 38 | typedef EGLBoolean (EGLAPIENTRY* fun_eglGetConfigAttrib)(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); 39 | typedef EGLBoolean (EGLAPIENTRY* fun_eglChooseConfig)(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); 40 | typedef EGLBoolean (EGLAPIENTRY* fun_eglInitialize)(EGLDisplay dpy, EGLint *major, EGLint *minor); 41 | typedef EGLDisplay (EGLAPIENTRY* fun_eglGetDisplay)(EGLNativeDisplayType display_id); 42 | typedef EGLBoolean (EGLAPIENTRY* fun_eglTerminate)(EGLDisplay dpy); 43 | typedef EGLBoolean (EGLAPIENTRY* fun_eglDestroySurface)(EGLDisplay dpy, EGLSurface surface); 44 | typedef EGLBoolean (EGLAPIENTRY* fun_eglDestroyContext)(EGLDisplay dpy, EGLContext ctx); 45 | 46 | 47 | class GLESAdapter 48 | { 49 | public: 50 | static GLESAdapter* Instance() 51 | { 52 | static GLESAdapter instance; 53 | return &instance; 54 | } 55 | 56 | void SetHinstance( HINSTANCE hDll_EGL, HINSTANCE hDll_GLES) 57 | { 58 | m_hDll_EGL = hDll_EGL; 59 | m_hDll_GLES = hDll_GLES; 60 | } 61 | 62 | void GL_APIENTRY call_glUseProgram(GLuint program) 63 | { 64 | fun_glUseProgram function = (fun_glUseProgram)GetProcAddress(m_hDll_GLES, "glUseProgram"); 65 | function(program); 66 | } 67 | int GL_APIENTRY call_glGetUniformLocation(GLuint program, const GLchar* name) 68 | { 69 | fun_glGetUniformLocation function = (fun_glGetUniformLocation)GetProcAddress(m_hDll_GLES, "glGetUniformLocation"); 70 | return function(program, name); 71 | } 72 | int GL_APIENTRY call_glGetAttribLocation(GLuint program, const GLchar* name) 73 | { 74 | fun_glGetAttribLocation function = (fun_glGetAttribLocation)GetProcAddress(m_hDll_GLES, "glGetAttribLocation"); 75 | return function(program, name); 76 | } 77 | void GL_APIENTRY call_glDeleteProgram(GLuint program) 78 | { 79 | fun_glDeleteProgram function = (fun_glDeleteProgram)GetProcAddress(m_hDll_GLES, "glDeleteProgram"); 80 | function(program); 81 | } 82 | void GL_APIENTRY call_glDeleteShader(GLuint shader) 83 | { 84 | fun_glDeleteShader function = (fun_glDeleteShader)GetProcAddress(m_hDll_GLES, "glDeleteShader"); 85 | function(shader); 86 | } 87 | void GL_APIENTRY call_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) 88 | { 89 | fun_glGetProgramInfoLog function = (fun_glGetProgramInfoLog)GetProcAddress(m_hDll_GLES, "glGetProgramInfoLog"); 90 | function(program, bufsize, length, infolog); 91 | } 92 | void GL_APIENTRY call_glGetProgramiv(GLuint program, GLenum pname, GLint* params) 93 | { 94 | fun_glGetProgramiv function = (fun_glGetProgramiv)GetProcAddress(m_hDll_GLES, "glGetProgramiv"); 95 | function(program, pname, params); 96 | } 97 | void GL_APIENTRY call_glLinkProgram(GLuint program) 98 | { 99 | fun_glLinkProgram function = (fun_glLinkProgram)GetProcAddress(m_hDll_GLES, "glLinkProgram"); 100 | function(program); 101 | } 102 | void GL_APIENTRY call_glAttachShader(GLuint program, GLuint shader) 103 | { 104 | fun_glAttachShader function = (fun_glAttachShader)GetProcAddress(m_hDll_GLES, "glAttachShader"); 105 | function(program, shader); 106 | } 107 | GLuint GL_APIENTRY call_glCreateProgram(void) 108 | { 109 | fun_glCreateProgram function = (fun_glCreateProgram)GetProcAddress(m_hDll_GLES, "glCreateProgram"); 110 | return function(); 111 | } 112 | void GL_APIENTRY call_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) 113 | { 114 | fun_glGetShaderInfoLog function = (fun_glGetShaderInfoLog)GetProcAddress(m_hDll_GLES, "glGetShaderInfoLog"); 115 | function(shader, bufsize, length, infolog); 116 | } 117 | void GL_APIENTRY call_glGetShaderiv(GLuint shader, GLenum pname, GLint* params) 118 | { 119 | fun_glGetShaderiv function = (fun_glGetShaderiv)GetProcAddress(m_hDll_GLES, "glGetShaderiv"); 120 | function(shader, pname, params); 121 | } 122 | void GL_APIENTRY call_glCompileShader(GLuint shader) 123 | { 124 | fun_glCompileShader function = (fun_glCompileShader)GetProcAddress(m_hDll_GLES, "glCompileShader"); 125 | function(shader); 126 | } 127 | void GL_APIENTRY call_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) 128 | { 129 | fun_glShaderSource function = (fun_glShaderSource)GetProcAddress(m_hDll_GLES, "glShaderSource"); 130 | function(shader, count, string, length); 131 | } 132 | GLuint GL_APIENTRY call_glCreateShader(GLenum type) 133 | { 134 | fun_glCreateShader function = (fun_glCreateShader)GetProcAddress(m_hDll_GLES, "glCreateShader"); 135 | return function(type); 136 | } 137 | void GL_APIENTRY call_glEnableVertexAttribArray(GLuint index) 138 | { 139 | fun_glEnableVertexAttribArray function = (fun_glEnableVertexAttribArray)GetProcAddress(m_hDll_GLES, "glEnableVertexAttribArray"); 140 | function(index); 141 | } 142 | void GL_APIENTRY call_glDisableVertexAttribArray(GLuint index) 143 | { 144 | fun_glDisableVertexAttribArray function = (fun_glDisableVertexAttribArray)GetProcAddress(m_hDll_GLES, "glDisableVertexAttribArray"); 145 | function(index); 146 | } 147 | void GL_APIENTRY call_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) 148 | { 149 | fun_glTexImage2D function = (fun_glTexImage2D)GetProcAddress(m_hDll_GLES, "glTexImage2D"); 150 | function(target, level, internalformat, width, height, border, format, type, pixels); 151 | } 152 | void GL_APIENTRY call_glTexParameteri(GLenum target, GLenum pname, GLint param) 153 | { 154 | fun_glTexParameteri function = (fun_glTexParameteri)GetProcAddress(m_hDll_GLES, "glTexParameteri"); 155 | function(target, pname, param); 156 | } 157 | void GL_APIENTRY call_glBindTexture(GLenum target, GLuint texture) 158 | { 159 | fun_glBindTexture function = (fun_glBindTexture)GetProcAddress(m_hDll_GLES, "glBindTexture"); 160 | function(target, texture); 161 | } 162 | void GL_APIENTRY call_glGenTextures(GLsizei n, GLuint* textures) 163 | { 164 | fun_glGenTextures function = (fun_glGenTextures)GetProcAddress(m_hDll_GLES, "glGenTextures"); 165 | function(n, textures); 166 | } 167 | void GL_APIENTRY call_glDrawArrays(GLenum mode, GLint first, GLsizei count) 168 | { 169 | fun_glDrawArrays function = (fun_glDrawArrays)GetProcAddress(m_hDll_GLES, "glDrawArrays"); 170 | function(mode, first, count); 171 | } 172 | void GL_APIENTRY call_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) 173 | { 174 | fun_glVertexAttribPointer function = (fun_glVertexAttribPointer)GetProcAddress(m_hDll_GLES, "glVertexAttribPointer"); 175 | function(indx, size, type, normalized, stride, ptr); 176 | } 177 | void GL_APIENTRY call_glUniform1i(GLint location, GLint x) 178 | { 179 | fun_glUniform1i function = (fun_glUniform1i)GetProcAddress(m_hDll_GLES, "glUniform1i"); 180 | function(location, x); 181 | } 182 | void GL_APIENTRY call_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) 183 | { 184 | fun_glUniformMatrix4fv function = (fun_glUniformMatrix4fv)GetProcAddress(m_hDll_GLES, "glUniformMatrix4fv"); 185 | function(location, count, transpose, value); 186 | } 187 | void GL_APIENTRY call_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) 188 | { 189 | fun_glViewport function = (fun_glViewport)GetProcAddress(m_hDll_GLES, "glViewport"); 190 | function(x, y, width, height); 191 | } 192 | void GL_APIENTRY call_glClear(GLbitfield mask) 193 | { 194 | fun_glClear function = (fun_glClear)GetProcAddress(m_hDll_GLES, "glClear"); 195 | function(mask); 196 | } 197 | 198 | void GL_APIENTRY call_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 199 | { 200 | fun_glUniform4f function = (fun_glUniform4f)GetProcAddress(m_hDll_GLES, "glUniform4f"); 201 | function(location, x, y, z, w); 202 | } 203 | 204 | EGLBoolean EGLAPIENTRY call_eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) 205 | { 206 | fun_eglSwapBuffers function = (fun_eglSwapBuffers)GetProcAddress(m_hDll_EGL, "eglSwapBuffers"); 207 | return function(dpy, surface); 208 | } 209 | EGLBoolean EGLAPIENTRY call_eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) 210 | { 211 | fun_eglQuerySurface function = (fun_eglQuerySurface)GetProcAddress(m_hDll_EGL, "eglQuerySurface"); 212 | return function(dpy, surface, attribute, value); 213 | } 214 | EGLBoolean EGLAPIENTRY call_eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) 215 | { 216 | fun_eglMakeCurrent function = (fun_eglMakeCurrent)GetProcAddress(m_hDll_EGL, "eglMakeCurrent"); 217 | return function(dpy, draw, read, ctx); 218 | } 219 | EGLContext EGLAPIENTRY call_eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list) 220 | { 221 | fun_eglCreateContext function = (fun_eglCreateContext)GetProcAddress(m_hDll_EGL, "eglCreateContext"); 222 | return function(dpy, config, share_context, attrib_list); 223 | } 224 | EGLSurface EGLAPIENTRY call_eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list) 225 | { 226 | fun_eglCreateWindowSurface function = (fun_eglCreateWindowSurface)GetProcAddress(m_hDll_EGL, "eglCreateWindowSurface"); 227 | return function(dpy, config, win, attrib_list); 228 | } 229 | EGLBoolean EGLAPIENTRY call_eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) 230 | { 231 | fun_eglGetConfigAttrib function = (fun_eglGetConfigAttrib)GetProcAddress(m_hDll_EGL, "eglGetConfigAttrib"); 232 | return function(dpy, config, attribute, value); 233 | } 234 | EGLBoolean EGLAPIENTRY call_eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) 235 | { 236 | fun_eglChooseConfig function = (fun_eglChooseConfig)GetProcAddress(m_hDll_EGL, "eglChooseConfig"); 237 | return function(dpy, attrib_list, configs, config_size, num_config); 238 | } 239 | EGLBoolean EGLAPIENTRY call_eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) 240 | { 241 | fun_eglInitialize function = (fun_eglInitialize)GetProcAddress(m_hDll_EGL, "eglInitialize"); 242 | return function(dpy, major, minor); 243 | } 244 | EGLDisplay EGLAPIENTRY call_eglGetDisplay(EGLNativeDisplayType display_id) 245 | { 246 | fun_eglGetDisplay function = (fun_eglGetDisplay)GetProcAddress(m_hDll_EGL, "eglGetDisplay"); 247 | return function(display_id); 248 | } 249 | EGLBoolean EGLAPIENTRY call_eglTerminate(EGLDisplay dpy) 250 | { 251 | fun_eglTerminate function = (fun_eglTerminate)GetProcAddress(m_hDll_EGL, "eglTerminate"); 252 | return function(dpy); 253 | } 254 | EGLBoolean EGLAPIENTRY call_eglDestroySurface(EGLDisplay dpy, EGLSurface surface) 255 | { 256 | fun_eglDestroySurface function = (fun_eglDestroySurface)GetProcAddress(m_hDll_EGL, "eglDestroySurface"); 257 | return function(dpy, surface); 258 | } 259 | EGLBoolean EGLAPIENTRY call_eglDestroyContext(EGLDisplay dpy, EGLContext ctx) 260 | { 261 | fun_eglDestroyContext function = (fun_eglDestroyContext)GetProcAddress(m_hDll_EGL, "eglDestroyContext"); 262 | return function(dpy, ctx); 263 | } 264 | 265 | 266 | 267 | private: 268 | GLESAdapter(){}; 269 | ~GLESAdapter(){}; 270 | GLESAdapter(const GLESAdapter&){}; 271 | GLESAdapter& operator=(const GLESAdapter&){}; 272 | 273 | HINSTANCE m_hDll_EGL; 274 | HINSTANCE m_hDll_GLES; 275 | }; -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | WIN32 应用程序:testXp 项目概述 3 | ======================================================================== 4 | 5 | 应用程序向导已为您创建了此 testXp 应用程序。 6 | 7 | 本文件概要介绍组成 testXp 应用程序的每个文件的内容。 8 | 9 | 10 | testXp.vcxproj 11 | 这是使用应用程序向导生成的 VC++ 项目的主项目文件, 12 | 其中包含生成该文件的 Visual C++ 13 | 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 14 | 15 | testXp.vcxproj.filters 16 | 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 17 | 它包含有关项目文件与筛选器之间的关联信息。 在 IDE 18 | 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。 19 | 例如,“.cpp”文件与“源文件”筛选器关联。 20 | 21 | testXp.cpp 22 | 这是主应用程序源文件。 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | 应用程序向导创建了下列资源: 26 | 27 | testXp.rc 28 | 这是程序使用的所有 Microsoft Windows 资源的列表。 它包括 RES 29 | 子目录中存储的图标、位图和光标。 此文件可以直接在 Microsoft Visual C++ 30 | 中进行编辑。 31 | 32 | Resource.h 33 | 这是标准头文件,可用于定义新的资源 ID。 34 | Microsoft Visual C++ 将读取并更新此文件。 35 | 36 | testXp.ico 37 | 这是用作应用程序图标 (32x32) 的图标文件。 38 | 此图标包括在主资源文件 testXp.rc 中。 39 | 40 | small.ico 41 | 这是一个图标文件,其中包含应用程序的图标的较小版本 (16x16)。 42 | 此图标包括在主资源文件 testXp.rc 中。 43 | 44 | ///////////////////////////////////////////////////////////////////////////// 45 | 其他标准文件: 46 | 47 | StdAfx.h,StdAfx.cpp 48 | 这些文件用于生成名为 testXp.pch 的预编译头 (PCH) 文件和 49 | 名为 StdAfx.obj 的预编译类型文件。 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 其他注释: 53 | 54 | 应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 55 | 56 | ///////////////////////////////////////////////////////////////////////////// 57 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/Resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/Resource.h -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "CELLWinApp.hpp" 3 | #include "CGLESAdapter.hpp" 4 | 5 | 6 | int APIENTRY _tWinMain(HINSTANCE hInstance, 7 | HINSTANCE hPrevInstance, 8 | LPTSTR lpCmdLine, 9 | int nCmdShow) 10 | { 11 | UNREFERENCED_PARAMETER(hPrevInstance); 12 | UNREFERENCED_PARAMETER(hInstance); 13 | UNREFERENCED_PARAMETER(lpCmdLine); 14 | UNREFERENCED_PARAMETER(nCmdShow); 15 | 16 | HINSTANCE hDll_EGL; 17 | HINSTANCE hDll_GLES; 18 | hDll_EGL=LoadLibrary(L"libEGL.dll"); 19 | hDll_GLES=LoadLibrary(L"libGLESv2.dll"); 20 | //fun1 f1 = (fun1)GetProcAddress(hdll, "eglGetDisplay"); 21 | //EGLDisplay _display = f1(EGL_DEFAULT_DISPLAY); 22 | GLESAdapter::Instance()->SetHinstance(hDll_EGL, hDll_GLES); 23 | 24 | CELL::CELLWinApp app(hInstance); 25 | app.main(800,600); 26 | 27 | return 0; 28 | } 29 | 30 | //class a 31 | //{ 32 | //public: 33 | // EGLDisplay EGLAPIENTRY fun1(EGLNativeDisplayType display_id) 34 | // { 35 | // fun1 f1 = (fun1)GetProcAddress(hdll, "eglGetDisplay"); 36 | // return f1(display_id); 37 | // 38 | // } 39 | // 40 | //}; -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/small.ico -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/stdafx.cpp -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/stdafx.h -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/targetver.h -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/testXp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/testXp.cpp -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/testXp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/testXp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/testXp.ico -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/testXp.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/havenow/OpenGLES/a587f42343b30b8c1e98381c6ef83f5ab67068f7/windows下无lib的情况下使用gles/textXp/testXp/testXp.rc -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/testXp.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {22C70E54-14B0-4147-B3A6-04A110E09449} 15 | Win32Proj 16 | testXp 17 | 18 | 19 | 20 | Application 21 | true 22 | Unicode 23 | 24 | 25 | Application 26 | false 27 | true 28 | Unicode 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | true 42 | ../bin/$(Configuration)/ 43 | $(Configuration)\ 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) 54 | ../Depends/Include 55 | 56 | 57 | Windows 58 | true 59 | ..\Depends\Lib\windows\x86 60 | FreeImage.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 61 | 62 | 63 | 64 | 65 | Level3 66 | Use 67 | MaxSpeed 68 | true 69 | true 70 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 71 | 72 | 73 | Windows 74 | true 75 | true 76 | true 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | true 94 | 95 | 96 | 97 | 98 | 99 | Create 100 | Create 101 | 102 | 103 | true 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /windows下无lib的情况下使用gles/textXp/testXp/testXp.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;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 | 18 | 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 | 源文件 61 | 62 | 63 | 64 | 65 | 资源文件 66 | 67 | 68 | --------------------------------------------------------------------------------