Comments (2)
ok, I encounter the same problem with update-camera
and still no way to use struct
and pointer to struct
at the same time.
Maybe implement update-camera
in pure Lisp is a way?
from cl-raylib.
check this example:
(defun input-keys ()
(let* ((screen-width 800)
(screen-height 450)
(ball-position (r::make-vector2 :x (/ screen-width 2.0) :y (/ screen-height 2.0))))
(unwind-protect
(progn
(r:init-window screen-width screen-height "raylib [core] example - keyboard input")
(r:set-target-fps 60)
(loop
:do
(when (r:is-key-down +key-right+)
(setf (r::vector2-x ball-position) (+ (r::vector2-x ball-position) 2.0)))
(when (r:is-key-down +key-left+)
(setf (r::vector2-x ball-position) (- (r::vector2-x ball-position) 2.0)))
(when (r:is-key-down +key-down+)
(setf (r::vector2-y ball-position) (+ (r::vector2-y ball-position) 2.0)))
(when (r:is-key-down +key-up+)
(setf (r::vector2-y ball-position) (- (r::vector2-y ball-position) 2.0)))
(r:begin-drawing)
(r:clear-background r:+raywhite+)
(r:draw-text "move the ball with arrow keys" 10 10 20 +darkgray+)
(r:draw-circle-v ball-position 50.0 +maroon+)
(r:end-drawing)
:until (r:window-should-close)))
(r:close-window))))
;; +key-right+=262
;; +key-left+=263
;; ...
;; check the others in https://github.com/longlene/cl-raylib/blob/master/src/raylib.lisp
from cl-raylib.
I'll close the issue as camera related API should be usable now.
from cl-raylib.
Related Issues (20)
- Requesting example of how to load/draw a model HOT 2
- Have you managed to compile this for the web? HOT 4
- Generate bindings via `cl-autowrap` HOT 15
- Information on camera update HOT 4
- Memory fault with struct passed by value HOT 3
- Camera first person and third person constants are not defined correctly in raylib.lisp HOT 2
- Update raylib's BINDINGS.md file HOT 2
- Add to quicklisp HOT 2
- `load-render-texture` causes a type error about `SB-SYS:SYSTEM-AREA-POINTER` HOT 3
- Supporting Vector and Matrix operations HOT 1
- Support for `raygui` HOT 12
- core_world_screen example fails to place text correctly HOT 2
- audio_sound_loading.lisp makes no sound HOT 3
- Efficient handling of RGBA translation HOT 3
- Consider adding finalizers to resource heavy objects
- Tests failed HOT 1
- cl-raylib installation issue HOT 3
- why draw-rectangle takes arguments of type integers instead of float? HOT 1
- cl-raylib support load-texture? HOT 2
- Why you deleted a constants?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cl-raylib.