github.com/gotranspile/cxgo@v0.3.8-0.20240118201721-29871598a6a2/libs/includes/GLFW/glfw3.h (about)

     1  #define GLFW_TRUE                   1
     2  #define GLFW_FALSE                  0
     3  // key and button actions
     4  #define GLFW_RELEASE                0
     5  #define GLFW_PRESS                  1
     6  #define GLFW_REPEAT                 2
     7  // hints
     8  #define GLFW_FOCUSED                0x00020001
     9  #define GLFW_ICONIFIED              0x00020002
    10  #define GLFW_RESIZABLE              0x00020003
    11  #define GLFW_VISIBLE                0x00020004
    12  #define GLFW_DECORATED              0x00020005
    13  #define GLFW_AUTO_ICONIFY           0x00020006
    14  #define GLFW_FLOATING               0x00020007
    15  #define GLFW_MAXIMIZED              0x00020008
    16  #define GLFW_CENTER_CURSOR          0x00020009
    17  #define GLFW_TRANSPARENT_FRAMEBUFFER 0x0002000A
    18  #define GLFW_HOVERED                0x0002000B
    19  #define GLFW_FOCUS_ON_SHOW          0x0002000C
    20  #define GLFW_MOUSE_PASSTHROUGH      0x0002000D
    21  #define GLFW_RED_BITS               0x00021001
    22  #define GLFW_GREEN_BITS             0x00021002
    23  #define GLFW_BLUE_BITS              0x00021003
    24  #define GLFW_ALPHA_BITS             0x00021004
    25  #define GLFW_DEPTH_BITS             0x00021005
    26  #define GLFW_STENCIL_BITS           0x00021006
    27  #define GLFW_ACCUM_RED_BITS         0x00021007
    28  #define GLFW_ACCUM_GREEN_BITS       0x00021008
    29  #define GLFW_ACCUM_BLUE_BITS        0x00021009
    30  #define GLFW_ACCUM_ALPHA_BITS       0x0002100A
    31  #define GLFW_AUX_BUFFERS            0x0002100B
    32  #define GLFW_STEREO                 0x0002100C
    33  #define GLFW_SAMPLES                0x0002100D
    34  #define GLFW_SRGB_CAPABLE           0x0002100E
    35  #define GLFW_REFRESH_RATE           0x0002100F
    36  #define GLFW_DOUBLEBUFFER           0x00021010
    37  #define GLFW_CLIENT_API             0x00022001
    38  #define GLFW_CONTEXT_VERSION_MAJOR  0x00022002
    39  #define GLFW_CONTEXT_VERSION_MINOR  0x00022003
    40  #define GLFW_CONTEXT_REVISION       0x00022004
    41  #define GLFW_CONTEXT_ROBUSTNESS     0x00022005
    42  #define GLFW_OPENGL_FORWARD_COMPAT  0x00022006
    43  #define GLFW_CONTEXT_DEBUG          0x00022007
    44  #define GLFW_OPENGL_DEBUG_CONTEXT   GLFW_CONTEXT_DEBUG
    45  #define GLFW_OPENGL_PROFILE         0x00022008
    46  #define GLFW_OPENGL_ANY_PROFILE              0
    47  #define GLFW_OPENGL_CORE_PROFILE    0x00032001
    48  #define GLFW_OPENGL_COMPAT_PROFILE  0x00032002
    49  #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
    50  #define GLFW_CONTEXT_NO_ERROR       0x0002200A
    51  #define GLFW_CONTEXT_CREATION_API   0x0002200B
    52  #define GLFW_SCALE_TO_MONITOR       0x0002200C
    53  #define GLFW_COCOA_RETINA_FRAMEBUFFER 0x00023001
    54  #define GLFW_COCOA_FRAME_NAME         0x00023002
    55  #define GLFW_COCOA_GRAPHICS_SWITCHING 0x00023003
    56  #define GLFW_X11_CLASS_NAME         0x00024001
    57  #define GLFW_X11_INSTANCE_NAME      0x00024002
    58  #define GLFW_WIN32_KEYBOARD_MENU    0x00025001
    59  /* The unknown key */
    60  #define GLFW_KEY_UNKNOWN            -1
    61  /* Printable keys */
    62  #define GLFW_KEY_SPACE              32
    63  #define GLFW_KEY_APOSTROPHE         39  /* ' */
    64  #define GLFW_KEY_COMMA              44  /* , */
    65  #define GLFW_KEY_MINUS              45  /* - */
    66  #define GLFW_KEY_PERIOD             46  /* . */
    67  #define GLFW_KEY_SLASH              47  /* / */
    68  #define GLFW_KEY_0                  48
    69  #define GLFW_KEY_1                  49
    70  #define GLFW_KEY_2                  50
    71  #define GLFW_KEY_3                  51
    72  #define GLFW_KEY_4                  52
    73  #define GLFW_KEY_5                  53
    74  #define GLFW_KEY_6                  54
    75  #define GLFW_KEY_7                  55
    76  #define GLFW_KEY_8                  56
    77  #define GLFW_KEY_9                  57
    78  #define GLFW_KEY_SEMICOLON          59  /* ; */
    79  #define GLFW_KEY_EQUAL              61  /* = */
    80  #define GLFW_KEY_A                  65
    81  #define GLFW_KEY_B                  66
    82  #define GLFW_KEY_C                  67
    83  #define GLFW_KEY_D                  68
    84  #define GLFW_KEY_E                  69
    85  #define GLFW_KEY_F                  70
    86  #define GLFW_KEY_G                  71
    87  #define GLFW_KEY_H                  72
    88  #define GLFW_KEY_I                  73
    89  #define GLFW_KEY_J                  74
    90  #define GLFW_KEY_K                  75
    91  #define GLFW_KEY_L                  76
    92  #define GLFW_KEY_M                  77
    93  #define GLFW_KEY_N                  78
    94  #define GLFW_KEY_O                  79
    95  #define GLFW_KEY_P                  80
    96  #define GLFW_KEY_Q                  81
    97  #define GLFW_KEY_R                  82
    98  #define GLFW_KEY_S                  83
    99  #define GLFW_KEY_T                  84
   100  #define GLFW_KEY_U                  85
   101  #define GLFW_KEY_V                  86
   102  #define GLFW_KEY_W                  87
   103  #define GLFW_KEY_X                  88
   104  #define GLFW_KEY_Y                  89
   105  #define GLFW_KEY_Z                  90
   106  #define GLFW_KEY_LEFT_BRACKET       91  /* [ */
   107  #define GLFW_KEY_BACKSLASH          92  /* \ */
   108  #define GLFW_KEY_RIGHT_BRACKET      93  /* ] */
   109  #define GLFW_KEY_GRAVE_ACCENT       96  /*  */
   110  #define GLFW_KEY_WORLD_1            161 /* non-US #1 */
   111  #define GLFW_KEY_WORLD_2            162 /* non-US #2 */
   112  /* Function keys */
   113  #define GLFW_KEY_ESCAPE             256
   114  #define GLFW_KEY_ENTER              257
   115  #define GLFW_KEY_TAB                258
   116  #define GLFW_KEY_BACKSPACE          259
   117  #define GLFW_KEY_INSERT             260
   118  #define GLFW_KEY_DELETE             261
   119  #define GLFW_KEY_RIGHT              262
   120  #define GLFW_KEY_LEFT               263
   121  #define GLFW_KEY_DOWN               264
   122  #define GLFW_KEY_UP                 265
   123  #define GLFW_KEY_PAGE_UP            266
   124  #define GLFW_KEY_PAGE_DOWN          267
   125  #define GLFW_KEY_HOME               268
   126  #define GLFW_KEY_END                269
   127  #define GLFW_KEY_CAPS_LOCK          280
   128  #define GLFW_KEY_SCROLL_LOCK        281
   129  #define GLFW_KEY_NUM_LOCK           282
   130  #define GLFW_KEY_PRINT_SCREEN       283
   131  #define GLFW_KEY_PAUSE              284
   132  #define GLFW_KEY_F1                 290
   133  #define GLFW_KEY_F2                 291
   134  #define GLFW_KEY_F3                 292
   135  #define GLFW_KEY_F4                 293
   136  #define GLFW_KEY_F5                 294
   137  #define GLFW_KEY_F6                 295
   138  #define GLFW_KEY_F7                 296
   139  #define GLFW_KEY_F8                 297
   140  #define GLFW_KEY_F9                 298
   141  #define GLFW_KEY_F10                299
   142  #define GLFW_KEY_F11                300
   143  #define GLFW_KEY_F12                301
   144  #define GLFW_KEY_F13                302
   145  #define GLFW_KEY_F14                303
   146  #define GLFW_KEY_F15                304
   147  #define GLFW_KEY_F16                305
   148  #define GLFW_KEY_F17                306
   149  #define GLFW_KEY_F18                307
   150  #define GLFW_KEY_F19                308
   151  #define GLFW_KEY_F20                309
   152  #define GLFW_KEY_F21                310
   153  #define GLFW_KEY_F22                311
   154  #define GLFW_KEY_F23                312
   155  #define GLFW_KEY_F24                313
   156  #define GLFW_KEY_F25                314
   157  #define GLFW_KEY_KP_0               320
   158  #define GLFW_KEY_KP_1               321
   159  #define GLFW_KEY_KP_2               322
   160  #define GLFW_KEY_KP_3               323
   161  #define GLFW_KEY_KP_4               324
   162  #define GLFW_KEY_KP_5               325
   163  #define GLFW_KEY_KP_6               326
   164  #define GLFW_KEY_KP_7               327
   165  #define GLFW_KEY_KP_8               328
   166  #define GLFW_KEY_KP_9               329
   167  #define GLFW_KEY_KP_DECIMAL         330
   168  #define GLFW_KEY_KP_DIVIDE          331
   169  #define GLFW_KEY_KP_MULTIPLY        332
   170  #define GLFW_KEY_KP_SUBTRACT        333
   171  #define GLFW_KEY_KP_ADD             334
   172  #define GLFW_KEY_KP_ENTER           335
   173  #define GLFW_KEY_KP_EQUAL           336
   174  #define GLFW_KEY_LEFT_SHIFT         340
   175  #define GLFW_KEY_LEFT_CONTROL       341
   176  #define GLFW_KEY_LEFT_ALT           342
   177  #define GLFW_KEY_LEFT_SUPER         343
   178  #define GLFW_KEY_RIGHT_SHIFT        344
   179  #define GLFW_KEY_RIGHT_CONTROL      345
   180  #define GLFW_KEY_RIGHT_ALT          346
   181  #define GLFW_KEY_RIGHT_SUPER        347
   182  #define GLFW_KEY_MENU               348
   183  #define GLFW_KEY_LAST               GLFW_KEY_MENU
   184  // mouse buttons
   185  #define GLFW_MOUSE_BUTTON_1         0
   186  #define GLFW_MOUSE_BUTTON_2         1
   187  #define GLFW_MOUSE_BUTTON_3         2
   188  #define GLFW_MOUSE_BUTTON_4         3
   189  #define GLFW_MOUSE_BUTTON_5         4
   190  #define GLFW_MOUSE_BUTTON_6         5
   191  #define GLFW_MOUSE_BUTTON_7         6
   192  #define GLFW_MOUSE_BUTTON_8         7
   193  #define GLFW_MOUSE_BUTTON_LAST      GLFW_MOUSE_BUTTON_8
   194  #define GLFW_MOUSE_BUTTON_LEFT      GLFW_MOUSE_BUTTON_1
   195  #define GLFW_MOUSE_BUTTON_RIGHT     GLFW_MOUSE_BUTTON_2
   196  #define GLFW_MOUSE_BUTTON_MIDDLE    GLFW_MOUSE_BUTTON_3
   197  // shift keys
   198  #define GLFW_MOD_SHIFT           0x0001
   199  #define GLFW_MOD_CONTROL         0x0002
   200  #define GLFW_MOD_ALT             0x0004
   201  #define GLFW_MOD_SUPER           0x0008
   202  #define GLFW_MOD_CAPS_LOCK       0x0010
   203  #define GLFW_MOD_NUM_LOCK        0x0020
   204  // input modes
   205  #define GLFW_CURSOR                 0x00033001
   206  #define GLFW_STICKY_KEYS            0x00033002
   207  #define GLFW_STICKY_MOUSE_BUTTONS   0x00033003
   208  #define GLFW_LOCK_KEY_MODS          0x00033004
   209  #define GLFW_RAW_MOUSE_MOTION       0x00033005
   210  // peripheral events
   211  #define GLFW_CONNECTED              0x00040001
   212  #define GLFW_DISCONNECTED           0x00040002
   213  typedef struct GLFWvidmode {
   214      int width;
   215      int height;
   216      int redBits;
   217      int greenBits;
   218      int blueBits;
   219      int refreshRate;
   220  } GLFWvidmode;
   221  typedef struct GLFWmonitor {
   222  	GLFWvidmode* (*GetVideoMode)(void);
   223  	void (*GetPos)(int*, int*);
   224  	void (*GetPhysicalSize)(int*, int*);
   225  	char* (*GetName)(void);
   226  } GLFWmonitor;
   227  #define glfwGetVideoMode(mon) ((GLFWmonitor*)mon)->GetVideoMode()
   228  #define glfwGetMonitorPos(mon, x, y) ((GLFWmonitor*)mon)->GetPos(x, y)
   229  #define glfwGetMonitorPhysicalSize(mon, x, y) ((GLFWmonitor*)mon)->GetPhysicalSize(x, y)
   230  #define glfwGetMonitorName(mon) ((GLFWmonitor*)mon)->GetName()
   231  typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
   232  typedef struct GLFWwindow GLFWwindow;
   233  typedef void (* GLFWerrorfun)(int,const char*);
   234  typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);
   235  typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
   236  typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);
   237  typedef void (* GLFWwindowposfun)(GLFWwindow* window, int xpos, int ypos);
   238  typedef void (* GLFWwindowsizefun)(GLFWwindow* window, int width, int height);
   239  typedef void (* GLFWwindowcontentscalefun)(GLFWwindow* window, float xscale, float yscale);
   240  typedef void (* GLFWwindowclosefun)(GLFWwindow* window);
   241  typedef void (* GLFWjoystickfun)(int,int);
   242  typedef void (* GLFWwindowrefreshfun)(GLFWwindow* window);
   243  typedef void (* GLFWwindowfocusfun)(GLFWwindow* window, int focused);
   244  struct GLFWwindow {
   245  	void (*MakeContextCurrent)(void);
   246  	_Bool (*ShouldClose)(void);
   247  	void (*SwapBuffers)(void);
   248  	int (*GetKey)(int);
   249  	void (*SetShouldClose)(_Bool);
   250  	void (*GetFramebufferSize)(int* width, int* height);
   251  	void (*Destroy)(void);
   252  	void (*Focus)(void);
   253  	void (*Maximize)(void);
   254  	void (*Show)(void);
   255  	void (*Hide)(void);
   256  	void (*Iconify)(void);
   257  	void (*Restore)(void);
   258  	void (*SetTitle)(const char* title);
   259  	void (*SetSize)(int width, int height);
   260  	void (*GetSize)(int* width, int* height);
   261  	void (*SetPos)(int x, int y);
   262  	void (*GetPos)(int* x, int* y);
   263  	int (*GetInputMode)(int);
   264  	void (*SetInputMode)(int, int);
   265  	void* (*GetUserPointer)(void);
   266  	void (*SetUserPointer)(void*);
   267  	void (*SetAttrib)(int, int);
   268  	int (*GetAttrib)(int);
   269  	GLFWmonitor* (*GetMonitor)(void);
   270  	void (*SetMonitor)(GLFWmonitor*, int, int, int, int, int);
   271  	// callbacks
   272  	GLFWkeyfun (*SetKeyCallback)(GLFWkeyfun);
   273  	GLFWcharfun (*SetCharCallback)(GLFWcharfun);
   274  	GLFWframebuffersizefun (*SetFramebufferSizeCallback)(GLFWframebuffersizefun);
   275  	GLFWwindowposfun (*SetPosCallback)(GLFWwindowposfun);
   276  	GLFWwindowsizefun (*SetSizeCallback)(GLFWwindowsizefun);
   277  	GLFWwindowcontentscalefun (*SetContentScaleCallback)(GLFWwindowcontentscalefun);
   278  	GLFWwindowclosefun (*SetCloseCallback)(GLFWwindowclosefun);
   279  	GLFWwindowrefreshfun (*SetRefreshCallback)(GLFWwindowrefreshfun);
   280  	GLFWwindowfocusfun (*SetFocusCallback)(GLFWwindowfocusfun);
   281  };
   282  #define glfwGetWindowMonitor(win) ((GLFWwindow*)win)->GetMonitor()
   283  #define glfwSetWindowMonitor(win, mon, x, y, w, h, r) ((GLFWwindow*)win)->SetMonitor(mon, x, y, w, h, r)
   284  #define glfwGetWindowAttrib(win, x, y) ((GLFWwindow*)win)->GetAttrib(x)
   285  #define glfwSetWindowAttrib(win, x, y) ((GLFWwindow*)win)->SetAttrib(x, y)
   286  #define glfwMakeContextCurrent(win) ((GLFWwindow*)win)->MakeContextCurrent()
   287  #define glfwWindowShouldClose(win) ((GLFWwindow*)win)->ShouldClose()
   288  #define glfwSwapBuffers(win) ((GLFWwindow*)win)->SwapBuffers()
   289  #define glfwGetKey(win, k) ((GLFWwindow*)win)->GetKey(k)
   290  #define glfwSetWindowShouldClose(win, b) ((GLFWwindow*)win)->SetShouldClose(b)
   291  #define glfwSetKeyCallback(win, cb) ((GLFWwindow*)win)->SetKeyCallback(cb)
   292  #define glfwSetCharCallback(win, cb) ((GLFWwindow*)win)->SetCharCallback(cb)
   293  #define glfwSetFramebufferSizeCallback(win, cb) ((GLFWwindow*)win)->SetFramebufferSizeCallback(cb)
   294  #define glfwSetWindowPosCallback(win, cb) ((GLFWwindow*)win)->SetPosCallback(cb)
   295  #define glfwSetWindowSizeCallback(win, cb) ((GLFWwindow*)win)->SetSizeCallback(cb)
   296  #define glfwSetWindowContentScaleCallback(win, cb) ((GLFWwindow*)win)->SetContentScaleCallback(cb)
   297  #define glfwSetWindowCloseCallback(win, cb) ((GLFWwindow*)win)->SetCloseCallback(cb)
   298  #define glfwGetFramebufferSize(win, w, h) ((GLFWwindow*)win)->GetFramebufferSize(w, h)
   299  #define glfwDestroyWindow(win) ((GLFWwindow*)win)->Destroy()
   300  #define glfwFocusWindow(win) ((GLFWwindow*)win)->Focus()
   301  #define glfwMaximizeWindow(win) ((GLFWwindow*)win)->Maximize()
   302  #define glfwShowWindow(win) ((GLFWwindow*)win)->Show()
   303  #define glfwHideWindow(win) ((GLFWwindow*)win)->Hide()
   304  #define glfwIconifyWindow(win) ((GLFWwindow*)win)->Iconify()
   305  #define glfwRestoreWindow(win) ((GLFWwindow*)win)->Restore()
   306  #define glfwSetWindowTitle(win, title) ((GLFWwindow*)win)->SetTitle(title)
   307  #define glfwSetWindowSize(win, w, h) ((GLFWwindow*)win)->SetSize(w, h)
   308  #define glfwGetWindowSize(win, w, h) ((GLFWwindow*)win)->GetSize(w, h)
   309  #define glfwSetWindowPos(win, x, y) ((GLFWwindow*)win)->SetPos(x, y)
   310  #define glfwGetWindowPos(win, x, y) ((GLFWwindow*)win)->GetPos(x, y)
   311  #define glfwGetWindowUserPointer(win) ((GLFWwindow*)win)->GetUserPointer()
   312  #define glfwSetWindowUserPointer(win, ptr) ((GLFWwindow*)win)->SetUserPointer(ptr)
   313  #define glfwGetInputMode(win, mode) ((GLFWwindow*)win)->GetInputMode(mode)
   314  #define glfwSetInputMode(win, mode, v) ((GLFWwindow*)win)->SetInputMode(mode, v)
   315  #define glfwSetWindowRefreshCallback(win, cb) ((GLFWwindow*)win)->SetRefreshCallback(cb)
   316  #define glfwSetWindowFocusCallback(win, cb) ((GLFWwindow*)win)->SetRefreshCallback(cb)
   317  typedef struct _GLFWjoystick {
   318  	const float* (*GetAxes)(int* count);
   319  	const unsigned char* (*GetButtons)(int* count);
   320  	const unsigned char* (*GetHats)(int* count);
   321  	const char* (*GetName)(void);
   322  	_Bool (*IsGamepad)(void);
   323  	const char* (*GetGUID)(void);
   324  	const char* GetGamepadName(void);
   325  } _GLFWjoystick;
   326  #define glfwGetJoystickAxes(j, a) ((_GLFWjoystick)j).GetAxes(a)
   327  #define glfwGetJoystickButtons(j, a) ((_GLFWjoystick)j).GetButtons(a)
   328  #define glfwGetJoystickHats(j, a) ((_GLFWjoystick)j).GetHats(a)
   329  #define glfwGetJoystickName(j) ((_GLFWjoystick)j).GetName()
   330  #define glfwJoystickIsGamepad(j) ((_GLFWjoystick)j).IsGamepad()
   331  #define glfwGetJoystickGUID(j) ((_GLFWjoystick)j).GetGUID()
   332  #define glfwGetGamepadName(j) ((_GLFWjoystick)j).GetGamepadName()
   333  void glfwWindowHint(int, int);
   334  const char* glfwGetKeyName(int key, int scancode);