glfw3.c 3.4.2 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GLFW/glfw3.c +3 -3
- package/GLFW/internal.h +8 -3
- package/GLFW/platform.c +1 -1
- package/README.md +8 -17
- package/package.json +1 -1
package/GLFW/glfw3.c
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Core/Common files (always included)
|
|
2
2
|
#pragma once
|
|
3
3
|
|
|
4
|
-
// FIX: Define missing OCR_* constants (@
|
|
4
|
+
// FIX: Define missing OCR_* constants (@wolfram77)
|
|
5
5
|
// For some reason, including windows.h with OEMRESOURCE defined
|
|
6
6
|
// does not always define these constants.
|
|
7
7
|
#ifdef _GLFW_WIN32
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
#endif
|
|
28
28
|
#endif
|
|
29
29
|
|
|
30
|
-
// Auto-link windows libraries (@
|
|
30
|
+
// Auto-link windows libraries (@wolfram77)
|
|
31
31
|
#ifdef _GLFW_WIN32
|
|
32
32
|
#pragma comment(lib, "gdi32.lib")
|
|
33
33
|
#pragma comment(lib, "user32.lib")
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
#include "window.c"
|
|
47
47
|
|
|
48
48
|
// Null platform (for unsupported platforms)
|
|
49
|
-
// FIX: Avoid including null platform when not needed (@
|
|
49
|
+
// FIX: Avoid including null platform when not needed (@wolfram77)
|
|
50
50
|
#if !defined(_GLFW_WIN32) && !defined(_GLFW_COCOA) && !defined(_GLFW_X11) && !defined(_GLFW_WAYLAND)
|
|
51
51
|
#include "null_init.c"
|
|
52
52
|
#include "null_joystick.c"
|
package/GLFW/internal.h
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
#endif
|
|
47
47
|
|
|
48
48
|
#define GLFW_INCLUDE_NONE
|
|
49
|
-
#include "glfw3.h" // Adjust include path (@
|
|
49
|
+
#include "glfw3.h" // Adjust include path (@wolfram77)
|
|
50
50
|
|
|
51
51
|
#define _GLFW_INSERT_FIRST 0
|
|
52
52
|
#define _GLFW_INSERT_LAST 1
|
|
@@ -78,7 +78,7 @@ typedef struct _GLFWjoystick _GLFWjoystick;
|
|
|
78
78
|
typedef struct _GLFWtls _GLFWtls;
|
|
79
79
|
typedef struct _GLFWmutex _GLFWmutex;
|
|
80
80
|
|
|
81
|
-
// FIX: GV_NUM_EXTENSIONS is redefined, among other redefinitions (@
|
|
81
|
+
// FIX: GV_NUM_EXTENSIONS is redefined, among other redefinitions (@wolfram77)
|
|
82
82
|
#ifndef GL_VERSION
|
|
83
83
|
#define GL_VERSION 0x1f02
|
|
84
84
|
#endif
|
|
@@ -276,6 +276,8 @@ typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*);
|
|
|
276
276
|
#define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer
|
|
277
277
|
#define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress
|
|
278
278
|
|
|
279
|
+
// FIX: VK_NULL_HANDLE redefinition (@wolfram77)
|
|
280
|
+
#ifndef VK_NULL_HANDLE
|
|
279
281
|
#define VK_NULL_HANDLE 0
|
|
280
282
|
|
|
281
283
|
typedef void* VkInstance;
|
|
@@ -335,12 +337,15 @@ typedef void (APIENTRY * PFN_vkVoidFunction)(void);
|
|
|
335
337
|
|
|
336
338
|
typedef PFN_vkVoidFunction (APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance,const char*);
|
|
337
339
|
typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char*,uint32_t*,VkExtensionProperties*);
|
|
340
|
+
#endif
|
|
341
|
+
#ifndef vkGetInstanceProcAddr // This prevents redefinition errors (@wolfram77)
|
|
338
342
|
#define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr
|
|
343
|
+
#endif
|
|
339
344
|
|
|
340
345
|
#include "platform.h"
|
|
341
346
|
|
|
342
347
|
#define GLFW_NATIVE_INCLUDE_NONE
|
|
343
|
-
#include "glfw3native.h" // Adjust include path (@
|
|
348
|
+
#include "glfw3native.h" // Adjust include path (@wolfram77)
|
|
344
349
|
|
|
345
350
|
// Checks for whether the library has been initialized
|
|
346
351
|
#define _GLFW_REQUIRE_INIT() \
|
package/GLFW/platform.c
CHANGED
|
@@ -78,7 +78,7 @@ GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform)
|
|
|
78
78
|
#if !defined(_GLFW_WIN32) && !defined(_GLFW_COCOA) && !defined(_GLFW_X11) && !defined(_GLFW_WAYLAND)
|
|
79
79
|
if (desiredID == GLFW_PLATFORM_NULL)
|
|
80
80
|
return _glfwConnectNull(desiredID, platform);
|
|
81
|
-
else // FIX: _glfwConnectNull is not defined (@
|
|
81
|
+
else // FIX: _glfwConnectNull is not defined (@wolfram77)
|
|
82
82
|
#endif
|
|
83
83
|
if (count == 0)
|
|
84
84
|
{
|
package/README.md
CHANGED
|
@@ -67,33 +67,23 @@ And then include `glfw3.h` as follows:
|
|
|
67
67
|
```c
|
|
68
68
|
// main.c
|
|
69
69
|
#define GLFW_IMPLEMENTATION
|
|
70
|
-
#include
|
|
70
|
+
#include <GLFW/glfw3.h>
|
|
71
71
|
|
|
72
72
|
int main() { /* ... */ }
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Finally, compile while adding the path `node_modules/glfw.c` to your compiler's include paths.
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
$ clang main.c # or, use gcc
|
|
79
|
-
$ gcc main.c
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
You may also use a simpler approach:
|
|
83
|
-
|
|
84
|
-
```c
|
|
85
|
-
// main.c
|
|
86
|
-
#define GLFW_IMPLEMENTATION
|
|
87
|
-
#include <GLFW/glfw3.h>
|
|
88
|
-
|
|
89
|
-
int main() { /* ... */ }
|
|
78
|
+
$ clang -I./node_modules/glfw.c main.c # or, use gcc
|
|
79
|
+
$ gcc -I./node_modules/glfw.c main.c
|
|
90
80
|
```
|
|
91
81
|
|
|
92
|
-
|
|
82
|
+
You may also use a simpler approach with the [cpoach](https://www.npmjs.com/package/cpoach.sh) tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
|
|
93
83
|
|
|
94
84
|
```bash
|
|
95
|
-
$ clang
|
|
96
|
-
$ gcc
|
|
85
|
+
$ cpoach clang main.c # or, use gcc
|
|
86
|
+
$ cpoach gcc main.c
|
|
97
87
|
```
|
|
98
88
|
|
|
99
89
|
<br>
|
|
@@ -231,6 +221,7 @@ porting it to your favorite platform, join us on the forum or GitHub.
|
|
|
231
221
|
<br>
|
|
232
222
|
|
|
233
223
|
|
|
224
|
+
[](https://wolfram77.github.io)<br>
|
|
234
225
|
[](https://github.com/glfw/glfw)
|
|
235
226
|
[](https://nodef.github.io)
|
|
236
227
|

|