30 #include <glad/glad.h> 51 { 0.95f, 0.32f, 0.11f },
52 { 0.50f, 0.80f, 0.16f },
53 { 0.f, 0.68f, 0.94f },
54 { 0.98f, 0.74f, 0.04f }
59 printf(
"Usage: windows [-h] [-b] [-f] \n");
61 printf(
" -b create decorated windows\n");
62 printf(
" -f set focus on show off for all but first window\n");
63 printf(
" -h show this help\n");
68 fprintf(stderr,
"Error: %s\n", description);
92 int main(
int argc,
char** argv)
100 while ((ch =
getopt(argc, argv,
"bfh")) != -1)
127 for (i = 0; i < 4; i++)
148 100 + (i & 1) * (200 + left + right),
149 100 + (i >> 1) * (200 + top + bottom));
152 for (i = 0; i < 4; i++)
157 for (i = 0; i < 4; i++)
GLboolean GLboolean GLboolean b
GLdouble GLdouble GLdouble top
The header of the GLFW 3 API.
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
static const struct @58 colors[]
static void error_callback(int error, const char *description)
void *(* GLADloadproc)(const char *name)
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
int getopt(int argc, char *const argv[], const char *optstring)
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
static volatile int running
#define GL_COLOR_BUFFER_BIT
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.
GLFWAPI void glfwGetWindowFrameSize(GLFWwindow *window, int *left, int *top, int *right, int *bottom)
Retrieves the size of the frame of the window.
static void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods)
int main(int argc, char **argv)
GLAPI int gladLoadGLLoader(GLADloadproc)
static const textual_icon exit
GLFWAPI void glfwSetWindowPos(GLFWwindow *window, int xpos, int ypos)
Sets the position of the client area of the specified window.
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.
#define GLFW_FOCUS_ON_SHOW
Input focus on calling show window hint and attribute.
GLFWAPI void glfwGetWindowPos(GLFWwindow *window, int *xpos, int *ypos)
Retrieves the position of the client area of the specified window.
GLFWAPI void glfwShowWindow(GLFWwindow *window)
Makes the specified window visible.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
#define GLFW_VISIBLE
Window visibility window hint and attribute.
#define GLFW_DECORATED
Window decoration window hint and attribute.
struct GLFWwindow GLFWwindow
GLFWAPI void glfwWindowHint(int hint, int value)
Sets the specified window hint to the desired value.
static const char * titles[]
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.