Updating glfw to the latest version

Updating glfw to the latest version
0

#1

Hello,

Since there is a big vsync problem in mojave i need to update glfw to the latest commit. I downloaded and compiled glfw made a dylib file and added it to my project along with glfw3.h and glfw3native.h. This fails to compile and get the following errors

Reference to ‘Size’ is ambiguous.
Reference to ‘Point’ is ambiguous.

Simple but long option would be adding cocos2d:: before each point/size. Is there any other way to do this?


#2

i compiled glfw into static lib, then replace libglfw3.a in “prebuilt” folder and glfw3.h in “include” folder of cocos2d-x, nothing else, no problems with “ambiguous” errors.


#3

Maybe I’m compiling it wrong… Is it possible for you to send me the libglfw3.a?
Thanks


#4

My libglfw3.a is not from last commit, it was about 1-2 month ago. Maybe better to post full tutorial how to compile to static lib?


#5

sure a tutorial would be great. is your vsync problem fixed?


#6

My mac mid-2010 can’t run mojave, but my friend with 2019 mac book pro report no problems with vsync.


#7

Trying your files wont hurt :D. I can let you know if the vsync is fixed in your version. since its hard to notice it.


#8

https://drive.google.com/open?id=1g8wbe43g-L8fwL8ht2v5lnu2RI8cTiPt


#9

Yes, please.


#10

Try “using namespace cocos2d”


#11

@hexerror hey! thanks for the files. It doesn’t have the vsync fix.

Took me a 1.5 hrs but I included the new glfw by adding cocos2d:: to all Point, Rect and Size. Just to see if the problem is fixed and it is. Gameplay is running perfectly smooth. This was tested on latest macbook 2018.

but above fix is not recommended. I need to make static libraries like you did.


#12

Ok, compile instructions:

  1. clone glfw git: open terminal, type “git clone https://github.com/glfw/glfw”, wait for clone complete, cd to glfw folder
  2. run cmake gui utility (if dont have it, install from https://cmake.org), press “Browse Source…” and select glfw folder, then press “Browse Build…” and select build folder (i prefer create “bin” folder inside glfw folder), then press “Configure” button, wait for config script complete, on main screen make sure BUIL_SHARED_LIBS unchecked (unchecked by default), set CMAKE_OSX_DEPLOYMENT_TARGET as you wish (my games support osx since osx 10.9), then press “Generate” button.
  3. cd to build folder (“bin” in my example), open GLFW.xcodeproj in xcode, on top of xcode window, next to run and stop buttons, press drop-down projects menu and select “glfw”, then in xcode global menu select Product->build for->Running (for debug build) and Product->build for->Profilling (for release build), wait fo compile, then go to src->Debug(or Release) subfolder, and get fresh libglfw3.a :slight_smile:

closed #13

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.