// Include standard headers
#include <stdio.h>
#include <stdlib.h> // Include GLEW
#include <GL/glew.h> // Include GLFW
#include <glfw3.h>
GLFWwindow* window; // Include GLM
#include <glm/glm.hpp>
using namespace glm; int main( void )
{
// Initialise GLFW
if( !glfwInit() )
{
fprintf( stderr, "Failed to initialize GLFW\n" );
getchar();
return -;
} glfwWindowHint(GLFW_SAMPLES, );
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, );
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, );
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // To make MacOS happy; should not be needed
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Open a window and create its OpenGL context
window = glfwCreateWindow( , , "Tutorial 01", NULL, NULL);
if( window == NULL ){
fprintf( stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" );
getchar();
glfwTerminate();
return -;
}
glfwMakeContextCurrent(window); // Initialize GLEW
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
getchar();
glfwTerminate();
return -;
} // Ensure we can capture the escape key being pressed below
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE); // Dark blue background
glClearColor(0.0f, 0.0f, 0.4f, 0.0f); do{
// Clear the screen. It's not mentioned before Tutorial 02, but it can cause flickering, so it's there nonetheless.
glClear( GL_COLOR_BUFFER_BIT ); // Draw nothing, see you in tutorial 2 ! // Swap buffers
glfwSwapBuffers(window);
glfwPollEvents(); } // Check if the ESC key was pressed or the window was closed
while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS &&
glfwWindowShouldClose(window) == ); // Close OpenGL window and terminate GLFW
glfwTerminate(); return ;
}

最新文章

  1. mysql基础用法
  2. Yii Model中添加默认搜索条件
  3. c# select标签绑定枚举,并以Description做Text显示
  4. x square x cube
  5. vue.js入门(3)——组件通信
  6. RMI、Hessian、Burlap、Httpinvoker、WebService的比较
  7. android 单独编译某个模块
  8. React-Native的基本控件属性方法
  9. 介绍4款json的java类库 及 其性能测试
  10. Hadoop学习-HDFS篇
  11. Spring Boot学习总结二
  12. JavaScript 作用域、命名空间及闭包
  13. face recognition[Euclidean-distance-based loss][Center Face]
  14. Kali proxychains
  15. sort、sorted高级排序-Python3.7 And 算法&lt;七&gt;
  16. Docker(四)-Dcoker镜像
  17. css笔记 - 张鑫旭css课程笔记之 float 篇
  18. CTO详细讲解海量日志处理ELK
  19. 如何快速将文本中的tab更换成逗号(图文详解)
  20. &lt;input&gt;type类型

热门文章

  1. 关于editplus设置java和c#
  2. 【转】如何选择Html.RenderPartial和Html.RenderAction
  3. 2017年Android百大框架排行榜
  4. surgemq 添加ssl
  5. iOS 使用UI控件的外观协议UIAppearance进行设置默认UI控件样式
  6. android开发学习笔记系列(2)-android应用界面编程
  7. 转载:哈希加密算法 MD5,SHA-1,SHA-2,SHA-256,SHA-512,SHA-3,RIPEMD-160 - aTool
  8. java Html 转 PDF
  9. Java对象的强、软、弱和虚引用+ReferenceQueue
  10. c#基础学习(0724)之可变参数、ref和out