Skip to content

Remove glfw from the engine builds #8296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/engine/src/engine_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <dlib/time.h>
#include <dlib/thread.h>
#include <dmsdk/graphics/glfw/glfw.h>
#include <glfw/glfw.h>
#endif

#include "engine.h"
Expand Down
6 changes: 4 additions & 2 deletions engine/engine/src/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ def build(bld):
android_jar_paths = [
'%s/ext/share/java/android-support-multidex.jar' % (dynamo_home),
'%s/ext/share/java/androidx-multidex.jar' % (dynamo_home),
'%s/share/java/glfw_android.jar' % (dynamo_home),
'%s/ext/share/java/glfw_android.jar' % (dynamo_home),
'%s/share/java/gamesys_android.jar' % (dynamo_home),
'%s/share/java/sound_android.jar' % (dynamo_home)]

web_libs = ['library_glfw.js', 'library_sys.js', 'library_script.js', 'library_sound.js']
glfw_js = '../../../ext/lib/%s/js/library_glfw.js' % bld.env.PLATFORM

web_libs = [glfw_js, 'library_sys.js', 'library_script.js', 'library_sound.js']

main_cpp = 'common/main.cpp'

Expand Down
2 changes: 1 addition & 1 deletion engine/extension/src/extension_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

#include <dmsdk/graphics/glfw/glfw.h>
#include <glfw/glfw.h>
#include <dmsdk/dlib/android.h>

namespace dmAndroid
Expand Down
2 changes: 1 addition & 1 deletion engine/extension/src/extension_ios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// specific language governing permissions and limitations under the License.

#include "extension.h"
#include <dmsdk/graphics/glfw/glfw.h>
#include <glfw/glfw.h>

namespace dmExtension
{
Expand Down
2 changes: 1 addition & 1 deletion engine/gameobject/src/gameobject/test/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def build(bld):
includes = '../../../src . .. ../../../proto',
source = ['test_main.cpp'] + bld.path.ant_glob('%s/*' % (dir), incl=exts),
exported_symbols = exported_symbols,
use = 'TESTMAIN APP SOCKET PLATFORM_THREAD RESOURCE DDF SCRIPT LUA EXTENSION DLIB PROFILE_NULL RIG HID gameobject',
use = 'TESTMAIN APP SOCKET PLATFORM_THREAD RESOURCE DDF SCRIPT LUA EXTENSION DLIB PLATFORM_NULL PROFILE_NULL RIG HID gameobject',
web_libs = ['library_sys.js', 'library_script.js'],
proto_gen_py = True,
target = 'test_gameobject_%s' % dir)
Expand Down
4 changes: 3 additions & 1 deletion engine/gamesys/src/gamesys/test/fontview/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ def build(bld):
if bld.env['PLATFORM'] in ('x86_64-macos','arm64-macos'):
bld.env.append_value('LINKFLAGS', ['-framework', 'IOKit'])

glfw_js = '../../../ext/lib/%s/js/library_glfw.js' % bld.env.PLATFORM

font_viewer = bld.program(features = flist,
source = 'fontview.cpp deja_vu_sans.font vera_mo_bd.font font.vp font.fp font.material',
use = 'RENDER CRASH GRAPHICS RESOURCE HID DDF DMGLFW OPENGL SOCKET SCRIPT LUA EXTENSION DLIB PROFILE_NULL PLATFORM X gamesys',
web_libs = ['library_sys.js', 'library_glfw.js'],
web_libs = ['library_sys.js', glfw_js],
includes = ['../../../../src', '../../../build'],
target = 'fontview')
font_viewer.install_path = None
2 changes: 1 addition & 1 deletion engine/graphics/src/glfw.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
#if !defined(DM_GLFW_H)
#define DM_GLFW_H

#include <dmsdk/graphics/glfw/glfw.h>
#include <glfw/glfw.h>

#endif
2 changes: 1 addition & 1 deletion engine/graphics/src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "graphics_adapter.h"

#if defined(DM_PLATFORM_IOS)
#include <graphics/glfw/glfw_native.h> // for glfwAppBootstrap
#include <glfw/glfw_native.h> // for glfwAppBootstrap
#endif
#include <string.h>
#include <assert.h>
Expand Down
4 changes: 2 additions & 2 deletions engine/graphics/src/graphics_glfw_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

#include <dmsdk/graphics/glfw/glfw.h>
#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw.h>
#include <glfw/glfw_native.h>
#include "graphics_native.h"

namespace dmGraphics
Expand Down
2 changes: 1 addition & 1 deletion engine/graphics/src/opengl/async/job_queue_threaded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <dlib/condition_variable.h>
#include <dlib/array.h>

