配置emacs+slime+sbcl+sdl库
;;------------------------------------------------------------------------------------------
;;EvilBinary 小E QQ592646022 http://blog.csdn.net/EvilBinary_root
;; 2011-5
;; 用Lisp开发游戏 环境搭建 emacs+slime+sbcl+sdl
;;------------------------------------------------------------------------------------------
;;------------------------------------------------------------------------------------------
;; 准备软件
;; 1. emacs http://mirrors.igsobe.com/gnu/emacs/windows/ 下载的当然越新,越好
;; 2. sbcl http://www.sbcl.org/platform-table.html 或 http://sourceforge.net/projects/sbcl/
;; 3. slime http://common-lisp.net/project/slime/
;; 4. lispbuilder http://code.google.com/p/lispbuilder/downloads/list 下载ispbuilder-sdl lispbuilder-sdl-gfx ;; lispbuilder-sdl-image lispbuilder-sdl-mixer
;; lispbuilder-sdl-ttf 这些是sdl开发库
;; 5. alexandria babel cffi trivial-features 这些在这个网站可以找的到
;; http://common-lisp.net/project/
;;------------------------------------------------------------------------------------------
;;------------------------------------------------------------------------------------------
;; 解压slime 到D:/Program Files/ 结果slime 在D:/Program Files/slime 下了。
;;
;;------------------------------------------------------------------------------------------
;;------------------------------------------------------------------------------------------
;; sbcl config in sbclrc file
;; 1.安装 sbcl 在 D:/Program Files/sbcl 路径下,创建site文件夹 ,
;; 解压下载的alexandria babel cffi trivial-features lispbuilder-sdl 等,修改名字对应并放入 alexandria babel cffi trivial-features lispbuilder-sdl
;; lispbuilder-sdl-gfx lispbuilder-sdl-image lispbuilder-sdl-mixer lispbuilder-sdl-ttf 等文件,一般这些就够用了
;; 2.在D:/Program Files/sbcl创建 sbclrc 文件输入下面东西 加载用的。
;;------------------------------------------------------------------------------------------
(require :asdf)
(dolist (dir (directory "D:/Program Files/sbcl//site/*/"))
(pushnew dir asdf:*central-registry* :test #'equal))
;; 或者这样
(pushnew "D:/Program Files/sbcl/site/alexandria/" asdf:*central-registry* :test #'equal)
(pushnew "D:/Program Files/sbcl/site/babel/" asdf:*central-registry* :test #'equal)
(pushnew "D:/Program Files/sbcl/site/cffi/" asdf:*central-registry* :test #'equal)
(pushnew "D:/Program Files/sbcl/site/lispbuilder-sdl/" asdf:*central-registry* :test #'equal)
(pushnew "D:/Program Files/sbcl/site/trivial-features/" asdf:*central-registry* :test #'equal)
;;------------------------------------------------------------------------------------------
;; emacs config file
;; 到 C:/Documents and Settings/Administrator/Application Data 创建emacs配置文件 _emacs或.emacs,添加下面配置
;;------------------------------------------------------------------------------------------
(add-to-list 'load-path "D:/Program Files/sbcl/")
(add-to-list 'load-path "D:/Program Files/slime/")
(setq inferior-lisp-program "sbcl")
(require 'slime-autoloads)
(slime-setup '(slime-fancy))
;;---------------------------------
;; load lispbuilder-sdl
;; 开启emacs 按alt+x 即emacs里面的(M-x)
;; 输入slime ,然后等着加载完成出现 CL-USER>
;; 后输入下面这些加载 sdl库
;;---------------------------------
(ASDF:OPERATE 'ASDF:LOAD-OP :lispbuilder-sdl)
(ASDF:OPERATE 'ASDF:LOAD-OP :lispbuilder-sdl-gfx)
(ASDF:OPERATE 'ASDF:LOAD-OP :lispbuilder-sdl-image)
(ASDF:OPERATE 'ASDF:LOAD-OP :lispbuilder-sdl-mixer)
(ASDF:OPERATE 'ASDF:LOAD-OP :lispbuilder-sdl-ttf)
(ASDF:OPERATE 'ASDF:LOAD-OP :lispbuilder-sdl-examples)
;;---------------------------------
;; example
;; 然后输入下面这些可以运行例子
;;---------------------------------
(sdl-examples:PARTICLES)
(sdl-examples:fireworks)
(sdl-examples:bmp-sample)
(sdl-examples:flood-fill)
(sdl-examples:pixels)
(sdl-examples:recursive-rects)
(sdl-examples:mouse-painter)
(sdl-examples:random-rects)
(sdl-examples:mandelbrot)
(sdl-examples:line-drawing)
(sdl-examples:vertices)
(sdl-examples:bezier)
(sdl-examples:setup-and-draw)
(sdl-examples:width-height)
(sdl-examples:objects)
(sdl-examples:points-and-lines)
(sdl-examples:distance-2D)
(sdl-examples:inbuilt-fonts)
(sdl-examples:circle)
(sdl-examples:mouse-2d)
(sdl-examples:joystick)
(sdl-examples:particles)
(sdl-examples:raw-audio-test)
(sdl-examples:audio-mixer)
(sdl-examples:keys)
(sdl-examples:image-example)
(sdl-examples:explosion)
(sdl-examples:alpha-example)
(sdl-examples:Explosion)
好了教程到此结束,希望喜欢的人可以和我联系,我打算用Lisp开发游戏。小E QQ592646022
更多推荐
所有评论(0)