GlaerContext * getCurrentGlaerContext() { GLFWwindow *handle = glfwGetCurrentContext(); if (!handle) { throw window_error("no current context"); } return &(getWindowData(handle)->context); }
/* * Get PIN from GTK_ENTRY * And call Validate PIN function * */ void access_token_gtk(GtkButton *button, AuthWidget *DataInput){ int correctVerify; /* Get text from GTK_Entry*/ const char *pin = gtk_entry_get_text (GTK_ENTRY (DataInput->pin)); //Validate PIN correctVerify = access_token(pin); if(correctVerify == 0) window_error("Error: bad Input!"); else destroy(button, DataInput->window); }
// this should only be called from the main thread create_window_args::operator Window * () { gecom::log("Window").information(0) << "Creating window... [title=" << m_title << "]"; if (m_hints[GLFW_OPENGL_DEBUG_CONTEXT]) { log("Window").information(0) << "Requesting debug GL context"; } init_glfw(); glfwDefaultWindowHints(); //GLenum gl_err = glGetError(); //gecom::log("Window") % 0 << "GLerror: " << gl_err; for (auto me : m_hints) { glfwWindowHint(me.first, me.second); } GLFWwindow *handle = glfwCreateWindow(m_size.w, m_size.h, m_title.c_str(), m_monitor, m_share ? m_share->handle() : nullptr); glfwDefaultWindowHints(); if (!handle) { gecom::log("Window").error() << "GLFW window creation failed"; throw window_error("GLFW window creation failed"); } gecom::log("Window").information(0) << "Window created"; return new Window(handle, m_share); }