aboutsummaryrefslogtreecommitdiff
path: root/src/glfww.h
blob: 63952ca625598c742a4a3a1965c0dbd119f2ab7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <GL/gl.h>
#include "util.h"
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#ifndef __glfww_
#define __glfww_

#define win_clean() glfwTerminate();
#define ab_to_vp(x,y,w,h,x1,y1) float x = 2 * ((float)x1/(w)) -1;\
    float y = 2 * ((float)y1/(h)) -1;
#define vp_to_ab(w,x1) ((float)x1 +1.0/2)*w
GLFWwindow* glfw_init();
#define glfw_load(w) glfwSwapBuffers(w);
void glfw_loop(GLFWwindow*window);
int get_h();
int get_w();
void glfw_pixel_partial(GLFWwindow*wi,int x, int y);
void glfw_clear(GLFWwindow*w);
void refresh_size(GLFWwindow*);
#define glfw_pixel(wi,x,y)\
  glBegin(GL_POINTS);\
  glfw_pixel_partial(wi,x,y);\
  glEnd();
void glfw_circle(GLFWwindow* w,int x, int y, int r);
void glfw_circle_partial(GLFWwindow* w,int x, int y, int r);
#endif