Changeset 37371 in project


Ignore:
Timestamp:
03/15/19 09:27:43 (2 months ago)
Author:
kooda
Message:

Document glfw3 for CHICKEN 5

File:
1 copied

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/glfw3

    r37369 r37371  
    33
    44=== Description
    5 Bindings to the [[http://www.glfw.org/|GLFW]] OpenGL window and event management library, version 3.X. Version 3 of GLFW is not backwards compatible with previous major versions of GLFW.
    6 
    7 This egg has been tested and /should/ work with Linux, OS X, Windows, and OpenGL ES.
    8 
    9 When using with ES, make sure GLFW is appropriately compiled (e.g.: {{cmake -DGLFW_USE_EGL=ON -DGLFW_CLIENT_LIBRARY=glesv2 -DBUILD_SHARED_LIBS=ON}}). If ES support is desired on a non-ARM platform, compile this egg with the feature {{gles}} (e.g.: {{chicken-install -D gles glfw3}}). Also, for ES, do not call {{make-window}} with {{client-api}} set, or else bad things.
     5Bindings to the [[https://www.glfw.org/|GLFW]] OpenGL window and event management library, version 3.X. Version 3 of GLFW is not backwards compatible with previous major versions of GLFW.
     6
     7The CHICKEN 5 port of this egg still needs some work and testing regarding OS X and Windows support.
     8
     9When using with OpenGL ES, make sure GLFW is appropriately compiled (e.g.: {{cmake -DGLFW_USE_EGL=ON -DGLFW_CLIENT_LIBRARY=glesv2 -DBUILD_SHARED_LIBS=ON}}).
    1010
    1111When installing GLFW on OS X through Homebrew, an extra step is needed. Homebrew renames the library’s from the default. You can fix this by creating a link that points to the library that gets installed. E.g. {{sudo ln -s <homebrew-lib-dir>/libglfw3.dylib /usr/local/lib/libglfw.dylib}}
     
    1717
    1818=== Documentation
    19 glf3 is separated into two modules: {{glfw3-bindingw}} and {{glfw3}}. For almost all purposes, only {{glfw3}} should be needed.
    20 
    21 {{glfw3-bindings}} provides direct bindings to GLFW generated by [[http://wiki.call-cc.org/eggref/4/bind|bind]]. Names have been converted from camelCase to hyphenated, with GLFW prefixes removed. Constants are surrounded by {{+}}s (e.g. {{+alpha-bits+}}).
     19glfw3 is separated into two modules: {{glfw3-bindingw}} and {{glfw3}}. For almost all purposes, only {{glfw3}} should be needed.
     20
     21{{glfw3-bindings}} provides direct bindings to GLFW generated by [[https://wiki.call-cc.org/egg/bind|bind]]. Names have been converted from camelCase to hyphenated, with GLFW prefixes removed (e.g. {{glfwGetTimerValue}} becomes {{get-timer-value}}. Constants are lower-cased and surrounded by {{+}}s (e.g. {{GLFW_ALPHA_BITS}} becomes {{+alpha-bits+}}).
    2222
    2323{{glfw3}} is the high-level interface that should be used in most cases. At the moment it is largely re-exporting {{glfw3-bindings}}, although many of these functions could still use wrappers (patches welcome!). The not-exactly-the-same-as-the-glfw-api functions are described in the section [[#high-level-interface|High-level interface]].
    2424
    25 For information regarding the GLFW API, see the official [[http://www.glfw.org/documentation.html|GLFW documentation]].
     25For information regarding the GLFW API, see the official [[https://www.glfw.org/documentation.html|GLFW documentation]].
    2626
    2727
     
    3737<procedure> (make-context-current WINDOW)</procedure>
    3838
    39 Performs {{glfwMakeContextCurrent}} while setting {{window}}.
     39Performs {{glfwMakeContextCurrent}} while setting the above {{window}} parameter to the new value.
    4040
    4141<procedure> (make-window WIDTH HEIGHT NAME #!key (fullscreen? #f) (swap-interval 1) resizable visible decorated red-bits green-bits blue-bits alpha-bits depth-bits stencil-bits accum-red-bits accum-green-bits accum-blue-bits accum-alpha-bits aux-buffers samples refresh-rate sterio srgb-capable client-api context-version-major context-version-minor context-robustness opengl-forward-compat opengl-debug-context opengl-profile)</procedure>
    4242
    43 Create a window with title string {{NAME}} and dimensions {{WIDTH}} by {{HEIGHT}}. The keys correspond to the available [[http://www.glfw.org/docs/latest/window.html#window_hints|GLFW window hints]]. {{resizable}}, {{visible}}, {{decorated}}, {{sterio}}, {{srgb-capable}}, {{opengl-forward-compat}}, {{opengl-debug-context}} accept boolean arguments, while all other accept either an integer or an appropriate GLFW constant as per the documentation.
    44 
    45 Sets the current context to the window that was created. The swap interval of the window is set to the value of the {{swap-interval}} key. Finally, this initializes all of the window-specific callbacks.
    46 
    47 When using with OS X, make sure you ask for the right context. Only OS X 10.7+ support core contexts, and only limited contexts are supported. See [[http://www.glfw.org/faq.html#how-do-i-create-an-opengl-30-context|the GLFW FAQ]]. For instance:
     43Create a window with title string {{NAME}} and dimensions {{WIDTH}} by {{HEIGHT}}. The keys correspond to the available [[https://www.glfw.org/docs/latest/window.html#window_hints|GLFW window hints]]. {{resizable}}, {{visible}}, {{decorated}}, {{stereo}}, {{srgb-capable}}, {{opengl-forward-compat}}, {{opengl-debug-context}} accept boolean arguments, while all other accept either an integer or an appropriate GLFW constant as per the documentation.
     44
     45Sets the current context to the window that was created. The swap interval of the window is set to the value of the{{swap-interval}} key. Finally, this initializes all of the window-specific callbacks.
     46
     47When using with OS X, make sure you ask for the right context. Only OS X 10.7+ support core contexts, and only limited contexts are supported. See [[https://www.glfw.org/faq.html#41---how-do-i-create-an-opengl-30-context|the GLFW FAQ]]. For instance:
    4848
    4949    (make-window WIDTH HEIGHT NAME
     
    110110Called when character is entered. Expects a function with the signature {{(lambda (WINDOW CHAR) ...)}}. {{WINDOW}} is the affected window, and  {{CHAR}} is the unicode code point of the character.
    111111
     112<parameter> char-mods-callback</parameter>
     113
     114Called when character is entered, but also includes modifiers that were active when the character was entered. Expects a function with the signature {{(lambda (WINDOW CHAR MODS) ...)}}. {{WINDOW}} is the affected window, and  {{CHAR}} is the unicode code point of the character, {{MODS}} is the bitfield of the modifiers that were active.
     115
    112116<parameter> monitor-callback</parameter>
    113117
    114118Called when a monitor is connected or disconnected. Expects a function with the signature {{(lambda (MONITOR EVENT) ...)}}. {{MONITOR}} is a pointer to the affected monitor, {{EVENT}} is either {{+connected+}} or {{+disconnected+}}.
     119
     120<parameter> joystick-callback</parameter>
     121
     122Called when a joystick is plugged-in or plugged-out. Expects a function with the signature {{(lambda (JOYSTICK EVENT) ...)}}. {{JOYSTICK}} is an integer representing the joystick, {{EVENT}} is either {{+connected+}} or {{+disconnected+}}.
    115123
    116124<procedure> (set-window-position-callback! [WINDOW [CALLBACK]])</procedure>
     
    126134<procedure> (set-key-callback! [WINDOW [CALLBACK]])</procedure>
    127135<procedure> (set-char-callback! [WINDOW [CALLBACK]])</procedure>
    128 <procedure> (set-monitor-callback! [WINDOW [CALLBACK]])</procedure>
     136<procedure> (set-char-mods-callback! [WINDOW [CALLBACK]])</procedure>
     137<procedure> (set-monitor-callback! [CALLBACK])</procedure>
     138<procedure> (set-joystick-callback! [CALLBACK])</procedure>
    129139
    130140Set the callback functions associated with {{WINDOW}}. Used when the callback parameters are not desired. {{WINDOW}} defaults to {{window}}. {{CALLBACK}} defaults to an external function that calls the corresponding callback parameter.
     
    207217=== Version history
    208218
     219==== Version 0.7.0
     22015 March 2019
     221
     222* Maintenance given to [[/users/kooda|Kooda]]
     223* Port to CHICKEN 5
     224* Update to GLFW 3.2
     225* Windows and OS X support has not been tested
     226
     227
    209228==== Version 0.6.1
    21022920 November 2014
     
    261280
    262281=== Source repository
    263 Source available on [[https://github.com/AlexCharlton/glfw3-chicken|GitHub]].
    264 
    265 Bug reports and patches welcome! Bugs can be reported via GitHub or to alex.n.charlton at gmail.
    266 
    267 
    268 === Author
     282Source available [[https://www.upyum.com/cgit.cgi/glfw3-chicken/|here]].
     283
     284Bug reports and patches welcome! Bugs can be reported to kooda@upyum.com
     285
     286
     287=== Authors
    269288Alex Charlton
     289Adrien (Kooda) Ramos
    270290
    271291
Note: See TracChangeset for help on using the changeset viewer.