30 #include <glad/glad.h> 38 #if defined(__APPLE__) 39 #define MODIFIER GLFW_MOD_SUPER 41 #define MODIFIER GLFW_MOD_CONTROL 46 printf(
"Usage: clipboard [-h]\n");
51 fprintf(
stderr,
"Error: %s\n", description);
72 printf(
"Clipboard contains \"%s\"\n",
string);
74 printf(
"Clipboard does not contain a string\n");
81 const char*
string =
"Hello GLFW World!";
83 printf(
"Setting clipboard to \"%s\"\n",
string);
89 int main(
int argc,
char** argv)
94 while ((ch =
getopt(argc, argv,
"h")) != -1)
112 fprintf(
stderr,
"Failed to initialize GLFW\n");
121 fprintf(
stderr,
"Failed to open GLFW window\n");
The header of the GLFW 3 API.
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
GLsizei const GLchar *const * string
void *(* GLADloadproc)(const char *name)
static GLFWwindow * window
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
int getopt(int argc, char *const argv[], const char *optstring)
int main(int argc, char **argv)
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
#define GL_COLOR_BUFFER_BIT
GLFWAPI void glfwSwapInterval(int interval)
Sets the swap interval for the current context.
GLFWAPI void glfwSwapBuffers(GLFWwindow *window)
Swaps the front and back buffers of the specified window.
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
void key(GLFWwindow *window, int k, int s, int action, int mods)
static void error_callback(int error, const char *description)
static void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods)
GLAPI int gladLoadGLLoader(GLADloadproc)
static const textual_icon exit
GLFWAPI void glfwSetWindowShouldClose(GLFWwindow *window, int value)
Sets the close flag of the specified window.
GLFWAPI void glfwWaitEvents(void)
Waits until events are queued and processes them.
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
struct GLFWwindow GLFWwindow
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.