#include <dmsdk/graphics/glfw/glfw.h>
#include <glfw/glfw.h>

#include "job_queue.h"

Expand Down
4 changes: 2 additions & 2 deletions engine/graphics/src/opengl/graphics_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include <Carbon/Carbon.h>
#endif

#include <dmsdk/graphics/glfw/glfw.h>
#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw.h>
#include <glfw/glfw_native.h>

#if defined(__linux__) && !defined(ANDROID)
#include <GL/glext.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <dlib/math.h>
#include <dlib/array.h>

#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw_native.h>
#include <android_native_app_glue.h>

#include "../graphics_vulkan_defines.h"
Expand Down
4 changes: 2 additions & 2 deletions engine/graphics/src/vulkan/graphics_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

#include <dmsdk/graphics/glfw/glfw.h>
#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw.h>
#include <glfw/glfw_native.h>

#include <dlib/log.h>
#include "../vulkan/graphics_vulkan_defines.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <dlib/math.h>
#include <dlib/array.h>

#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw_native.h>

#include "../graphics_vulkan_defines.h"
#include "../../graphics.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <string.h>

#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw_native.h>

#include <dlib/math.h>
#include <dlib/array.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <dlib/math.h>
#include <dlib/array.h>

#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw_native.h>
#include <objc/objc.h>

#if defined(DM_PLATFORM_MACOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <string.h>

#include <graphics/glfw/glfw_native.h>
#include <glfw/glfw_native.h>
#include <vulkan/vulkan_win32.h>

