Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::opengl::glfw Namespace Reference

Namespaces

namespace  imgui
 
namespace  serialization
 

Classes

class  Viewer
 
class  ViewerPlugin
 

Functions

IGL_INLINE bool background_window (GLFWwindow *&window)
 

Function Documentation

◆ background_window()

IGL_INLINE bool igl::opengl::glfw::background_window ( GLFWwindow *&  window)
6{
7 if(!glfwInit()) return false;
8 glfwSetErrorCallback([](int id,const char* m){std::cerr<<m<<std::endl;});
9 glfwWindowHint(GLFW_SAMPLES, 4);
10 // Use 3.2 core profile
11 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
12 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
13 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
14 glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
15 // Use background window
16 glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
17 window = glfwCreateWindow(1, 1,"", NULL, NULL);
18 if(!window) return false;
19 glfwMakeContextCurrent(window);
20 if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress))
21 {
22 printf("Failed to load OpenGL and its extensions");
23 }
24 glGetError(); // pull and safely ignore unhandled errors like GL_INVALID_ENUM
25 return true;
26}
#define GL_TRUE
Definition glu-libtess.h:70
#define GL_FALSE
Definition glu-libtess.h:71

References GL_FALSE, and GL_TRUE.