| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #include "Window.h"
- #include <GLFW/glfw3.h>
- #include <stdio.h>
- bool windowTest() {
- GLFWwindow* window;
- /* Initialize the library */
- if(!glfwInit()) {
- printf("init failed\n");
- return true;
- }
- /* Create a windowed mode window and its OpenGL context */
- window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
- if(!window) {
- glfwTerminate();
- printf("create window failed\n");
- return true;
- }
- /* Make the window's context current */
- glfwMakeContextCurrent(window);
- /* Loop until the user closes the window */
- while(!glfwWindowShouldClose(window)) {
- /* Render here */
- glClear(GL_COLOR_BUFFER_BIT);
- /* Swap front and back buffers */
- glfwSwapBuffers(window);
- /* Poll for and process events */
- glfwPollEvents();
- }
- printf("YES\n");
- glfwTerminate();
- return true;
- }
|