namespace dmGraphics
Expand Down
2 changes: 1 addition & 1 deletion engine/gui/src/test/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def create_simple_protoc_task(name, ext, compiled_ext, type, before, shell = Tru
create_simple_protoc_task('particle_fx', '.particlefx', '.particlefxc', 'dmParticleDDF.ParticleFX', before='c cxx')

def build(bld):
uselib = ['TESTMAIN', 'APP', 'SCRIPT', 'EXTENSION', 'RESOURCE', 'PARTICLE', 'RIG', 'HID_NULL', 'DDF', 'DLIB', 'PROFILE_NULL', 'SOCKET', 'LUA', 'GRAPHICS_PROTO']
uselib = ['TESTMAIN', 'APP', 'SCRIPT', 'EXTENSION', 'RESOURCE', 'PARTICLE', 'RIG', 'HID_NULL', 'DDF', 'DLIB', 'PROFILE_NULL', 'PLATFORM_NULL', 'SOCKET', 'LUA', 'GRAPHICS_PROTO']

test_gui = bld.program(features = 'cxx cprogram embed test',
includes = '. ..',
Expand Down
154 changes: 74 additions & 80 deletions engine/hid/src/dmsdk/hid/glfw/hid_native_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// Copyright 2009-2014 Ragnar Svensson, Christian Murray
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
//
// You may obtain a copy of the License, together with FAQs at
// https://www.defold.com/license
//
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
Expand All @@ -15,12 +15,7 @@
#ifndef HID_NATIVE_DEFINES_H
#define HID_NATIVE_DEFINES_H

// NOTE! This include is for internal use only!
// Do not rely on the fact that this file is here at all!
// We only use it to get the correct constant values
#include <dmsdk/graphics/glfw/glfw.h>

#define HID_NATIVE_MAX_GAMEPAD_COUNT GLFW_JOYSTICK_LAST + 1
#define HID_NATIVE_MAX_GAMEPAD_COUNT 16
#define HID_NATIVE_MAX_KEYBOARD_COUNT 1
#define HID_NATIVE_MAX_MOUSE_COUNT 1
#define HID_NATIVE_MAX_TOUCH_DEVICE_COUNT 1
Expand Down Expand Up @@ -107,77 +102,76 @@
#define HID_KEY_RBRACE '}'
#define HID_KEY_TILDE '~'

#define HID_KEY_ESC GLFW_KEY_ESC
#define HID_KEY_F1 GLFW_KEY_F1
#define HID_KEY_F2 GLFW_KEY_F2
#define HID_KEY_F3 GLFW_KEY_F3
#define HID_KEY_F4 GLFW_KEY_F4
#define HID_KEY_F5 GLFW_KEY_F5
#define HID_KEY_F6 GLFW_KEY_F6
#define HID_KEY_F7 GLFW_KEY_F7
#define HID_KEY_F8 GLFW_KEY_F8
#define HID_KEY_F9 GLFW_KEY_F9
#define HID_KEY_F10 GLFW_KEY_F10
#define HID_KEY_F11 GLFW_KEY_F11
#define HID_KEY_F12 GLFW_KEY_F12
#define HID_KEY_UP GLFW_KEY_UP
#define HID_KEY_DOWN GLFW_KEY_DOWN
#define HID_KEY_LEFT GLFW_KEY_LEFT
#define HID_KEY_RIGHT GLFW_KEY_RIGHT
#define HID_KEY_LSHIFT GLFW_KEY_LSHIFT
#define HID_KEY_RSHIFT GLFW_KEY_RSHIFT
#define HID_KEY_LCTRL GLFW_KEY_LCTRL
#define HID_KEY_RCTRL GLFW_KEY_RCTRL
#define HID_KEY_LALT GLFW_KEY_LALT
#define HID_KEY_RALT GLFW_KEY_RALT
#define HID_KEY_TAB GLFW_KEY_TAB
#define HID_KEY_ENTER GLFW_KEY_ENTER
#define HID_KEY_BACKSPACE GLFW_KEY_BACKSPACE
#define HID_KEY_INSERT GLFW_KEY_INSERT
#define HID_KEY_DEL GLFW_KEY_DEL
#define HID_KEY_PAGEUP GLFW_KEY_PAGEUP
#define HID_KEY_PAGEDOWN GLFW_KEY_PAGEDOWN
#define HID_KEY_HOME GLFW_KEY_HOME
#define HID_KEY_END GLFW_KEY_END

#define HID_KEY_KP_0 GLFW_KEY_KP_0
#define HID_KEY_KP_1 GLFW_KEY_KP_1
#define HID_KEY_KP_2 GLFW_KEY_KP_2
#define HID_KEY_KP_3 GLFW_KEY_KP_3
#define HID_KEY_KP_4 GLFW_KEY_KP_4
#define HID_KEY_KP_5 GLFW_KEY_KP_5
#define HID_KEY_KP_6 GLFW_KEY_KP_6
#define HID_KEY_KP_7 GLFW_KEY_KP_7
#define HID_KEY_KP_8 GLFW_KEY_KP_8
#define HID_KEY_KP_9 GLFW_KEY_KP_9
#define HID_KEY_KP_DIVIDE GLFW_KEY_KP_DIVIDE
#define HID_KEY_KP_MULTIPLY GLFW_KEY_KP_MULTIPLY
#define HID_KEY_KP_SUBTRACT GLFW_KEY_KP_SUBTRACT
#define HID_KEY_KP_ADD GLFW_KEY_KP_ADD
#define HID_KEY_KP_DECIMAL GLFW_KEY_KP_DECIMAL
#define HID_KEY_KP_EQUAL GLFW_KEY_KP_EQUAL
#define HID_KEY_KP_ENTER GLFW_KEY_KP_ENTER
#define HID_KEY_KP_NUM_LOCK GLFW_KEY_KP_NUM_LOCK
#define HID_KEY_CAPS_LOCK GLFW_KEY_CAPS_LOCK
#define HID_KEY_SCROLL_LOCK GLFW_KEY_SCROLL_LOCK
#define HID_KEY_PAUSE GLFW_KEY_PAUSE
#define HID_KEY_LSUPER GLFW_KEY_LSUPER
#define HID_KEY_RSUPER GLFW_KEY_RSUPER
#define HID_KEY_MENU GLFW_KEY_MENU
#define HID_KEY_BACK GLFW_KEY_BACK

#define HID_KEY_MAX HID_KEY_BACK

#define HID_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_LEFT
#define HID_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_MIDDLE
#define HID_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_RIGHT
#define HID_MOUSE_BUTTON_1 GLFW_MOUSE_BUTTON_1
#define HID_MOUSE_BUTTON_2 GLFW_MOUSE_BUTTON_2
#define HID_MOUSE_BUTTON_3 GLFW_MOUSE_BUTTON_3
#define HID_MOUSE_BUTTON_4 GLFW_MOUSE_BUTTON_4
#define HID_MOUSE_BUTTON_5 GLFW_MOUSE_BUTTON_5
#define HID_MOUSE_BUTTON_6 GLFW_MOUSE_BUTTON_6
#define HID_MOUSE_BUTTON_7 GLFW_MOUSE_BUTTON_7
#define HID_MOUSE_BUTTON_8 GLFW_MOUSE_BUTTON_8
#define HID_SPECIAL_START 256
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

#define HID_KEY_ESC (HID_SPECIAL_START+0)
#define HID_KEY_F1 (HID_SPECIAL_START+1)
#define HID_KEY_F2 (HID_SPECIAL_START+2)
#define HID_KEY_F3 (HID_SPECIAL_START+3)
#define HID_KEY_F4 (HID_SPECIAL_START+4)
#define HID_KEY_F5 (HID_SPECIAL_START+5)
#define HID_KEY_F6 (HID_SPECIAL_START+6)
#define HID_KEY_F7 (HID_SPECIAL_START+7)
#define HID_KEY_F8 (HID_SPECIAL_START+8)
#define HID_KEY_F9 (HID_SPECIAL_START+9)
#define HID_KEY_F10 (HID_SPECIAL_START+10)
#define HID_KEY_F11 (HID_SPECIAL_START+11)
#define HID_KEY_F12 (HID_SPECIAL_START+12)
#define HID_KEY_UP (HID_SPECIAL_START+13)
#define HID_KEY_DOWN (HID_SPECIAL_START+14)
#define HID_KEY_LEFT (HID_SPECIAL_START+15)
#define HID_KEY_RIGHT (HID_SPECIAL_START+16)
#define HID_KEY_LSHIFT (HID_SPECIAL_START+17)
#define HID_KEY_RSHIFT (HID_SPECIAL_START+18)
#define HID_KEY_LCTRL (HID_SPECIAL_START+19)
#define HID_KEY_RCTRL (HID_SPECIAL_START+20)
#define HID_KEY_LALT (HID_SPECIAL_START+21)
#define HID_KEY_RALT (HID_SPECIAL_START+22)
#define HID_KEY_TAB (HID_SPECIAL_START+23)
#define HID_KEY_ENTER (HID_SPECIAL_START+24)
#define HID_KEY_BACKSPACE (HID_SPECIAL_START+25)
#define HID_KEY_INSERT (HID_SPECIAL_START+26)
#define HID_KEY_DEL (HID_SPECIAL_START+27)
#define HID_KEY_PAGEUP (HID_SPECIAL_START+28)
#define HID_KEY_PAGEDOWN (HID_SPECIAL_START+29)
#define HID_KEY_HOME (HID_SPECIAL_START+30)
#define HID_KEY_END (HID_SPECIAL_START+31)

#define HID_KEY_KP_0 (HID_SPECIAL_START+32)
#define HID_KEY_KP_1 (HID_SPECIAL_START+33)
#define HID_KEY_KP_2 (HID_SPECIAL_START+34)
#define HID_KEY_KP_3 (HID_SPECIAL_START+35)
#define HID_KEY_KP_4 (HID_SPECIAL_START+36)
#define HID_KEY_KP_5 (HID_SPECIAL_START+37)
#define HID_KEY_KP_6 (HID_SPECIAL_START+38)
#define HID_KEY_KP_7 (HID_SPECIAL_START+39)
#define HID_KEY_KP_8 (HID_SPECIAL_START+40)
#define HID_KEY_KP_9 (HID_SPECIAL_START+41)
#define HID_KEY_KP_DIVIDE (HID_SPECIAL_START+42)
#define HID_KEY_KP_MULTIPLY (HID_SPECIAL_START+43)
#define HID_KEY_KP_SUBTRACT (HID_SPECIAL_START+44)
#define HID_KEY_KP_ADD (HID_SPECIAL_START+45)
#define HID_KEY_KP_DECIMAL (HID_SPECIAL_START+46)
#define HID_KEY_KP_EQUAL (HID_SPECIAL_START+47)
#define HID_KEY_KP_ENTER (HID_SPECIAL_START+48)
#define HID_KEY_KP_NUM_LOCK (HID_SPECIAL_START+49)
#define HID_KEY_CAPS_LOCK (HID_SPECIAL_START+50)
#define HID_KEY_SCROLL_LOCK (HID_SPECIAL_START+51)
#define HID_KEY_PAUSE (HID_SPECIAL_START+52)
#define HID_KEY_LSUPER (HID_SPECIAL_START+53)
#define HID_KEY_RSUPER (HID_SPECIAL_START+54)
#define HID_KEY_MENU (HID_SPECIAL_START+55)
#define HID_KEY_BACK (HID_SPECIAL_START+56)

#define HID_MOUSE_BUTTON_LEFT 0
#define HID_MOUSE_BUTTON_MIDDLE 1
#define HID_MOUSE_BUTTON_RIGHT 2
#define HID_MOUSE_BUTTON_1 3
#define HID_MOUSE_BUTTON_2 4
#define HID_MOUSE_BUTTON_3 5
#define HID_MOUSE_BUTTON_4 6
#define HID_MOUSE_BUTTON_5 7
#define HID_MOUSE_BUTTON_6 8
#define HID_MOUSE_BUTTON_7 9
#define HID_MOUSE_BUTTON_8 10

#endif
Loading