Skip to content

Commit

Permalink
Include glfw native routines. Remove redundant libglfw library def
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Oct 21, 2018
1 parent 3f912bd commit 3165bfa
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 34 deletions.
6 changes: 2 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ install:
- >
sh -c "
pacman --needed --noconfirm -S zip unzip base-devel %PACKAGES% &&
curl -L http://bodge.borodust.org/files/install.sh | sh &&
curl -L http://bodge.borodust.org/files/c2ffi-windows-x86_64.zip -o /tmp/c2ffi.zip &&
cd ~/bin/ && unzip /tmp/c2ffi.zip
curl -L http://bodge.borodust.org/files/install.sh | sh
"
build_script:
Expand All @@ -52,7 +50,7 @@ build_script:
export PATH=$HOME/bin/:$PATH
&& rm -rf %APPVEYOR_BUILD_DIR%/spec/*
&& ln -s %APPVEYOR_BUILD_DIR%/ ~/quicklisp/local-projects/
&& $HOME/bin/lisp %APPVEYOR_BUILD_DIR%/regen-spec.lisp %TARGET_ARCH% '%ASDF_SYSTEM%'
&& $HOME/bin/lisp %APPVEYOR_BUILD_DIR%/regen-spec.lisp '%ASDF_SYSTEM%' t %TARGET_ARCH%
&& cd ~/quicklisp/local-projects/%ASDF_SYSTEM%/ && zip -r spec.zip spec/
&& mv ~/quicklisp/local-projects/%ASDF_SYSTEM%/spec.zip %APPVEYOR_BUILD_DIR%/
"
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ before_install:
install:
- git submodule update --init --recursive
- curl -L http://bodge.borodust.org/files/install.sh | sh
- curl -L http://bodge.borodust.org/files/c2ffi-$TRAVIS_OS_NAME-$TARGET_ARCH.zip -o /tmp/c2ffi.zip
- cd ~/bin/ && unzip /tmp/c2ffi.zip
- ln -s $TRAVIS_BUILD_DIR/ ~/quicklisp/local-projects/$ASDF_SYSTEM

script:
Expand All @@ -68,7 +66,7 @@ script:
-DGLFW_BUILD_EXAMPLES=OFF . && \
make
- rm -rf $TRAVIS_BUILD_DIR/spec/*
- lisp "$TRAVIS_BUILD_DIR/regen-spec.lisp" $TARGET_ARCH "$ASDF_SYSTEM"
- lisp "$TRAVIS_BUILD_DIR/regen-spec.lisp" "$ASDF_SYSTEM" t $TARGET_ARCH
- cd $TRAVIS_BUILD_DIR/ && zip -r spec.zip spec/

before_deploy:
Expand Down
1 change: 0 additions & 1 deletion bodge-glfw.asd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
:depends-on (alexandria cffi claw)
:serial t
:components ((:file "packages")
(:file "libglfw")
(:static-file "bodge_glfw.h")
(:file "claw")
(:file "glfw")
Expand Down
10 changes: 10 additions & 0 deletions bodge_glfw.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@

#include "GLFW/glfw3.h"

#if defined(_WIN32)
# define GLFW_EXPOSE_NATIVE_WIN32 1
#elif defined(__APPLE__)
# define GLFW_EXPOSE_NATIVE_COCOA 1
#else
# define GLFW_EXPOSE_NATIVE_X11 1
#endif

#include "GLFW/glfw3native.h"

#endif /* _BODGE_GLFW_H_ */
5 changes: 1 addition & 4 deletions claw.lisp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
(claw:c-include "bodge_glfw.h" bodge-glfw
:in-package :%glfw
:includes (:glfw-includes)
:in-package :%glfw
:include-definitions ("(glfw|GLFW)\\w*")
:exclude-definitions ("^(GL|gl)(?!(FW|fw))\\w*"
"^PFN\\w*"
"glfwGetProcAddress")
:rename-symbols (claw:by-removing-prefixes "glfw" "GLFW" "GLFW_"))
2 changes: 1 addition & 1 deletion example.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(when (= (%glfw:init) 0)
(error "Failed to init GLFW"))
;; Create a windowed mode window and its OpenGL context
(claw:c-with ((window %glfw:window :from (%glfw:create-window 640 480 "Hello World" nil nil)))
(let ((window (%glfw:create-window 640 480 "Hello World" nil nil)))
(when (claw:null-pointer-p window)
(%glfw:terminate)
(error "Failed to create GLFW window"))
Expand Down
5 changes: 0 additions & 5 deletions libglfw.lisp

This file was deleted.

3 changes: 1 addition & 2 deletions packages.lisp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(cl:defpackage :glfw
(:use :cl :claw :alexandria)
(:export libglfw
define-key-callback
(:export define-key-callback
define-window-close-callback
define-mouse-button-callback
define-cursor-pos-callback
Expand Down
9 changes: 1 addition & 8 deletions regen-spec.lisp
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
(bind-arguments *target-arch* *system-name*)
(script "install-testing-dist")

(ql:register-local-projects)
(ql:quickload :claw)

(let ((claw::*local-cpu* *target-arch*)
(claw::*trace-c2ffi* t))
(ql:quickload *system-name*))
(script "regen-spec")
2 changes: 1 addition & 1 deletion spec/bodge_glfw.i686-apple-darwin-gnu.spec

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/bodge_glfw.i686-pc-linux-gnu.spec

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/bodge_glfw.i686-pc-windows-gnu.spec

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/bodge_glfw.x86_64-apple-darwin-gnu.spec

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/bodge_glfw.x86_64-pc-linux-gnu.spec

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/bodge_glfw.x86_64-pc-windows-gnu.spec

Large diffs are not rendered by default.

0 comments on commit 3165bfa

Please sign in to comment.