32 #include <glad/glad.h> 43 fprintf(stderr,
"Error: %s\n", description);
52 clock_gettime(CLOCK_REALTIME, &time);
70 return (
float) rand() / (float)
RAND_MAX;
79 srand((
unsigned int) time(
NULL));
99 fprintf(stderr,
"Failed to create secondary thread\n");
109 float l = (float) sqrt(r * r +
g *
g +
b *
b);
GLboolean GLboolean GLboolean b
The header of the GLFW 3 API.
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
void *(* GLADloadproc)(const char *name)
GLFWAPI void glfwHideWindow(GLFWwindow *window)
Hides the specified window.
static GLFWwindow * window
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
GLFWAPI void glfwPostEmptyEvent(void)
Posts an empty event to the event queue.
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
static void error_callback(int error, const char *description)
static volatile int running
#define GL_COLOR_BUFFER_BIT
GLint GLsizei GLsizei height
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.
int thrd_join(thrd_t thr, int *res)
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.
static int thread_main(void *data)
GLFWAPI void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
GLFWAPI void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining)
struct GLFWwindow GLFWwindow
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.