New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

deps-opengl-raub

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deps-opengl-raub

Binaries and headers for OpenGL-dependent addons

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
decreased by-6.17%
Maintainers
1
Weekly downloads
 
Created
Source

OpenGL binaries

This is a part of Node3D project.

NPM CodeFactor

npm i deps-opengl-raub

Synopsis

This dependency package is distributing OpenGL, GLFW3 and GLEW binaries through NPM for Node.js addons.

  • Platforms (x64): Windows, Linux, OSX.
  • Libraries: GLEW 2.1, GLFW 3.3, OpenGL.
  • Linking: static dll-type.

Usage

Example binding.gyp

As in glfw-raub Node.js addon.

{
	'variables': {
		'bin'        : '<!(node -p "require(\'addon-tools-raub\').bin")',
		'gl_include' : '<!(node -p "require(\'deps-opengl-raub\').include")',
		'gl_bin'     : '<!(node -p "require(\'deps-opengl-raub\').bin")',
	},
	'targets': [
		{
			'target_name': 'glfw',
			'sources': [
				'cpp/bindings.cpp',
				'cpp/events.cpp',
				'cpp/glfw.cpp',
			],
			'include_dirs': [
				'<(gl_include)',
				'<!@(node -p "require(\'addon-tools-raub\').include")',
			],
			'cflags!': ['-fno-exceptions'],
			'cflags_cc!': ['-fno-exceptions'],
			'library_dirs': ['<(gl_bin)'],
			'conditions': [
				[
					'OS=="linux"',
					{
						'libraries': [
							"-Wl,-rpath,'$$ORIGIN'",
							"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-opengl-raub/<(bin)'",
							"-Wl,-rpath,'$$ORIGIN/../../deps-opengl-raub/<(bin)'",
							'<(gl_bin)/libglfw.so.3',
							'<(gl_bin)/libGL.so',
							'<(gl_bin)/libXrandr.so',
						],
						'defines': ['__linux__'],
					}
				],
				[
					'OS=="mac"',
					{
						'libraries': [
							'-Wl,-rpath,@loader_path',
							'-Wl,-rpath,@loader_path/../node_modules/deps-opengl-raub/<(bin)',
							'-Wl,-rpath,@loader_path/../../deps-opengl-raub/<(bin)',
							'<(gl_bin)/glfw.dylib',
						],
						'defines': ['__APPLE__'],
					}
				],
				[
					'OS=="win"',
					{
						'libraries': [ 'glfw3dll.lib', 'opengl32.lib' ],
						'defines' : [
							'WIN32_LEAN_AND_MEAN',
							'VC_EXTRALEAN',
							'_WIN32',
						],
						'msvs_settings' : {
							'VCCLCompilerTool' : {
								'AdditionalOptions' : [
									'/O2','/Oy','/GL','/GF','/Gm-',
									'/EHsc','/MT','/GS','/Gy','/GR-','/Gd',
								]
							},
							'VCLinkerTool' : {
								'AdditionalOptions' : ['/OPT:REF','/OPT:ICF','/LTCG']
							},
						},
					},
				],
			],
		},
	],
}

addon.cpp

#include <GL/glew.h>

#define GLFW_NO_GLU
#define GLFW_DLL
#include <GLFW/glfw3.h>


// Platform specific windows and contexts if needed

#ifdef _WIN32
	#define GLFW_EXPOSE_NATIVE_WIN32
	#define GLFW_EXPOSE_NATIVE_WGL
#elif __APPLE__
	#define GLFW_EXPOSE_NATIVE_COCOA
	#define GLFW_EXPOSE_NATIVE_NSGL
#elif __linux__
	#define GLFW_EXPOSE_NATIVE_X11
	#define GLFW_EXPOSE_NATIVE_GLX
#endif
#include <GLFW/glfw3native.h>


// Fix bad defines for unix compilation

#undef True
#undef False

Refer to GLFW and GLEW official docs.


GLFW

This software uses the GLFW open source library. GLFW is legally used under the ZLIB license. It is explicitly stated that GLFW can be used commercially in closed-source projects. GLFW licensing information (a COPY) is given in a separate file, which also can be found on GLFW's official repository. Windows, Linux, and OSX binaries are built with GitHub Actions.

GLEW

Also this software uses the GLEW open source library. GLEW is legally used under it's own custom license. It is explicitly stated that GLEW can be used commercially in closed-source projects. GLEW licensing information (a COPY) is given in a separate file, which also can be found on GLEW's official repository. Windows, Linux, and OSX binaries are built with GitHub Actions.

OpenGL

End users, independent software vendors, and others writing code based on the OpenGL API are free from licensing requirements. https://www.opengl.org/about/#11


The rest of this package is MIT licensed.

Keywords

FAQs

Package last updated on 25 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc