-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
3-shot.gif: a.pomf.se/rbeyhg.gif | ||
aim-fire-v2.gif: a.pomf.se/otywjt.gif | ||
aim-fire-v3.gif: a.pomf.se/akymqn.gif | ||
aim-firing.gif: a.pomf.se/ktcuvy.gif | ||
better-firing-code.gif: a.pomf.se/rowona.gif | ||
firing.gif: a.pomf.se/vgfvzz.gif | ||
offset.gif: a.pomf.se/fjitpq.gif | ||
simple-bb-collision.gif: a.pomf.se/sutjog.gif | ||
take-damage!.gif: a.pomf.se/dmqsbs.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
20000 entities.gif: a.pomf.se/bnnpxz.gif | ||
collecting game.gif: a.pomf.se/ncsqtm.gif | ||
fixed my timestep.gif: a.pomf.se/tkltdt.gif | ||
higher level lisp api.gif: a.pomf.se/ebvxte.gif | ||
multiple windows.gif: a.pomf.se/zqdcub.gif | ||
opengl.gif: a.pomf.se/dmrjmr.gif | ||
pong.gif: a.pomf.se/dmbxrx.gif | ||
sprite animation.gif: a.pomf.se/npujwk.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ql:quickload "cl-liballegro") | ||
(defclass window (al:system) () | ||
(:default-initargs :display-flags '(:windowed :opengl :resizable) | ||
:title "Hurray!")) | ||
|
||
(defmethod al:render ((sys window)) | ||
(al:clear-to-color (al:map-rgb 20 150 100)) | ||
(al:flip-display)) | ||
|
||
(defmethod al:key-down-handler ((sys window)) | ||
(print (al:keycode-of (al:event sys)))) | ||
|
||
(defun main () | ||
(al:run-system (make-instance 'window))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
(ql:quickload "cl-liballegro") | ||
(ql:quickload "cl-opengl") | ||
|
||
|
||
(defparameter *vert-shader* | ||
"#version 330 core | ||
layout(location = 0) in vec3 vertexPosition_modelspace; | ||
void main() { | ||
gl_Position.xyz = vertexPosition_modelspace; | ||
gl_Position.w = 1.0; | ||
}") | ||
(defparameter *frag-shader* | ||
"#version 330 core | ||
out vec3 color; | ||
void main() { | ||
color = vec3(0.5,0.5,0.5); | ||
}") | ||
|
||
(defclass game (al:system) | ||
((vao :accessor vao) | ||
(vb :accessor vb) | ||
(vertex-shader :accessor vertex-shader) | ||
(fragment-shader :accessor fragment-shader) | ||
(program :accessor program)) | ||
(:default-initargs | ||
:width 300 :height 300 | ||
:title "YEAH" | ||
:logic-fps 1 | ||
:display-flags '(:opengl :opengl-3-0) | ||
:display-options '((:sample-buffers 1 :suggest) | ||
(:samples 8 :suggest)))) | ||
|
||
(defmethod al:system-loop :before ((sys game)) | ||
(setf (vao sys) (gl:gen-vertex-arrays 1)) | ||
(setf (vb sys) (gl:gen-buffers 1)) | ||
(gl:bind-vertex-array (first (vao sys))) | ||
(gl:bind-buffer :array-buffer (first (vb sys))) | ||
(let ((vert-data #(-1.0 -1.0 0.0 | ||
1.0 -1.0 0.0 | ||
0.0 1.0 0.0)) | ||
(arr (gl:alloc-gl-array :float 9))) | ||
(dotimes (i (length vert-data)) | ||
(setf (gl:glaref arr i) (aref vert-data i))) | ||
(gl:buffer-data :array-buffer :static-draw arr) | ||
(gl:free-gl-array arr)) | ||
(let ((vs (gl:create-shader :vertex-shader)) | ||
(fs (gl:create-shader :fragment-shader))) | ||
(setf (vertex-shader sys) vs) | ||
(setf (fragment-shader sys) fs) | ||
(gl:shader-source vs *vert-shader*) | ||
(gl:compile-shader vs) | ||
(gl:shader-source fs *frag-shader*) | ||
(gl:compile-shader fs) | ||
(setf (program sys) (gl:create-program)) | ||
(gl:attach-shader (program sys) vs) | ||
(gl:attach-shader (program sys) fs) | ||
(print (gl:get-shader-info-log vs)) | ||
(print (gl:get-shader-info-log fs)) | ||
(gl:link-program (program sys)))) | ||
|
||
(defmethod al:update ((sys game)) | ||
(print 'one-logic-fps)) | ||
(defmethod al:render ((sys game)) | ||
(gl:clear-color 0.0 0.0 0.0 1.0) | ||
(gl:clear :color-buffer-bit) | ||
(gl:matrix-mode :projection) | ||
(gl:load-identity) | ||
(gl:use-program (program sys)) | ||
(gl:enable-vertex-attrib-array 0) | ||
(gl:bind-buffer :array-buffer (first (vb sys))) | ||
(gl:vertex-attrib-pointer 0 3 :float :false 0 (cffi:null-pointer)) | ||
(gl:draw-arrays :triangles 0 3) | ||
(gl:disable-vertex-attrib-array 0) | ||
(gl:use-program 0) | ||
(al:flip-display)) | ||
|
||
(defun main () | ||
(al:run-system (make-instance 'game))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others. | ||
See source files for details. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
``Software''), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
Copyright © 2008-2010 the Allegro 5 Development Team | ||
|
||
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. | ||
|
||
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: | ||
|
||
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. | ||
|
||
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. | ||
|
||
This notice may not be removed or altered from any source distribution. | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The allegro5 DLL is actually of 5.1 and not 5.0 like the rest. Keep that in mind if you run into any problems. |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters