• R/O
  • SSH

rulp: 提交

The main repository for rulp in Mercurial


Commit MetaInfo

修订版f964dff7e1de457aef2f2c101f5077a179b05bdf (tree)
时间2022-04-10 08:53:45
作者Giulio De Stasio <giuliods@user...>
CommiterGiulio De Stasio

Log Message

scaffolding and new asdf system

更改概述

差异

diff -r b30940a5b53e -r f964dff7e1de .hgignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,10 @@
1+syntax: glob
2+
3+TODOs.org
4+*git
5+*.out
6+*.fasl
7+rulp
8+*.deb
9+*.rpm
10+*~undo-tree~
diff -r b30940a5b53e -r f964dff7e1de LICENCE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENCE Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,674 @@
1+ GNU GENERAL PUBLIC LICENSE
2+ Version 3, 29 June 2007
3+
4+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5+ Everyone is permitted to copy and distribute verbatim copies
6+ of this license document, but changing it is not allowed.
7+
8+ Preamble
9+
10+ The GNU General Public License is a free, copyleft license for
11+software and other kinds of works.
12+
13+ The licenses for most software and other practical works are designed
14+to take away your freedom to share and change the works. By contrast,
15+the GNU General Public License is intended to guarantee your freedom to
16+share and change all versions of a program--to make sure it remains free
17+software for all its users. We, the Free Software Foundation, use the
18+GNU General Public License for most of our software; it applies also to
19+any other work released this way by its authors. You can apply it to
20+your programs, too.
21+
22+ When we speak of free software, we are referring to freedom, not
23+price. Our General Public Licenses are designed to make sure that you
24+have the freedom to distribute copies of free software (and charge for
25+them if you wish), that you receive source code or can get it if you
26+want it, that you can change the software or use pieces of it in new
27+free programs, and that you know you can do these things.
28+
29+ To protect your rights, we need to prevent others from denying you
30+these rights or asking you to surrender the rights. Therefore, you have
31+certain responsibilities if you distribute copies of the software, or if
32+you modify it: responsibilities to respect the freedom of others.
33+
34+ For example, if you distribute copies of such a program, whether
35+gratis or for a fee, you must pass on to the recipients the same
36+freedoms that you received. You must make sure that they, too, receive
37+or can get the source code. And you must show them these terms so they
38+know their rights.
39+
40+ Developers that use the GNU GPL protect your rights with two steps:
41+(1) assert copyright on the software, and (2) offer you this License
42+giving you legal permission to copy, distribute and/or modify it.
43+
44+ For the developers' and authors' protection, the GPL clearly explains
45+that there is no warranty for this free software. For both users' and
46+authors' sake, the GPL requires that modified versions be marked as
47+changed, so that their problems will not be attributed erroneously to
48+authors of previous versions.
49+
50+ Some devices are designed to deny users access to install or run
51+modified versions of the software inside them, although the manufacturer
52+can do so. This is fundamentally incompatible with the aim of
53+protecting users' freedom to change the software. The systematic
54+pattern of such abuse occurs in the area of products for individuals to
55+use, which is precisely where it is most unacceptable. Therefore, we
56+have designed this version of the GPL to prohibit the practice for those
57+products. If such problems arise substantially in other domains, we
58+stand ready to extend this provision to those domains in future versions
59+of the GPL, as needed to protect the freedom of users.
60+
61+ Finally, every program is threatened constantly by software patents.
62+States should not allow patents to restrict development and use of
63+software on general-purpose computers, but in those that do, we wish to
64+avoid the special danger that patents applied to a free program could
65+make it effectively proprietary. To prevent this, the GPL assures that
66+patents cannot be used to render the program non-free.
67+
68+ The precise terms and conditions for copying, distribution and
69+modification follow.
70+
71+ TERMS AND CONDITIONS
72+
73+ 0. Definitions.
74+
75+ "This License" refers to version 3 of the GNU General Public License.
76+
77+ "Copyright" also means copyright-like laws that apply to other kinds of
78+works, such as semiconductor masks.
79+
80+ "The Program" refers to any copyrightable work licensed under this
81+License. Each licensee is addressed as "you". "Licensees" and
82+"recipients" may be individuals or organizations.
83+
84+ To "modify" a work means to copy from or adapt all or part of the work
85+in a fashion requiring copyright permission, other than the making of an
86+exact copy. The resulting work is called a "modified version" of the
87+earlier work or a work "based on" the earlier work.
88+
89+ A "covered work" means either the unmodified Program or a work based
90+on the Program.
91+
92+ To "propagate" a work means to do anything with it that, without
93+permission, would make you directly or secondarily liable for
94+infringement under applicable copyright law, except executing it on a
95+computer or modifying a private copy. Propagation includes copying,
96+distribution (with or without modification), making available to the
97+public, and in some countries other activities as well.
98+
99+ To "convey" a work means any kind of propagation that enables other
100+parties to make or receive copies. Mere interaction with a user through
101+a computer network, with no transfer of a copy, is not conveying.
102+
103+ An interactive user interface displays "Appropriate Legal Notices"
104+to the extent that it includes a convenient and prominently visible
105+feature that (1) displays an appropriate copyright notice, and (2)
106+tells the user that there is no warranty for the work (except to the
107+extent that warranties are provided), that licensees may convey the
108+work under this License, and how to view a copy of this License. If
109+the interface presents a list of user commands or options, such as a
110+menu, a prominent item in the list meets this criterion.
111+
112+ 1. Source Code.
113+
114+ The "source code" for a work means the preferred form of the work
115+for making modifications to it. "Object code" means any non-source
116+form of a work.
117+
118+ A "Standard Interface" means an interface that either is an official
119+standard defined by a recognized standards body, or, in the case of
120+interfaces specified for a particular programming language, one that
121+is widely used among developers working in that language.
122+
123+ The "System Libraries" of an executable work include anything, other
124+than the work as a whole, that (a) is included in the normal form of
125+packaging a Major Component, but which is not part of that Major
126+Component, and (b) serves only to enable use of the work with that
127+Major Component, or to implement a Standard Interface for which an
128+implementation is available to the public in source code form. A
129+"Major Component", in this context, means a major essential component
130+(kernel, window system, and so on) of the specific operating system
131+(if any) on which the executable work runs, or a compiler used to
132+produce the work, or an object code interpreter used to run it.
133+
134+ The "Corresponding Source" for a work in object code form means all
135+the source code needed to generate, install, and (for an executable
136+work) run the object code and to modify the work, including scripts to
137+control those activities. However, it does not include the work's
138+System Libraries, or general-purpose tools or generally available free
139+programs which are used unmodified in performing those activities but
140+which are not part of the work. For example, Corresponding Source
141+includes interface definition files associated with source files for
142+the work, and the source code for shared libraries and dynamically
143+linked subprograms that the work is specifically designed to require,
144+such as by intimate data communication or control flow between those
145+subprograms and other parts of the work.
146+
147+ The Corresponding Source need not include anything that users
148+can regenerate automatically from other parts of the Corresponding
149+Source.
150+
151+ The Corresponding Source for a work in source code form is that
152+same work.
153+
154+ 2. Basic Permissions.
155+
156+ All rights granted under this License are granted for the term of
157+copyright on the Program, and are irrevocable provided the stated
158+conditions are met. This License explicitly affirms your unlimited
159+permission to run the unmodified Program. The output from running a
160+covered work is covered by this License only if the output, given its
161+content, constitutes a covered work. This License acknowledges your
162+rights of fair use or other equivalent, as provided by copyright law.
163+
164+ You may make, run and propagate covered works that you do not
165+convey, without conditions so long as your license otherwise remains
166+in force. You may convey covered works to others for the sole purpose
167+of having them make modifications exclusively for you, or provide you
168+with facilities for running those works, provided that you comply with
169+the terms of this License in conveying all material for which you do
170+not control copyright. Those thus making or running the covered works
171+for you must do so exclusively on your behalf, under your direction
172+and control, on terms that prohibit them from making any copies of
173+your copyrighted material outside their relationship with you.
174+
175+ Conveying under any other circumstances is permitted solely under
176+the conditions stated below. Sublicensing is not allowed; section 10
177+makes it unnecessary.
178+
179+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180+
181+ No covered work shall be deemed part of an effective technological
182+measure under any applicable law fulfilling obligations under article
183+11 of the WIPO copyright treaty adopted on 20 December 1996, or
184+similar laws prohibiting or restricting circumvention of such
185+measures.
186+
187+ When you convey a covered work, you waive any legal power to forbid
188+circumvention of technological measures to the extent such circumvention
189+is effected by exercising rights under this License with respect to
190+the covered work, and you disclaim any intention to limit operation or
191+modification of the work as a means of enforcing, against the work's
192+users, your or third parties' legal rights to forbid circumvention of
193+technological measures.
194+
195+ 4. Conveying Verbatim Copies.
196+
197+ You may convey verbatim copies of the Program's source code as you
198+receive it, in any medium, provided that you conspicuously and
199+appropriately publish on each copy an appropriate copyright notice;
200+keep intact all notices stating that this License and any
201+non-permissive terms added in accord with section 7 apply to the code;
202+keep intact all notices of the absence of any warranty; and give all
203+recipients a copy of this License along with the Program.
204+
205+ You may charge any price or no price for each copy that you convey,
206+and you may offer support or warranty protection for a fee.
207+
208+ 5. Conveying Modified Source Versions.
209+
210+ You may convey a work based on the Program, or the modifications to
211+produce it from the Program, in the form of source code under the
212+terms of section 4, provided that you also meet all of these conditions:
213+
214+ a) The work must carry prominent notices stating that you modified
215+ it, and giving a relevant date.
216+
217+ b) The work must carry prominent notices stating that it is
218+ released under this License and any conditions added under section
219+ 7. This requirement modifies the requirement in section 4 to
220+ "keep intact all notices".
221+
222+ c) You must license the entire work, as a whole, under this
223+ License to anyone who comes into possession of a copy. This
224+ License will therefore apply, along with any applicable section 7
225+ additional terms, to the whole of the work, and all its parts,
226+ regardless of how they are packaged. This License gives no
227+ permission to license the work in any other way, but it does not
228+ invalidate such permission if you have separately received it.
229+
230+ d) If the work has interactive user interfaces, each must display
231+ Appropriate Legal Notices; however, if the Program has interactive
232+ interfaces that do not display Appropriate Legal Notices, your
233+ work need not make them do so.
234+
235+ A compilation of a covered work with other separate and independent
236+works, which are not by their nature extensions of the covered work,
237+and which are not combined with it such as to form a larger program,
238+in or on a volume of a storage or distribution medium, is called an
239+"aggregate" if the compilation and its resulting copyright are not
240+used to limit the access or legal rights of the compilation's users
241+beyond what the individual works permit. Inclusion of a covered work
242+in an aggregate does not cause this License to apply to the other
243+parts of the aggregate.
244+
245+ 6. Conveying Non-Source Forms.
246+
247+ You may convey a covered work in object code form under the terms
248+of sections 4 and 5, provided that you also convey the
249+machine-readable Corresponding Source under the terms of this License,
250+in one of these ways:
251+
252+ a) Convey the object code in, or embodied in, a physical product
253+ (including a physical distribution medium), accompanied by the
254+ Corresponding Source fixed on a durable physical medium
255+ customarily used for software interchange.
256+
257+ b) Convey the object code in, or embodied in, a physical product
258+ (including a physical distribution medium), accompanied by a
259+ written offer, valid for at least three years and valid for as
260+ long as you offer spare parts or customer support for that product
261+ model, to give anyone who possesses the object code either (1) a
262+ copy of the Corresponding Source for all the software in the
263+ product that is covered by this License, on a durable physical
264+ medium customarily used for software interchange, for a price no
265+ more than your reasonable cost of physically performing this
266+ conveying of source, or (2) access to copy the
267+ Corresponding Source from a network server at no charge.
268+
269+ c) Convey individual copies of the object code with a copy of the
270+ written offer to provide the Corresponding Source. This
271+ alternative is allowed only occasionally and noncommercially, and
272+ only if you received the object code with such an offer, in accord
273+ with subsection 6b.
274+
275+ d) Convey the object code by offering access from a designated
276+ place (gratis or for a charge), and offer equivalent access to the
277+ Corresponding Source in the same way through the same place at no
278+ further charge. You need not require recipients to copy the
279+ Corresponding Source along with the object code. If the place to
280+ copy the object code is a network server, the Corresponding Source
281+ may be on a different server (operated by you or a third party)
282+ that supports equivalent copying facilities, provided you maintain
283+ clear directions next to the object code saying where to find the
284+ Corresponding Source. Regardless of what server hosts the
285+ Corresponding Source, you remain obligated to ensure that it is
286+ available for as long as needed to satisfy these requirements.
287+
288+ e) Convey the object code using peer-to-peer transmission, provided
289+ you inform other peers where the object code and Corresponding
290+ Source of the work are being offered to the general public at no
291+ charge under subsection 6d.
292+
293+ A separable portion of the object code, whose source code is excluded
294+from the Corresponding Source as a System Library, need not be
295+included in conveying the object code work.
296+
297+ A "User Product" is either (1) a "consumer product", which means any
298+tangible personal property which is normally used for personal, family,
299+or household purposes, or (2) anything designed or sold for incorporation
300+into a dwelling. In determining whether a product is a consumer product,
301+doubtful cases shall be resolved in favor of coverage. For a particular
302+product received by a particular user, "normally used" refers to a
303+typical or common use of that class of product, regardless of the status
304+of the particular user or of the way in which the particular user
305+actually uses, or expects or is expected to use, the product. A product
306+is a consumer product regardless of whether the product has substantial
307+commercial, industrial or non-consumer uses, unless such uses represent
308+the only significant mode of use of the product.
309+
310+ "Installation Information" for a User Product means any methods,
311+procedures, authorization keys, or other information required to install
312+and execute modified versions of a covered work in that User Product from
313+a modified version of its Corresponding Source. The information must
314+suffice to ensure that the continued functioning of the modified object
315+code is in no case prevented or interfered with solely because
316+modification has been made.
317+
318+ If you convey an object code work under this section in, or with, or
319+specifically for use in, a User Product, and the conveying occurs as
320+part of a transaction in which the right of possession and use of the
321+User Product is transferred to the recipient in perpetuity or for a
322+fixed term (regardless of how the transaction is characterized), the
323+Corresponding Source conveyed under this section must be accompanied
324+by the Installation Information. But this requirement does not apply
325+if neither you nor any third party retains the ability to install
326+modified object code on the User Product (for example, the work has
327+been installed in ROM).
328+
329+ The requirement to provide Installation Information does not include a
330+requirement to continue to provide support service, warranty, or updates
331+for a work that has been modified or installed by the recipient, or for
332+the User Product in which it has been modified or installed. Access to a
333+network may be denied when the modification itself materially and
334+adversely affects the operation of the network or violates the rules and
335+protocols for communication across the network.
336+
337+ Corresponding Source conveyed, and Installation Information provided,
338+in accord with this section must be in a format that is publicly
339+documented (and with an implementation available to the public in
340+source code form), and must require no special password or key for
341+unpacking, reading or copying.
342+
343+ 7. Additional Terms.
344+
345+ "Additional permissions" are terms that supplement the terms of this
346+License by making exceptions from one or more of its conditions.
347+Additional permissions that are applicable to the entire Program shall
348+be treated as though they were included in this License, to the extent
349+that they are valid under applicable law. If additional permissions
350+apply only to part of the Program, that part may be used separately
351+under those permissions, but the entire Program remains governed by
352+this License without regard to the additional permissions.
353+
354+ When you convey a copy of a covered work, you may at your option
355+remove any additional permissions from that copy, or from any part of
356+it. (Additional permissions may be written to require their own
357+removal in certain cases when you modify the work.) You may place
358+additional permissions on material, added by you to a covered work,
359+for which you have or can give appropriate copyright permission.
360+
361+ Notwithstanding any other provision of this License, for material you
362+add to a covered work, you may (if authorized by the copyright holders of
363+that material) supplement the terms of this License with terms:
364+
365+ a) Disclaiming warranty or limiting liability differently from the
366+ terms of sections 15 and 16 of this License; or
367+
368+ b) Requiring preservation of specified reasonable legal notices or
369+ author attributions in that material or in the Appropriate Legal
370+ Notices displayed by works containing it; or
371+
372+ c) Prohibiting misrepresentation of the origin of that material, or
373+ requiring that modified versions of such material be marked in
374+ reasonable ways as different from the original version; or
375+
376+ d) Limiting the use for publicity purposes of names of licensors or
377+ authors of the material; or
378+
379+ e) Declining to grant rights under trademark law for use of some
380+ trade names, trademarks, or service marks; or
381+
382+ f) Requiring indemnification of licensors and authors of that
383+ material by anyone who conveys the material (or modified versions of
384+ it) with contractual assumptions of liability to the recipient, for
385+ any liability that these contractual assumptions directly impose on
386+ those licensors and authors.
387+
388+ All other non-permissive additional terms are considered "further
389+restrictions" within the meaning of section 10. If the Program as you
390+received it, or any part of it, contains a notice stating that it is
391+governed by this License along with a term that is a further
392+restriction, you may remove that term. If a license document contains
393+a further restriction but permits relicensing or conveying under this
394+License, you may add to a covered work material governed by the terms
395+of that license document, provided that the further restriction does
396+not survive such relicensing or conveying.
397+
398+ If you add terms to a covered work in accord with this section, you
399+must place, in the relevant source files, a statement of the
400+additional terms that apply to those files, or a notice indicating
401+where to find the applicable terms.
402+
403+ Additional terms, permissive or non-permissive, may be stated in the
404+form of a separately written license, or stated as exceptions;
405+the above requirements apply either way.
406+
407+ 8. Termination.
408+
409+ You may not propagate or modify a covered work except as expressly
410+provided under this License. Any attempt otherwise to propagate or
411+modify it is void, and will automatically terminate your rights under
412+this License (including any patent licenses granted under the third
413+paragraph of section 11).
414+
415+ However, if you cease all violation of this License, then your
416+license from a particular copyright holder is reinstated (a)
417+provisionally, unless and until the copyright holder explicitly and
418+finally terminates your license, and (b) permanently, if the copyright
419+holder fails to notify you of the violation by some reasonable means
420+prior to 60 days after the cessation.
421+
422+ Moreover, your license from a particular copyright holder is
423+reinstated permanently if the copyright holder notifies you of the
424+violation by some reasonable means, this is the first time you have
425+received notice of violation of this License (for any work) from that
426+copyright holder, and you cure the violation prior to 30 days after
427+your receipt of the notice.
428+
429+ Termination of your rights under this section does not terminate the
430+licenses of parties who have received copies or rights from you under
431+this License. If your rights have been terminated and not permanently
432+reinstated, you do not qualify to receive new licenses for the same
433+material under section 10.
434+
435+ 9. Acceptance Not Required for Having Copies.
436+
437+ You are not required to accept this License in order to receive or
438+run a copy of the Program. Ancillary propagation of a covered work
439+occurring solely as a consequence of using peer-to-peer transmission
440+to receive a copy likewise does not require acceptance. However,
441+nothing other than this License grants you permission to propagate or
442+modify any covered work. These actions infringe copyright if you do
443+not accept this License. Therefore, by modifying or propagating a
444+covered work, you indicate your acceptance of this License to do so.
445+
446+ 10. Automatic Licensing of Downstream Recipients.
447+
448+ Each time you convey a covered work, the recipient automatically
449+receives a license from the original licensors, to run, modify and
450+propagate that work, subject to this License. You are not responsible
451+for enforcing compliance by third parties with this License.
452+
453+ An "entity transaction" is a transaction transferring control of an
454+organization, or substantially all assets of one, or subdividing an
455+organization, or merging organizations. If propagation of a covered
456+work results from an entity transaction, each party to that
457+transaction who receives a copy of the work also receives whatever
458+licenses to the work the party's predecessor in interest had or could
459+give under the previous paragraph, plus a right to possession of the
460+Corresponding Source of the work from the predecessor in interest, if
461+the predecessor has it or can get it with reasonable efforts.
462+
463+ You may not impose any further restrictions on the exercise of the
464+rights granted or affirmed under this License. For example, you may
465+not impose a license fee, royalty, or other charge for exercise of
466+rights granted under this License, and you may not initiate litigation
467+(including a cross-claim or counterclaim in a lawsuit) alleging that
468+any patent claim is infringed by making, using, selling, offering for
469+sale, or importing the Program or any portion of it.
470+
471+ 11. Patents.
472+
473+ A "contributor" is a copyright holder who authorizes use under this
474+License of the Program or a work on which the Program is based. The
475+work thus licensed is called the contributor's "contributor version".
476+
477+ A contributor's "essential patent claims" are all patent claims
478+owned or controlled by the contributor, whether already acquired or
479+hereafter acquired, that would be infringed by some manner, permitted
480+by this License, of making, using, or selling its contributor version,
481+but do not include claims that would be infringed only as a
482+consequence of further modification of the contributor version. For
483+purposes of this definition, "control" includes the right to grant
484+patent sublicenses in a manner consistent with the requirements of
485+this License.
486+
487+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488+patent license under the contributor's essential patent claims, to
489+make, use, sell, offer for sale, import and otherwise run, modify and
490+propagate the contents of its contributor version.
491+
492+ In the following three paragraphs, a "patent license" is any express
493+agreement or commitment, however denominated, not to enforce a patent
494+(such as an express permission to practice a patent or covenant not to
495+sue for patent infringement). To "grant" such a patent license to a
496+party means to make such an agreement or commitment not to enforce a
497+patent against the party.
498+
499+ If you convey a covered work, knowingly relying on a patent license,
500+and the Corresponding Source of the work is not available for anyone
501+to copy, free of charge and under the terms of this License, through a
502+publicly available network server or other readily accessible means,
503+then you must either (1) cause the Corresponding Source to be so
504+available, or (2) arrange to deprive yourself of the benefit of the
505+patent license for this particular work, or (3) arrange, in a manner
506+consistent with the requirements of this License, to extend the patent
507+license to downstream recipients. "Knowingly relying" means you have
508+actual knowledge that, but for the patent license, your conveying the
509+covered work in a country, or your recipient's use of the covered work
510+in a country, would infringe one or more identifiable patents in that
511+country that you have reason to believe are valid.
512+
513+ If, pursuant to or in connection with a single transaction or
514+arrangement, you convey, or propagate by procuring conveyance of, a
515+covered work, and grant a patent license to some of the parties
516+receiving the covered work authorizing them to use, propagate, modify
517+or convey a specific copy of the covered work, then the patent license
518+you grant is automatically extended to all recipients of the covered
519+work and works based on it.
520+
521+ A patent license is "discriminatory" if it does not include within
522+the scope of its coverage, prohibits the exercise of, or is
523+conditioned on the non-exercise of one or more of the rights that are
524+specifically granted under this License. You may not convey a covered
525+work if you are a party to an arrangement with a third party that is
526+in the business of distributing software, under which you make payment
527+to the third party based on the extent of your activity of conveying
528+the work, and under which the third party grants, to any of the
529+parties who would receive the covered work from you, a discriminatory
530+patent license (a) in connection with copies of the covered work
531+conveyed by you (or copies made from those copies), or (b) primarily
532+for and in connection with specific products or compilations that
533+contain the covered work, unless you entered into that arrangement,
534+or that patent license was granted, prior to 28 March 2007.
535+
536+ Nothing in this License shall be construed as excluding or limiting
537+any implied license or other defenses to infringement that may
538+otherwise be available to you under applicable patent law.
539+
540+ 12. No Surrender of Others' Freedom.
541+
542+ If conditions are imposed on you (whether by court order, agreement or
543+otherwise) that contradict the conditions of this License, they do not
544+excuse you from the conditions of this License. If you cannot convey a
545+covered work so as to satisfy simultaneously your obligations under this
546+License and any other pertinent obligations, then as a consequence you may
547+not convey it at all. For example, if you agree to terms that obligate you
548+to collect a royalty for further conveying from those to whom you convey
549+the Program, the only way you could satisfy both those terms and this
550+License would be to refrain entirely from conveying the Program.
551+
552+ 13. Use with the GNU Affero General Public License.
553+
554+ Notwithstanding any other provision of this License, you have
555+permission to link or combine any covered work with a work licensed
556+under version 3 of the GNU Affero General Public License into a single
557+combined work, and to convey the resulting work. The terms of this
558+License will continue to apply to the part which is the covered work,
559+but the special requirements of the GNU Affero General Public License,
560+section 13, concerning interaction through a network will apply to the
561+combination as such.
562+
563+ 14. Revised Versions of this License.
564+
565+ The Free Software Foundation may publish revised and/or new versions of
566+the GNU General Public License from time to time. Such new versions will
567+be similar in spirit to the present version, but may differ in detail to
568+address new problems or concerns.
569+
570+ Each version is given a distinguishing version number. If the
571+Program specifies that a certain numbered version of the GNU General
572+Public License "or any later version" applies to it, you have the
573+option of following the terms and conditions either of that numbered
574+version or of any later version published by the Free Software
575+Foundation. If the Program does not specify a version number of the
576+GNU General Public License, you may choose any version ever published
577+by the Free Software Foundation.
578+
579+ If the Program specifies that a proxy can decide which future
580+versions of the GNU General Public License can be used, that proxy's
581+public statement of acceptance of a version permanently authorizes you
582+to choose that version for the Program.
583+
584+ Later license versions may give you additional or different
585+permissions. However, no additional obligations are imposed on any
586+author or copyright holder as a result of your choosing to follow a
587+later version.
588+
589+ 15. Disclaimer of Warranty.
590+
591+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599+
600+ 16. Limitation of Liability.
601+
602+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610+SUCH DAMAGES.
611+
612+ 17. Interpretation of Sections 15 and 16.
613+
614+ If the disclaimer of warranty and limitation of liability provided
615+above cannot be given local legal effect according to their terms,
616+reviewing courts shall apply local law that most closely approximates
617+an absolute waiver of all civil liability in connection with the
618+Program, unless a warranty or assumption of liability accompanies a
619+copy of the Program in return for a fee.
620+
621+ END OF TERMS AND CONDITIONS
622+
623+ How to Apply These Terms to Your New Programs
624+
625+ If you develop a new program, and you want it to be of the greatest
626+possible use to the public, the best way to achieve this is to make it
627+free software which everyone can redistribute and change under these terms.
628+
629+ To do so, attach the following notices to the program. It is safest
630+to attach them to the start of each source file to most effectively
631+state the exclusion of warranty; and each file should have at least
632+the "copyright" line and a pointer to where the full notice is found.
633+
634+ Ru*** roLeplay Playground virtual tabletop
635+ Copyright (C) 2022 Zull
636+
637+ This program is free software: you can redistribute it and/or modify
638+ it under the terms of the GNU General Public License as published by
639+ the Free Software Foundation, either version 3 of the License, or
640+ (at your option) any later version.
641+
642+ This program is distributed in the hope that it will be useful,
643+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645+ GNU General Public License for more details.
646+
647+ You should have received a copy of the GNU General Public License
648+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649+
650+Also add information on how to contact you by electronic and paper mail.
651+
652+ If the program does terminal interaction, make it output a short
653+notice like this when it starts in an interactive mode:
654+
655+ RuLP Copyright (C) 2022 Zull
656+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657+ This is free software, and you are welcome to redistribute it
658+ under certain conditions; type `show c' for details.
659+
660+The hypothetical commands `show w' and `show c' should show the appropriate
661+parts of the General Public License. Of course, your program's commands
662+might be different; for a GUI interface, you would use an "about box".
663+
664+ You should also get your employer (if you work as a programmer) or school,
665+if any, to sign a "copyright disclaimer" for the program, if necessary.
666+For more information on this, and how to apply and follow the GNU GPL, see
667+<https://www.gnu.org/licenses/>.
668+
669+ The GNU General Public License does not permit incorporating your program
670+into proprietary programs. If your program is a subroutine library, you
671+may consider it more useful to permit linking proprietary applications with
672+the library. If this is what you want to do, use the GNU Lesser General
673+Public License instead of this License. But first, please read
674+<https://www.gnu.org/licenses/why-not-lgpl.html>o .
\ No newline at end of file
diff -r b30940a5b53e -r f964dff7e1de Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,28 @@
1+CL = sbcl
2+OUTPUT = rulp
3+VERSION = 0.0.1
4+TOOLS = tools #create the directory
5+ARCH = amd64 # to be autogenerated
6+INSTALL-PATH = $(RPM_BUILD_ROOT)/usr
7+DEBIAN-PATH = $(OUTPUT)_$(VERSION)_$(ARCH)
8+# check if RPM_BUILD_ROOT consider also a / at the end or not
9+
10+all: $(OUTPUT)
11+
12+$(OUTPUT):
13+ $(CL) --load system.asd --eval "(progn (require :rulp) (asdf:make :rulp))"
14+
15+install:
16+ install -m 755 $(OUTPUT) $(INSTALL-PATH)/bin/$(OUTPUT)
17+
18+deb:
19+ $(info "debian installation process")
20+ mkdir -p $(DEBIAN-PATH)/usr/bin
21+ mkdir -p $(DEBIAN-PATH)/DEBIAN
22+ cp $(TOOLS)/debian_control $(DEBIAN-PATH)/DEBIAN/
23+ install -m 755 $(OUTPUT) $(DEBIAN-PATH)/usr/bin
24+
25+clean:
26+ rm -f $(OUTPUT)
27+
28+.PHONY: all clean
diff -r b30940a5b53e -r f964dff7e1de README
--- a/README Fri Oct 22 12:39:49 2021 +0200
+++ b/README Sun Apr 10 01:53:45 2022 +0200
@@ -1,104 +1,50 @@
1-Ru*** roLeplay Playground
2-=========================
3-
4-RuLP is a virtual table for roleplay games like Dungeons&Dragons™,
5-Pathfinder™ and more. The program was developed to be used with a
6-VoIP videotelephony program.
7-
8-The program is growing to be autonomous and more user-friendly, yet
9-staying lightweight, customizable and free as in freedom.
10-
11-!!!
12-The program you are seeing now is on an early stage, many features are
13-yet to be implemented or hard to use and too much reliant on source code
14-editing
15-
16-I'm actively working to make the program both easy and powerful. Critics
17-and suggestions are well accepted but implementations can be slow due to
18-external duties.
19-!!!
20-
21-Installation
22--------
23-
24-RuLP is written with Raylib in Lisp. Raylib is a powerful library for 2d
25-and 3d graphic, it is available for every system and most of the languages.
26-
27-The raylib implementation for lisp is cl-raylib that require ffi and
28-can be installed via quicklisp
29-
30-For compiling RuLP we need the followings:
31-
32-* raylib
33-* cl-raylib (by quicklisp or manually)
34-* ffi development libraries
35-* cffi (by quicklisp or manually)
36-* sbcl/clisp (clisp not tested, but should work)
37-
38-Raylib, ffi and sbcl can be installed via a package manager, like
39-homebrew for Mac or almost all packages manager for GNU/Linux.
40-
41-Users need to install the followings from the package manager:
42-
43-Homebrew (Mac)
44-* raylib
45-* xcode (for ffi)
46-* sbcl / clisp (they are both available through homebrew)
1+# RULP: Ru*** roLeplay Playground
472
48-Packages Managers (GNU/Linux)
49-* raylib
50-* raylib-devel / raylib-dev
51-* ffi
52-* ffi-devel / ffi-dev
53-* sbcl / clisp
54-
55-Better instructions for Windows system will be added soon
56-
57-cl-raylib and cffi can be downloaded with quicklisp, indications
58-about installation and usage are available on
59-https://www.quicklisp.org/beta. With quicklisp installed you
60-just need to execute
61-
62-(ql:quickload "cl-raylib")
63-(ql:quicklisp "cffi")
64-
65-with the lisp interpreter of choice.
66-
67-Now the program is ready to start and be used. Open a console/terminal
68-window in this folder and execute
69-
70-$ sbcl --load rulp.lisp
71-$ clisp rulp.lisp
72-
3+It is a virtual board for roleplay games, it display a table
4+with a grid to simulate battles and scenaries. It include
5+an editor to create your own map and events.
736
74-Usage
75------
76-
77-Mouse left: select a specific actor
78-Mouse right: move the selected actor
79-esc: quit
80-
81-----------------------------------------------------------------------
82-
83-Rulp is in a early stage of development, many things have to be
84-fixed and the general feeling is of a clunky and unintuitive program
85-that need tweaks to work properly.
7+## Install
868
87-This is not a final result, I want to make this more usable and cool
88-and I already have ideas on how to do that.
89-
90-Critique is welcome and appreciated, I don't push commits often, as
91-this is a spare time project and I don't have much spare time to begin
92-with. Even if there are few updates I work on the background on bug
93-fixes and features but I just don't want to commit half done work.
94-
9+The software is released as binaries on the osdn page in both appimage
10+with dependencies and rpm/deb. This software uses raylib, tcl and tk to
11+run.
9512
96-Changes
97--------
13+If you want to compile, be aware that this software is
14+developed with Common Lisp and it is tested and deployed with
15+the "Steel Bank Common Lisp" (sbcl), but it can work
16+with other implementations such as GNU clisp or Clozure Common Lisp.
9817
99-commit 2021/10/22:
100-* grid is not a layer anymore, it is temporary global but implemented
101- through a class that convert actor position to the pixel position in the
102- window (and back) this can be edited at the beginning of rulp.lisp;
103-* select-pointer and move-actor were simplified;
104-* README redone
\ No newline at end of file
18+* sbcl (or clisp, or ccl)
19+
20+Also the software uses sdl2 and ltk libraries for display graphics.
21+
22+* raylib-devel
23+* tcl
24+* tk
25+* quicklisp
26+
27+with all these dependencies you should be able to compile the software
28+trough the lisp repl:
29+
30+$ cd /path/to/sources
31+$ sbcl --load system.asd
32+* (require :rulp)
33+* (asdf:make :rulp)
34+
35+Use CTRL+D to exit console.
36+
37+## Documentation
38+
39+The software include a texinfo and man manuals for using and programming
40+in rulp. The source version it also provide a manual with the explaination
41+of all the components, the abstraction and the implementation
42+
43+This is meant to be used by me (whenever I come back to the project after
44+some time) but it is written to be understandable and usable for everybody.
45+
46+If you want to make edits to the software the manual is omni-comprehensive
47+and let you know where things should go and why.
48+
49+If you make improvements or mode please contact me so i can add them to the
50+repository.
diff -r b30940a5b53e -r f964dff7e1de blank.lisp
--- a/blank.lisp Fri Oct 22 12:39:49 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
1-;; Blank layer script
2-;; this file will be executed by rulp at the beginning (and through
3-;; drag and drop). All the elements that will be displayed in +layers+
4-;; will be displayed in the map
5-
6-(setf amanda (make-instance 'actor-layer
7- :entity-name "Amanda"))
8-
9-(setf (l-x amanda) 6)
10-(setf (l-y amanda) 3)
11-
12-(setq +layers+ (list
13- (make-instance 'image-layer :source "board.png")
14- (make-instance 'actor-layer
15- :entity-name "Barbuda")
16- amanda))
diff -r b30940a5b53e -r f964dff7e1de core.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,17 @@
1+(defpackage :core
2+ (:use :cl :bt-semaphore)
3+ (:export main))
4+
5+(in-package :core)
6+
7+(defparameter *screen-width* 1024)
8+(defparameter *screen-height* 768)
9+
10+(defun main ()
11+ ;(bt:make-thread (lambda () (lobby:editor-gui))) ;; here bt-thread it is just used for execute ltk without troubles
12+ ;; for now it is disabled
13+ (graphics:add-entity (make-instance 'layers:entity :icon "test.png"))
14+
15+ (bt:make-thread (lambda () (graphics:playground *screen-width* *screen-height* "Ru*** Lisp Playground")))
16+)
17+ ;; "Ru■■■ Lisp Playground"
diff -r b30940a5b53e -r f964dff7e1de grafico.png
Binary file grafico.png has changed
diff -r b30940a5b53e -r f964dff7e1de graphics/grid.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/grid.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,40 @@
1+(in-package :graphics)
2+
3+(defparameter +grid-span+ 70)
4+
5+(defparameter +letters-list+
6+ '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"
7+ "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"))
8+
9+;; this function cycle throughout the letters
10+(defun letter-cycle (n)
11+ (nth (mod n (length +letters-list+)) +letters-list+))
12+
13+(defun make-grid (screen-width screen-height)
14+ (let ((x-iterations (/ screen-width +grid-span+))
15+ (y-iterations (/ screen-height +grid-span+)))
16+ (loop :for i :from 0 :to x-iterations
17+ :do (raylib:draw-line (* i +grid-span+)
18+ 0
19+ (* i +grid-span+)
20+ screen-height
21+ raylib:+lightgray+))
22+ (loop :for j :from 0 :to y-iterations
23+ :do (raylib:draw-line 0
24+ (* j +grid-span+)
25+ screen-width
26+ (* j +grid-span+)
27+ raylib:+lightgray+))
28+ ))
29+
30+(defun make-grid-letters (screen-width screen-height)
31+ (let ((x-iterations (/ screen-width +grid-span+))
32+ (y-iterations (/ screen-height +grid-span+)))
33+ (loop :for i :from 0 :to x-iterations
34+ :do (loop :for j :from 0 :to y-iterations
35+ :do (raylib:draw-text (format nil "~d~d" (letter-cycle i) j)
36+ (+ (* i +grid-span+) 2)
37+ (+ (* j +grid-span+) 2)
38+ 30
39+ raylib:+lightgray+)))
40+ ))
diff -r b30940a5b53e -r f964dff7e1de graphics/inputs.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inputs.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,46 @@
1+(in-package :graphics)
2+
3+(defparameter +pointer+ nil) ; this parameter check out which entity is selected
4+
5+(defun select-pointer (mouse-x mouse-y)
6+ (let* ((obj-list (map 'list #'(lambda (o) (car o)) +entities-list+))
7+ (placement-list (map 'list #'(lambda (o) (layers:placement o)) obj-list))
8+ (i-x (floor mouse-x +grid-span+))
9+ (i-y (floor mouse-y +grid-span+))
10+ (mouse-pos (make-array '(2) :initial-contents (list i-x i-y))))
11+ (setf +pointer+ nil)
12+ (loop :for object-placement :in placement-list
13+ :for n :from 0 :to (length placement-list)
14+ :do
15+ (when (layers:compare mouse-pos object-placement)
16+ (setf +pointer+ n)))))
17+
18+(defun move-entity (mouse-x mouse-y)
19+ (when (numberp +pointer+)
20+ (let* ((obj-list (map 'list #'(lambda (o) (car o)) +entities-list+))
21+ (i-x (floor mouse-x +grid-span+))
22+ (i-y (floor mouse-y +grid-span+))
23+ (object (nth +pointer+ obj-list)))
24+ (setf (layers:entity-x object) i-x)
25+ (setf (layers:entity-y object) i-y))))
26+
27+;; this list is the bind list, it contain all the keys and mouse presses that are available
28+;; with the function they do
29+(defparameter +normal-mode+ (list
30+ '(raylib:+mouse-left-button+ (select-pointer
31+ (raylib:vector2-x mouse-position)
32+ (raylib:vector2-y mouse-position)))
33+ '(raylib:+mouse-right-button+ (move-entity
34+ (raylib:vector2-x mouse-position)
35+ (raylib:vector2-y mouse-position)))
36+ '(raylib:+mouse-middle-button+ (toggle-grid-letters))))
37+
38+(defparameter +menu-mode+ (list
39+ '(raylib:+mouse-left-button+ (format t "L"))
40+ '(raylib:+mouse-right-button+ (format t "R"))
41+ '(raylib:+mouse-middle-button+ (format t "M"))))
42+
43+;; This simple function check if the given stroke is pressed, then return's it if it is
44+(defun use-mouse (stroke)
45+ (when (raylib:is-mouse-button-pressed (eval (car stroke)))
46+ (eval (cadr stroke))))
diff -r b30940a5b53e -r f964dff7e1de graphics/package.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/package.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,8 @@
1+(defpackage :graphics
2+ (:use :cl :raylib)
3+ (:export playground
4+ toggle-grid toggle-grid-letters
5+ +grid-span+
6+ add-plane remove-plane-nth
7+ add-entity remove-entity-nth
8+ ))
diff -r b30940a5b53e -r f964dff7e1de graphics/render.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/render.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,58 @@
1+(in-package :graphics)
2+
3+;; it should be moved somewhere else when finalizing
4+;; if the number is out of scope it does nothing
5+(defun remove-nth (n lis)
6+ (if (zerop n) (cdr lis)
7+ (if lis (cons (car lis) (remove-nth (- n 1) (cdr lis)))
8+ nil)))
9+
10+;; this can be expanded in a scene class which contain the layer list and the entities.
11+(defparameter +planes-list+ nil)
12+(defparameter +entities-list+ nil)
13+
14+(defun add-entity (entity)
15+ (setf +entities-list+ (append +entities-list+ (list (list entity 'nil)))))
16+
17+(defun remove-entity-nth (n)
18+ (setf +entities-list+ (remove-nth n +entities-list+)))
19+
20+(defun add-plane (plane)
21+ (setf +planes-list+ (append +planes-list+ (list (list plane 'nil)))))
22+
23+(defun remove-plane-nth (n)
24+ (setf +planes-list+ (remove-nth n +planes-list+)))
25+
26+;; for now it just uses +entities-list+, in the future it should parsed for multiple scene to work
27+
28+(defun render-planes ()
29+ (loop :for x :in +planes-list+
30+ :do
31+ (if (null (cadr x))
32+ (setf (cadr x) (layers:show (car x)))
33+ (when (layers:plane-is-display (car x))
34+ (raylib:draw-texture (cadr x)
35+ (layers:plane-x (car x))
36+ (layers:plane-y (car x))
37+ raylib:+raywhite+))
38+ )))
39+
40+(defun render-entities ()
41+ (loop :for x :in +entities-list+
42+ :do
43+ (if (null (cadr x))
44+ (setf (cadr x) (layers:show (car x)))
45+ (when (layers:entity-is-display (car x))
46+ (raylib:draw-texture (cadr x)
47+ (* (layers:entity-x (car x)) +grid-span+)
48+ (* (layers:entity-y (car x)) +grid-span+)
49+ raylib:+raywhite+))
50+ )))
51+
52+
53+;; check if cadr is null -> if cadr is null eval show and save -> else load
54+
55+;; it get a list of two elements, the one an entity or a list, the second a bitmap
56+;; if there is no bitmap it execute show and save the return value in bitmap
57+;; (if your method show doesn't produce a bitmap you should always return nil)
58+;; if there is any data in the second element it try to load it as texture
diff -r b30940a5b53e -r f964dff7e1de graphics/view.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/view.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,53 @@
1+(in-package :graphics)
2+#| -------------------------------------------
3+ | This file manipulate the window and the
4+ | raylib/sdl initialization.
5+ | -------------------------------------------
6+ |#
7+;; grid variable to toggle in the repl
8+(defparameter +is-grid+ t)
9+(defparameter +is-grid-letters+ t)
10+
11+(defun toggle-grid ()
12+ (if +is-grid+
13+ (setf +is-grid+ nil)
14+ (setf +is-grid+ t)))
15+
16+(defun toggle-grid-letters ()
17+ (if +is-grid-letters+
18+ (setf +is-grid-letters+ nil)
19+ (setf +is-grid-letters+ t)))
20+
21+;; this is the de-facto main, it initialize and display the graphic items
22+(defun playground (width height title &optional (fps 60) (debug-info nil))
23+ (defvar mouse-position nil)
24+ (let ((mode +normal-mode+)) ; ask for alternative options to implement a modes
25+ (raylib:with-window (width height title)
26+ (raylib:set-target-fps fps)
27+ (loop :while (not (raylib:window-should-close))
28+ :do
29+ (setf mouse-position (raylib:get-mouse-position))
30+ (loop :for stk :in mode
31+ :do (use-mouse stk))
32+ (raylib:with-drawing
33+ (raylib:clear-background raylib:+black+)
34+ ;; render entities and planes
35+ (render-planes)
36+ (render-entities)
37+ ;; render grid and grid's letters
38+ (when +is-grid+ (make-grid width height))
39+ (when +is-grid-letters+ (make-grid-letters width height))
40+ ;; display the pointer, this is actually contained in inputs.lisp
41+ (when (numberp +pointer+)
42+ (let* ((selected-entity (car (nth +pointer+ +entities-list+)))
43+ (i-x (* (layers:entity-x selected-entity) +grid-span+))
44+ (i-y (* (layers:entity-y selected-entity) +grid-span+)))
45+ (raylib:draw-rectangle-lines i-x
46+ i-y
47+ +grid-span+
48+ +grid-span+
49+ raylib:+red+)))
50+ ;; display debug informations if there's any
51+ (when debug-info
52+ (raylib:draw-text (format nil "D]: ~d" debug-info) 0 0 10 raylib:+lightgray+))
53+ )))))
diff -r b30940a5b53e -r f964dff7e1de grids.lisp
--- a/grids.lisp Fri Oct 22 12:39:49 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
1-(defclass grid ()
2- ((type :accessor grid-type
3- :initarg :grid-type
4- :initform 'square)
5- (size :accessor grid-size
6- :initarg :grid-size
7- :initform 70)
8- (visible :accessor is-grid-visible
9- :initarg :is-grid-visible
10- :initform t)))
11-; (offset :accessor grid-offset
12-; :initarg :grid-offset
13-; :initform (make-array '(2) :initial-contents '(0 0)))))
14-
15-(defmethod coordinates-to-grid (coordinates (g grid))
16- (map 'list #'(lambda (x) (* x (grid-size g))) coordinates))
17-
18-;; these are now the same, but with the implementation of an exagonal grid these will differ
19-;; and it is better to just have two functions that can be implemented soon and later edited
20-;; with the addition of new grids
21-(defmethod x-to-grid (value (object grid))
22- (* value (grid-size object)))
23-
24-(defmethod y-to-grid (value (object grid))
25- (* value (grid-size object)))
26-
27-(defmethod x-to-entity (value (object grid))
28- (floor (/ value (grid-size object))))
29-
30-(defmethod y-to-entity (value (object grid))
31- (floor (/ value (grid-size object))))
diff -r b30940a5b53e -r f964dff7e1de layers.lisp
--- a/layers.lisp Fri Oct 22 12:39:49 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
1-(defgeneric render (object))
2-(defgeneric l-x (object))
3-(defgeneric l-y (object))
4-(defgeneric (setf l-x) (value object))
5-(defgeneric (setf l-y) (value object))
6-
7-(defclass layer ()
8- ((coordinate :accessor layer-coordinate
9- :initarg :layer-coordinate
10- :initform (make-array '(2) :initial-contents '(0 0)))))
11-
12-(defmethod l-x ((object layer))
13- (aref (slot-value object 'coordinate) 0))
14-
15-(defmethod l-y ((object layer))
16- (aref (slot-value object 'coordinate) 1))
17-
18-(defmethod (setf l-x) (value (object layer))
19- (setf (aref (slot-value object 'coordinate) 0) value))
20-
21-(defmethod (setf l-y) (value (object layer))
22- (setf (aref (slot-value object 'coordinate) 1) value))
23-
24-
25-(defclass image-layer (layer)
26- ((image-source :accessor image-source
27- :initarg :source
28- :initform "test.png")
29- (image-mipmap :accessor image-mipmap
30- :initarg :image-mipmap
31- :initform nil)
32- ))
33-
34-(defclass entity-layer (image-layer)
35- ((display :accessor display
36- :initarg :display
37- :initform t)
38- (size :accessor entity-layer-size
39- :initarg :entity-layer-size
40- :initform 1)))
41-
42-(defclass actor-layer (entity-layer)
43- ((name :accessor entity-name
44- :initarg :entity-name
45- :initform "")
46- (life :accessor life
47- :initarg life
48- :initform 0)
49- (max-life :accessor max-life
50- :initarg life
51- :initform 0)))
52-
53-(defmethod actor-move-up ((object actor-layer))
54- (setf (l-y object) (- (l-y object) 1)))
55-
56-(defmethod actor-move-down ((object actor-layer))
57- (setf (l-y object) (+ (l-y object) 1)))
58-
59-(defmethod actor-move-left ((object actor-layer))
60- (setf (l-x object) (- (l-x object) 1)))
61-
62-(defmethod actor-move-right ((object actor-layer))
63- (setf (l-x object) (+ (l-x object) 1)))
64-
65-(defun compare (a b)
66- (let ((a-x (aref a 0))
67- (a-y (aref a 1))
68- (b-x (aref b 0))
69- (b-y (aref b 1)))
70- (if (and (equal a-x b-x) (equal a-y b-y)) t nil)))
diff -r b30940a5b53e -r f964dff7e1de layers/entities.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/layers/entities.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,42 @@
1+(in-package :layers)
2+
3+(defgeneric show (e))
4+(defgeneric placement (e))
5+
6+;; compare 2 arrays
7+(defun compare (a b)
8+ (let ((ret t))
9+ (loop :for i :across a
10+ :for j :across b
11+ :do
12+ (when (not (equal i j)) (setf ret nil)))
13+ ret))
14+
15+(defclass entity ()
16+ ((x :accessor entity-x
17+ :initarg :x
18+ :initform 0)
19+ (y :accessor entity-y
20+ :initarg :y
21+ :initform 0)
22+ (name :accessor entity-name
23+ :initarg :name
24+ :initform "no name")
25+ (icon :accessor entity-icon
26+ :initarg :icon
27+ :initform "test.png")
28+ (display :accessor entity-is-display
29+ :initarg :display
30+ :initform t)
31+ (size :accessor entity-size
32+ :initarg :size
33+ :initform 1)))
34+
35+(defmethod show ((e entity))
36+ (let* ((ret (raylib:load-texture (entity-icon e))))
37+ ret))
38+
39+(defmethod placement ((e entity))
40+ (let ((x (slot-value e 'x))
41+ (y (slot-value e 'y)))
42+ (make-array '(2) :initial-contents (list x y))))
diff -r b30940a5b53e -r f964dff7e1de layers/package.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/layers/package.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,7 @@
1+(defpackage :layers
2+ (:use :cl :raylib)
3+ (:export entity show placement ;; entity functions
4+ entity-x entity-y entity-name entity-icon entity-is-display
5+ plane plane-x plane-y image-plane plane-is-display
6+ compare
7+ ))
diff -r b30940a5b53e -r f964dff7e1de layers/planes.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/layers/planes.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,28 @@
1+(in-package :layers)
2+
3+(defgeneric show (p))
4+
5+;; this is a generic plane which define basic arguments
6+;; and let other planes inherit them.
7+(defclass plane ()
8+ ((x :accessor plane-x
9+ :initarg :x
10+ :initform 0)
11+ (y :accessor plane-y
12+ :initarg :y
13+ :initform 0)
14+ (display :accessor plane-is-display
15+ :initarg :display
16+ :initform t)))
17+
18+(defmethod show ((p plane))
19+ (raylib:draw-rectangle 0 0 100 100 raylib:+black+)
20+ nil)
21+
22+(defclass image-plane (plane)
23+ ((image :accessor plane-image
24+ :initarg :image)))
25+
26+(defmethod show ((p image-plane))
27+ (let* ((ret (raylib:load-texture (plane-image p))))
28+ ret))
diff -r b30940a5b53e -r f964dff7e1de lobby/main.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lobby/main.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,62 @@
1+(in-package :lobby)
2+
3+#|
4+-------------------------------------------
5+here there are the sources of the main
6+window of the lobby. The lobby is a section
7+of the program which the user can choose
8+whenever connect to a p2p session or just
9+use it locally.
10+
11+In the future it should be extended with
12+statistical and system options like stat
13+analysis and (if i bother to do so) an ai
14+which suggest the best path to fight
15+
16+This package doesn't include the defpackage
17+macro, which is actually contained in the
18+package.lisp file. If you want to add a
19+window or a functionality you should remember
20+to add here in the menues or export
21+to use by option in the core package.
22+-------------------------------------------
23+|#
24+
25+;; parent window, here there is the instance to start
26+;; a ltk window, if you want to add windows the best
27+;; solution is to add a new file, modify here the
28+;; menues and add the new file in the system.asd
29+;; under ":depends-on"
30+(defun editor-gui()
31+ (with-ltk ()
32+ (let* ((frame (make-instance 'frame))
33+ (repl-screen (make-instance 'text
34+ :master frame))
35+ (info-label (make-instance 'label
36+ :master frame
37+ :text "label")))
38+ (bind repl-screen "<Return>"
39+ (lambda (evt) (format t "Hello~%")))
40+
41+ (pack frame :anchor :center :fill :both :expand t)
42+ (pack repl-screen :side :left :expand t :anchor :center :fill :both)
43+ (pack info-label :before repl-screen :side :bottom :anchor :sw :fill :x)
44+ )))
45+
46+(defun main()
47+ (with-ltk ()
48+ (let* ((f (make-instance 'frame))
49+ (lbl (make-instance 'label
50+ :text "rulp test label"
51+ :master f))
52+ (entry (make-instance 'text
53+ :master f))
54+ (button (make-instance 'button
55+ :master f
56+ :command (lambda ()
57+ (format t "hello~d~%" (text entry)))
58+ :text "Hello")))
59+ (pack f)
60+ (pack lbl :side :left)
61+ (pack entry :side :left)
62+ (pack button :side :left))))
diff -r b30940a5b53e -r f964dff7e1de lobby/package.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lobby/package.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,3 @@
1+(defpackage :lobby
2+ (:use :ltk :cl)
3+ (:export main editor-gui))
diff -r b30940a5b53e -r f964dff7e1de raylib/LICENSE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/LICENSE Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,21 @@
1+MIT License
2+
3+Copyright (c) 2017
4+
5+Permission is hereby granted, free of charge, to any person obtaining a copy
6+of this software and associated documentation files (the "Software"), to deal
7+in the Software without restriction, including without limitation the rights
8+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+copies of the Software, and to permit persons to whom the Software is
10+furnished to do so, subject to the following conditions:
11+
12+The above copyright notice and this permission notice shall be included in all
13+copies or substantial portions of the Software.
14+
15+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+SOFTWARE.
diff -r b30940a5b53e -r f964dff7e1de raylib/cl-raylib.asd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/cl-raylib.asd Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,30 @@
1+(in-package #:cl-user)
2+
3+#+sbcl
4+(declaim (sb-ext:muffle-conditions sb-kernel:character-decoding-error-in-comment))
5+
6+#+sbcl
7+(eval-when (:compile-toplevel :load-toplevel :execute)
8+ (sb-int:set-floating-point-modes :traps nil))
9+
10+(defpackage #:cl-raylib-asd
11+ (:use :cl :asdf))
12+
13+(in-package :cl-raylib-asd)
14+
15+(defsystem #:cl-raylib
16+ :version "0.0.1"
17+ :author "loong0"
18+ :license "MIT"
19+ :description "Common Lisp bindings of libraylib"
20+ :depends-on (#:cffi-libffi
21+ #:alexandria)
22+ :serial t
23+ :pathname "src"
24+ :components
25+ ((:file "package")
26+ (:file "library")
27+ (:file "util")
28+ (:file "raylib")
29+ (:file "macro"))
30+ :in-order-to ((test-op (test-op cl-raylib-test))))
diff -r b30940a5b53e -r f964dff7e1de raylib/library.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/library.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,10 @@
1+(in-package #:cl-raylib)
2+(define-foreign-library libraylib
3+ (:darwin "libraylib.dylib")
4+ (:unix "libraylib.so")
5+ (:windows "raylib.dll")
6+ (t (:default "libraylib")))
7+
8+(unless (foreign-library-loaded-p 'libraylib)
9+ (use-foreign-library libraylib))
10+
diff -r b30940a5b53e -r f964dff7e1de raylib/macro.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/macro.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,56 @@
1+(in-package #:cl-raylib)
2+
3+(defmacro with-window ((width height title) &body body)
4+ `(progn (init-window ,width ,height ,title)
5+ (unwind-protect (progn ,@body)
6+ (close-window))))
7+
8+(defmacro with-drawing (&body body)
9+ `(progn (begin-drawing)
10+ (unwind-protect (progn ,@body)
11+ (end-drawing))))
12+
13+(defmacro with-mode-2d ((camera) &body body)
14+ `(progn (begin-mode-2d ,camera)
15+ (unwind-protect (progn ,@body)
16+ (end-mode-2d))))
17+
18+(defmacro with-mode-3d ((camera) &body body)
19+ `(progn (begin-mode-3d ,camera)
20+ (unwind-protect (progn ,@body)
21+ (end-mode-3d))))
22+
23+(defmacro with-texture-mode ((target) &body body)
24+ `(progn (begin-texture-mode ,target)
25+ (unwind-protect (progn ,@body)
26+ (end-texture-mode))))
27+
28+(defmacro with-shader-mode ((shader) &body body)
29+ `(progn (begin-shader-mode ,shader)
30+ (unwind-protect (progn ,@body)
31+ (end-shader-mode))))
32+
33+(defmacro with-blend-mode ((mode) &body body)
34+ `(progn (begin-blend-mode ,mode)
35+ (unwind-protect (progn ,@body)
36+ (end-blend-mode))))
37+
38+(defmacro with-vr-simulator (&body body)
39+ `(progn (init-vr-simulator)
40+ (unwind-protect (progn ,@body)
41+ (close-vr-simulator))))
42+
43+(defmacro with-vr-drawing (&body body)
44+ `(progn (begin-vr-drawing)
45+ (unwind-protect (progn ,@body)
46+ (end-vr-drawing))))
47+
48+(defmacro with-audio-device (&body body)
49+ `(progn (init-audio-device)
50+ (unwind-protect (progn ,@body)
51+ (close-audio-device))))
52+
53+(defmacro with-audio-stream ((stream sample-rate sample-size channels) &body body)
54+ `(let ((,stream (init-audio-stream ,sample-rate ,sample-size ,channels)))
55+ (unwind-protect (progn ,@body)
56+ (close-audio-stream ,stream))))
diff -r b30940a5b53e -r f964dff7e1de raylib/package.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/package.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,640 @@
1+(defpackage #:cl-raylib
2+ (:nicknames #:raylib)
3+ (:use #:cl #:cffi #:alexandria)
4+ (:export
5+ ;; Basic Colors
6+ #:+lightgray+
7+ #:+gray+
8+ #:+darkgray+
9+ #:+yellow+
10+ #:+gold+
11+ #:+orange+
12+ #:+pink+
13+ #:+red+
14+ #:+maroon+
15+ #:+green+
16+ #:+lime+
17+ #:+darkgreen+
18+ #:+skyblue+
19+ #:+blue+
20+ #:+darkblue+
21+ #:+purple+
22+ #:+violet+
23+ #:+darkpurple+
24+ #:+beige+
25+ #:+brown+
26+ #:+darkbrown+
27+ #:+white+
28+ #:+black+
29+ #:+blank+
30+ #:+magenta+
31+ #:+raywhite+
32+
33+ #:make-vector2
34+ #:vector2-x
35+ #:vector2-y
36+
37+ #:make-vector3
38+ #:vector3-x
39+ #:vector3-y
40+ #:vector3-z
41+
42+ #:make-vector4
43+ #:vector4-x
44+ #:vector4-y
45+ #:vector4-z
46+ #:vector4-w
47+
48+ #:make-rectangle
49+ #:rectangle-x
50+ #:rectangle-y
51+ #:rectangle-width
52+ #:rectangle-height
53+
54+ #:make-texture
55+ #:texture-id
56+ #:texture-width
57+ #:texture-height
58+ #:texture-mipmaps
59+ #:texture-format
60+
61+ #:make-render-texture
62+ #:render-texture-id
63+ #:render-texture-texture
64+ #:render-texture-depth
65+ #:render-texture-depth-texture
66+
67+ #:make-patch-info
68+ #:patch-info-rec
69+ #:patch-info-left
70+ #:patch-info-top
71+ #:patch-info-right
72+ #:patch-info-bottom
73+ #:patch-info-type
74+
75+ #:make-char-info
76+ #:char-info-value
77+ #:char-info-offset-x
78+ #:char-info-offset-y
79+ #:char-info-advance-x
80+ #:char-info-image
81+
82+ #:make-font
83+ #:font-base-size
84+ #:font-chars-count
85+ #:font-texture
86+ #:font-recs
87+ #:font-chars
88+
89+ #:make-camera3d
90+ #:camera3d-position
91+ #:camera3d-target
92+ #:camera3d-up
93+ #:camera3d-fovy
94+ #:camera3d-type
95+
96+ #:make-camera2d
97+ #:camera2d-offset
98+ #:camera2d-target
99+ #:camera2d-rotation
100+ #:camera2d-zoom
101+
102+ ;; Log
103+
104+ ;; Keyboard keys
105+ #:+key-apostrophe+
106+ #:+key-comma+
107+ #:+key-minus+
108+ #:+key-period+
109+ #:+key-slash+
110+ #:+key-zero+
111+ #:+key-one+
112+ #:+key-two+
113+ #:+key-three+
114+ #:+key-four+
115+ #:+key-five+
116+ #:+key-six+
117+ #:+key-seven+
118+ #:+key-eight+
119+ #:+key-nine+
120+ #:+key-semicolon+
121+ #:+key-equal+
122+ #:+key-a+
123+ #:+key-b+
124+ #:+key-c+
125+ #:+key-d+
126+ #:+key-e+
127+ #:+key-f+
128+ #:+key-g+
129+ #:+key-h+
130+ #:+key-i+
131+ #:+key-j+
132+ #:+key-k+
133+ #:+key-l+
134+ #:+key-m+
135+ #:+key-n+
136+ #:+key-o+
137+ #:+key-p+
138+ #:+key-q+
139+ #:+key-r+
140+ #:+key-s+
141+ #:+key-t+
142+ #:+key-u+
143+ #:+key-v+
144+ #:+key-w+
145+ #:+key-x+
146+ #:+key-y+
147+ #:+key-z+
148+
149+ ; Function keys
150+ #:+key-space+
151+ #:+key-escape+
152+ #:+key-enter+
153+ #:+key-tab+
154+ #:+key-backspace+
155+ #:+key-insert+
156+ #:+key-delete+
157+ #:+key-right+
158+ #:+key-left+
159+ #:+key-down+
160+ #:+key-up+
161+ #:+key-page-up+
162+ #:+key-page-down+
163+ #:+key-home+
164+ #:+key-end+
165+ #:+key-caps-lock+
166+ #:+key-scroll-lock+
167+ #:+key-num-lock+
168+ #:+key-print-screen+
169+ #:+key-pause+
170+ #:+key-f1+
171+ #:+key-f2+
172+ #:+key-f3+
173+ #:+key-f4+
174+ #:+key-f5+
175+ #:+key-f6+
176+ #:+key-f7+
177+ #:+key-f8+
178+ #:+key-f9+
179+ #:+key-f10+
180+ #:+key-f11+
181+ #:+key-f12+
182+ #:+key-left-shift+
183+ #:+key-left-control+
184+ #:+key-left-alt+
185+ #:+key-left-super+
186+ #:+key-right-shift+
187+ #:+key-right-control+
188+ #:+key-right-alt+
189+ #:+key-right-super+
190+ #:+key-kb-menu+
191+ #:+key-left-bracket+
192+ #:+key-backslash+
193+ #:+key-right-bracket+
194+ #:+key-grave+
195+
196+
197+ #:+mouse-left-button+
198+ #:+mouse-right-button+
199+ #:+mouse-middle-button+
200+
201+ #:+camera-custom+
202+ #:+camera-free+
203+ #:+camera-orbital+
204+ #:+camera-first-person+
205+ #:+camera-third-person+
206+
207+ #:+camera-perspective+
208+ #:+camera-orthographic+
209+
210+ #:init-window
211+ #:window-should-close
212+ #:close-window
213+ #:is-window-ready
214+ #:is-window-minimized
215+ #:is-window-resized
216+ #:is-window-hidden
217+ #:is-window-fullscreen
218+ #:toggle-fullscreen
219+ #:unhide-window
220+ #:hide-window
221+ #:set-window-icon
222+ #:set-window-title
223+ #:set-window-position
224+ #:set-window-monitor
225+ #:set-window-min-size
226+ #:set-window-size
227+ #:get-window-handle
228+ #:get-screen-width
229+ #:get-screen-height
230+ #:get-monitor-count
231+ #:get-monitor-width
232+ #:get-monitor-height
233+ #:get-monitor-physical-width
234+ #:get-monitor-physical-height
235+ #:get-window-position
236+ #:get-monitor-name
237+ #:get-clipboard-text
238+ #:set-clipboard-text
239+ #:show-cursor
240+ #:hide-cursor
241+ #:is-cursor-hidden
242+ #:enable-cursor
243+ #:disable-cursor
244+ #:clear-background
245+ #:begin-drawing
246+ #:end-drawing
247+ #:begin-mode-2d
248+ #:end-mode-2d
249+ #:begin-mode-3d
250+ #:end-mode-3d
251+ #:begin-texture-mode
252+ #:end-texture-mode
253+ #:begin-scissor-mode
254+ #:end-scissor-mode
255+ #:get-mouse-ray
256+ #:get-camera-matrix
257+ #:get-camera-matrix-2d
258+ #:get-world-to-screen
259+ #:set-target-fps
260+ #:get-fps
261+ #:get-frame-time
262+ #:get-time
263+ #:color-to-int
264+ #:color-normalize
265+ #:color-from-normalized
266+ #:color-to-hsv
267+ #:color-from-hsv
268+ #:get-color
269+ #:fade
270+ #:set-config-flags
271+ #:set-trace-log-level
272+ #:set-trace-log-exit
273+ #:trace-log
274+ #:take-screenshot
275+ #:get-random-value
276+ #:load-file-data
277+ #:save-file-data
278+ #:load-file-text
279+ #:save-file-text
280+ #:file-exists
281+ #:is-file-extension
282+ #:directory-exists
283+ #:get-extension
284+ #:get-file-name
285+ #:get-file-name-without-ext
286+ #:get-directory-path
287+ #:get-prev-directory-path
288+ #:get-working-directory
289+ #:get-directory-files
290+ #:change-directory
291+ #:is-file-dropped
292+ #:get-dropped-files
293+ #:clear-dropped-files
294+ #:get-file-mod-time
295+ #:compress-data
296+ #:decompress-data
297+ #:save-storage-value
298+ #:load-storage-value
299+ #:open-url
300+ #:is-key-pressed
301+ #:is-key-down
302+ #:is-key-released
303+ #:is-key-up
304+ #:set-exit-key
305+ #:get-key-pressed
306+ #:is-gamepad-available
307+ #:is-gamepad-name
308+ #:get-gamepad-name
309+ #:is-gamepad-button-pressed
310+ #:is-gamepad-button-down
311+ #:is-gamepad-button-released
312+ #:is-gamepad-button-up
313+ #:get-gamepad-button-pressed
314+ #:get-gamepad-axis-count
315+ #:get-gamepad-axis-movement
316+ #:is-mouse-button-pressed
317+ #:is-mouse-button-down
318+ #:is-mouse-button-released
319+ #:is-mouse-button-up
320+ #:get-mouse-x
321+ #:get-mouse-y
322+ #:get-mouse-position
323+ #:set-mouse-position
324+ #:set-mouse-offset
325+ #:set-mouse-scale
326+ #:get-mouse-wheel-move
327+ #:get-touch-x
328+ #:get-touch-y
329+ #:get-touch-position
330+ #:set-gestures-enabled
331+ #:is-gesture-detected
332+ #:get-gesture-detected
333+ #:get-touch-points-count
334+ #:get-gesture-hold-duration
335+ #:get-gesture-drag-vector
336+ #:get-gesture-drag-angle
337+ #:get-gesture-pinch-vector
338+ #:get-gesture-pinch-angle
339+ #:set-camera-mode
340+ #:update-camera
341+ #:set-camera-pan-control
342+ #:set-camera-alt-control
343+ #:set-camera-smooth-zoom-control
344+ #:set-camera-move-controls
345+ #:draw-pixel
346+ #:draw-pixel-v
347+ #:draw-line
348+ #:draw-line-v
349+ #:draw-line-ex
350+ #:draw-line-bezier
351+ #:draw-line-strip
352+ #:draw-circle
353+ #:draw-circle-sector
354+ #:draw-circle-sector-lines
355+ #:draw-circle-gradient
356+ #:draw-circle-v
357+ #:draw-circle-lines
358+ #:draw-ellipse
359+ #:draw-ellipse-lines
360+ #:draw-ring
361+ #:draw-ring-lines
362+ #:draw-rectangle
363+ #:draw-rectangle-rec
364+ #:draw-rectangle-pro
365+ #:draw-rectangle-gradient-v
366+ #:draw-rectangle-gradient-h
367+ #:draw-rectangle-gradient-ex
368+ #:draw-rectangle-lines
369+ #:draw-rectangle-lines-ex
370+ #:draw-rectangle-rounded
371+ #:draw-rectangle-rounded-lines
372+ #:draw-triangle
373+ #:draw-triangle-lines
374+ #:draw-triangle-fan
375+ #:draw-triangle-strip
376+ #:draw-poly
377+ #:draw-poly-lines
378+ #:check-collision-recs
379+ #:check-collision-circles
380+ #:check-collision-circle-rec
381+ #:get-collision-rec
382+ #:check-collision-point-rec
383+ #:check-collision-point-circle
384+ #:check-collision-point-triangle
385+ #:load-image
386+ #:load-image-ex
387+ #:load-image-pro
388+ #:load-image-raw
389+ #:unload-image
390+ #:export-image
391+ #:export-image-as-code
392+ #:get-image-data
393+ #:get-image-data-normalized
394+ #:gen-image-color
395+ #:gen-image-gradient-v
396+ #:gen-image-gradient-h
397+ #:gen-image-gradient-radial
398+ #:gen-image-checked
399+ #:gen-image-white-noise
400+ #:gen-image-perlin-noise
401+ #:gen-image-cellular
402+ #:image-copy
403+ #:image-from-image
404+ #:image-text
405+ #:image-text-ex
406+ #:image-to-pot
407+ #:image-format
408+ #:image-alpha-mask
409+ #:image-alpha-clear
410+ #:image-alpha-crop
411+ #:image-alpha-premultiply
412+ #:image-crop
413+ #:image-resize
414+ #:image-resize-n-n
415+ #:image-resize-canvas
416+ #:image-mipmaps
417+ #:image-dither
418+ #:image-flip-vertical
419+ #:image-flip-horizontal
420+ #:image-rotate-cw
421+ #:image-rotate-ccw
422+ #:image-color-tint
423+ #:image-color-invert
424+ #:image-color-grayscale
425+ #:image-color-contrast
426+ #:image-color-brightness
427+ #:image-color-replace
428+ #:image-extract-palette
429+ #:get-image-alpha-border
430+ #:load-texture
431+ #:load-texture-from-image
432+ #:load-texture-cubemap
433+ #:load-render-texture
434+ #:unload-texture
435+ #:unload-render-texture
436+ #:update-texture
437+ #:get-texture-data
438+ #:get-screen-data
439+ #:gen-texture-mipmaps
440+ #:set-texture-filter
441+ #:set-texture-wrap
442+ #:draw-texture
443+ #:draw-texture-v
444+ #:draw-texture-ex
445+ #:draw-texture-rec
446+ #:draw-texture-quad
447+ #:draw-texture-pro
448+ #:draw-texture-n-patch
449+ #:get-font-default
450+ #:load-font
451+ #:load-font-ex
452+ #:load-font-from-image
453+ #:load-font-data
454+ #:unload-font
455+ #:draw-fps
456+ #:draw-text
457+ #:draw-text-ex
458+ #:draw-text-rec
459+ #:draw-text-rec-ex
460+ #:draw-text-codepoint
461+ #:measure-text
462+ #:measure-text-ex
463+ #:get-glyph-index
464+ #:text-copy
465+ #:text-is-equal
466+ #:text-length
467+ #:text-format
468+ #:text-subtext
469+ #:text-replace
470+ #:text-insert
471+ #:text-join
472+ #:text-split
473+ #:text-append
474+ #:text-find-index
475+ #:text-to-upper
476+ #:text-to-lower
477+ #:text-to-pascal
478+ #:text-to-integer
479+ #:text-to-utf8
480+ #:get-codepoints
481+ #:get-codepoints-count
482+ #:get-next-codepoint
483+ #:codepoint-to-utf8
484+ #:draw-line-3d
485+ #:draw-circle-3d
486+ #:draw-cube
487+ #:draw-cube-v
488+ #:draw-cube-wires
489+ #:draw-cube-wires-v
490+ #:draw-cube-texture
491+ #:draw-sphere
492+ #:draw-sphere-ex
493+ #:draw-sphere-wires
494+ #:draw-cylinder
495+ #:draw-cylinder-wires
496+ #:draw-plance
497+ #:draw-ray
498+ #:draw-grid
499+ #:draw-gizmo
500+ #:load-model
501+ #:load-model-from-mesh
502+ #:unload-model
503+ #:load-meshes
504+ #:export-mesh
505+ #:unload-mesh
506+ #:load-materials
507+ #:load-material-defaults
508+ #:unload-material
509+ #:set-material-texture
510+ #:set-model-mesh-material
511+ #:load-model-animations
512+ #:update-model-animation
513+ #:unload-model-animation
514+ #:is-model-animation-valid
515+ #:gen-mesh-plane
516+ #:gen-mesh-cube
517+ #:gen-mesh-sphere
518+ #:gen-mesh-hemi-sphere
519+ #:gen-mesh-cylinder
520+ #:gen-mesh-torus
521+ #:gen-mesh-knot
522+ #:gen-mesh-heightmap
523+ #:gen-mesh-cubicmap
524+ #:mesh-bounding-box
525+ #:mesh-tangents
526+ #:mesh-binormals
527+ #:draw-model
528+ #:draw-model-ex
529+ #:draw-model-wires
530+ #:draw-model-wires-ex
531+ #:draw-bounding-box
532+ #:draw-billboard
533+ #:draw-billboard-rec
534+ #:calculate-bounding-box
535+ #:check-collision-spheres
536+ #:check-collision-boxes
537+ #:check-collision-box-sphere
538+ #:check-collision-ray-sphere
539+ #:check-collision-ray-sphere-ex
540+ #:check-collision-ray-box
541+ #:get-collision-ray-model
542+ #:get-collision-ray-triangle
543+ #:get-collision-ray-ground
544+ #:load-shader
545+ #:load-shader-code
546+ #:unload-shader
547+ #:get-shader-default
548+ #:get-texture-default
549+ #:get-shapes-texture
550+ #:get-shapes-texture-rec
551+ #:set-shapes-texture
552+ #:get-shader-location
553+ #:set-shader-value
554+ #:set-shader-value-v
555+ #:set-shader-value-matrix
556+ #:set-shader-value-texture
557+ #:set-matrix-projection
558+ #:set-matrix-modelview
559+ #:get-matrix-modelview
560+ #:get-matrix-projection
561+ #:gen-texture-cubemap
562+ #:gen-texture-irradiance
563+ #:gen-texture-prefilter
564+ #:gen-texture-brdf
565+ #:begin-shader-mode
566+ #:end-shader-mode
567+ #:begin-blend-mode
568+ #:end-blend-mode
569+ #:init-vr-simulator
570+ #:close-vr-simulator
571+ #:update-vr-tracking
572+ #:set-vr-configuration
573+ #:is-vr-simulator-ready
574+ #:toggle-vr-mode
575+ #:begin-vr-drawing
576+ #:end-vr-drawing
577+ #:init-audio-device
578+ #:close-audio-device
579+ #:is-audio-device-ready
580+ #:set-master-volume
581+ #:load-wave
582+ #:load-sound
583+ #:load-sound-from-wave
584+ #:update-sound
585+ #:unload-wave
586+ #:unload-sound
587+ #:export-wave
588+ #:export-wave-as-code
589+ #:play-sound
590+ #:pause-sound
591+ #:resume-sound
592+ #:play-sound-multi
593+ #:stop-sound-multi
594+ #:get-sounds-playing
595+ #:is-sound-playing
596+ #:set-sound-volume
597+ #:set-sound-pitch
598+ #:wave-format
599+ #:wave-copy
600+ #:wave-crop
601+ #:get-wave-data
602+ #:load-music-stream
603+ #:unload-music-stream
604+ #:play-music-stream
605+ #:update-music-stream
606+ #:stop-music-stream
607+ #:pause-music-stream
608+ #:resume-music-stream
609+ #:is-music-playing
610+ #:set-music-volume
611+ #:set-music-pitch
612+ #:get-music-loop-count
613+ #:get-music-time-length
614+ #:get-music-time-played
615+ #:init-audio-stream
616+ #:update-audio-stream
617+ #:close-audio-stream
618+ #:is-audio-stream-processed
619+ #:play-audio-stream
620+ #:pause-audio-stream
621+ #:resume-audio-stream
622+ #:is-audio-stream-palying
623+ #:stop-audio-stream
624+ #:set-audio-stream-volume
625+ #:set-audio-stream-pitch
626+ #:set-audio-stream-buffer-size
627+
628+
629+ ;; high level api
630+ #:with-window
631+ #:with-drawing
632+ #:with-mode-2d
633+ #:with-mode-3d
634+ #:with-texture-mode
635+ #:with-shader-mode
636+ #:with-blend-mode
637+ #:with-vr-simulator
638+ #:with-vr-drawing
639+ #:with-audio-device
640+ #:with-audio-stream))
diff -r b30940a5b53e -r f964dff7e1de raylib/raylib.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/raylib.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,4419 @@
1+(in-package #:cl-raylib)
2+;;/**********************************************************************************************
3+;;*
4+;;* raylib - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
5+;;*
6+;;* FEATURES:
7+;;* - NO external dependencies, all required libraries included with raylib
8+;;* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
9+;;* - Written in plain C code (C99) in PascalCase/camelCase notation
10+;;* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
11+;;* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
12+;;* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts)
13+;;* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
14+;;* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
15+;;* - Flexible Materials system, supporting classic maps and PBR maps
16+;;* - Skeletal Animation support (CPU bones-based animation)
17+;;* - Shaders support, including Model shaders and Postprocessing shaders
18+;;* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
19+;;* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
20+;;* - VR stereo rendering with configurable HMD device parameters
21+;;* - Bindings to multiple programming languages available!
22+;;*
23+;;* NOTES:
24+;;* One custom font is loaded by default when InitWindow() [core]
25+;;* If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl]
26+;;* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads
27+;;*
28+;;* DEPENDENCIES (included):
29+;;* [core] rglfw (github.com/glfw/glfw) for window/context management and input (only PLATFORM_DESKTOP)
30+;;* [rlgl] glad (github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (only PLATFORM_DESKTOP)
31+;;* [raudio] miniaudio (github.com/dr-soft/miniaudio) for audio device/context management
32+;;*
33+;;* OPTIONAL DEPENDENCIES (included):
34+;;* [core] rgif (Charlie Tangora, Ramon Santamaria) for GIF recording
35+;;* [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
36+;;* [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG)
37+;;* [textures] stb_image_resize (Sean Barret) for image resizing algorithms
38+;;* [textures] stb_perlin (Sean Barret) for Perlin noise image generation
39+;;* [text] stb_truetype (Sean Barret) for ttf fonts loading
40+;;* [text] stb_rect_pack (Sean Barret) for rectangles packing
41+;;* [models] par_shapes (Philip Rideout) for parametric 3d shapes generation
42+;;* [models] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL)
43+;;* [models] cgltf (Johannes Kuhlmann) for models loading (glTF)
44+;;* [raudio] stb_vorbis (Sean Barret) for OGG audio loading
45+;;* [raudio] dr_flac (David Reid) for FLAC audio file loading
46+;;* [raudio] dr_mp3 (David Reid) for MP3 audio file loading
47+;;* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading
48+;;* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading
49+;;*
50+;;*
51+;;* LICENSE: zlib/libpng
52+;;*
53+;;* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
54+;;* BSD-like license that allows static linking with closed source software:
55+;;*
56+;;* Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
57+;;*
58+;;* This software is provided "as-is", without any express or implied warranty. In no event
59+;;* will the authors be held liable for any damages arising from the use of this software.
60+;;*
61+;;* Permission is granted to anyone to use this software for any purpose, including commercial
62+;;* applications, and to alter it and redistribute it freely, subject to the following restrictions:
63+;;*
64+;;* 1. The origin of this software must not be misrepresented; you must not claim that you
65+;;* wrote the original software. If you use this software in a product, an acknowledgment
66+;;* in the product documentation would be appreciated but is not required.
67+;;*
68+;;* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
69+;;* as being the original software.
70+;;*
71+;;* 3. This notice may not be removed or altered from any source distribution.
72+;;*
73+;;**********************************************************************************************/
74+;;
75+;;#ifndef RAYLIB_H
76+;;#define RAYLIB_H
77+;;
78+;;#include <stdarg.h> // Required for: va_list - Only used by TraceLogCallback
79+;;
80+;;#if defined(_WIN32)
81+;; // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll
82+;; #if defined(BUILD_LIBTYPE_SHARED)
83+;; #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll)
84+;; #elif defined(USE_LIBTYPE_SHARED)
85+;; #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll)
86+;; #else
87+;; #define RLAPI // We are building or using raylib as a static library
88+;; #endif
89+;;#else
90+;; #define RLAPI // We are building or using raylib as a static library (or Linux shared library)
91+;;#endif
92+;;
93+;;//----------------------------------------------------------------------------------
94+;;// Some basic Defines
95+;;//----------------------------------------------------------------------------------
96+;;#ifndef PI
97+;; #define PI 3.14159265358979323846f
98+;;#endif
99+;;
100+;;#define DEG2RAD (PI/180.0f)
101+;;#define RAD2DEG (180.0f/PI)
102+;;
103+;;#define MAX_TOUCH_POINTS 10 // Maximum number of touch points supported
104+;;
105+;;// Allow custom memory allocators
106+;;#ifndef RL_MALLOC
107+;; #define RL_MALLOC(sz) malloc(sz)
108+;;#endif
109+;;#ifndef RL_CALLOC
110+;; #define RL_CALLOC(n,sz) calloc(n,sz)
111+;;#endif
112+;;#ifndef RL_REALLOC
113+;; #define RL_REALLOC(ptr,sz) realloc(ptr,sz)
114+;;#endif
115+;;#ifndef RL_FREE
116+;; #define RL_FREE(ptr) free(ptr)
117+;;#endif
118+;;
119+;;// NOTE: MSC C++ compiler does not support compound literals (C99 feature)
120+;;// Plain structures in C++ (without constructors) can be initialized from { } initializers.
121+;;#if defined(__cplusplus)
122+;; #define CLITERAL(type) type
123+;;#else
124+;; #define CLITERAL(type) (type)
125+;;#endif
126+;;
127+;;// Some Basic Colors
128+;;// NOTE: Custom raylib color palette for amazing visuals on WHITE background
129+;;#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray
130+(define-constant +lightgray+ '(200 200 200 255) :test #'equal)
131+;;#define GRAY CLITERAL(Color){ 130, 130, 130, 255 } // Gray
132+(define-constant +gray+ '(130 130 130 255) :test #'equal)
133+;;#define DARKGRAY CLITERAL(Color){ 80, 80, 80, 255 } // Dark Gray
134+(define-constant +darkgray+ '(80 80 80 255) :test #'equal)
135+;;#define YELLOW CLITERAL(Color){ 253, 249, 0, 255 } // Yellow
136+(define-constant +yellow+ '(253 249 0 255) :test #'equal)
137+;;#define GOLD CLITERAL(Color){ 255, 203, 0, 255 } // Gold
138+(define-constant +gold+ '(255 203 0 255) :test #'equal)
139+;;#define ORANGE CLITERAL(Color){ 255, 161, 0, 255 } // Orange
140+(define-constant +orange+ '(255 161 0 255 ) :test #'equal)
141+;;#define PINK CLITERAL(Color){ 255, 109, 194, 255 } // Pink
142+(define-constant +pink+ '(255 109 194 255) :test #'equal)
143+;;#define RED CLITERAL(Color){ 230, 41, 55, 255 } // Red
144+(define-constant +red+ '( 230 41 55 255 ) :test #'equal)
145+;;#define MAROON CLITERAL(Color){ 190, 33, 55, 255 } // Maroon
146+(define-constant +maroon+ '(190 33 55 255) :test #'equal)
147+;;#define GREEN CLITERAL(Color){ 0, 228, 48, 255 } // Green
148+(define-constant +green+ '(0 228 48 255) :test #'equal)
149+;;#define LIME CLITERAL(Color){ 0, 158, 47, 255 } // Lime
150+(define-constant +lime+ '(0 158 47 255) :test #'equal)
151+;;#define DARKGREEN CLITERAL(Color){ 0, 117, 44, 255 } // Dark Green
152+(define-constant +darkgreen+ '(0 117 44 255) :test #'equal)
153+;;#define SKYBLUE CLITERAL(Color){ 102, 191, 255, 255 } // Sky Blue
154+(define-constant +skyblue+ '(102 191 255 255) :test #'equal)
155+;;#define BLUE CLITERAL(Color){ 0, 121, 241, 255 } // Blue
156+(define-constant +blue+ '(0 121 241 255) :test #'equal)
157+;;#define DARKBLUE CLITERAL(Color){ 0, 82, 172, 255 } // Dark Blue
158+(define-constant +darkblue+ '(0 82 172 255) :test #'equal)
159+;;#define PURPLE CLITERAL(Color){ 200, 122, 255, 255 } // Purple
160+(define-constant +purple+ '(200 122 255 255) :test #'equal)
161+;;#define VIOLET CLITERAL(Color){ 135, 60, 190, 255 } // Violet
162+(define-constant +violet+ '(135 60 190 255) :test #'equal)
163+;;#define DARKPURPLE CLITERAL(Color){ 112, 31, 126, 255 } // Dark Purple
164+(define-constant +darkpurple+ '(112 31 126 255) :test #'equal)
165+;;#define BEIGE CLITERAL(Color){ 211, 176, 131, 255 } // Beige
166+(define-constant +beige+ '(211 176 131 255) :test #'equal)
167+;;#define BROWN CLITERAL(Color){ 127, 106, 79, 255 } // Brown
168+(define-constant +brown+ '(127 106 79 255) :test #'equal)
169+;;#define DARKBROWN CLITERAL(Color){ 76, 63, 47, 255 } // Dark Brown
170+(define-constant +darkbrown+ '(76 63 47 255) :test #'equal)
171+;;
172+;;#define WHITE CLITERAL(Color){ 255, 255, 255, 255 } // White
173+(define-constant +white+ '(255 255 255 255) :test #'equal)
174+;;#define BLACK CLITERAL(Color){ 0, 0, 0, 255 } // Black
175+(define-constant +black+ '(0 0 0 255) :test #'equal)
176+;;#define BLANK CLITERAL(Color){ 0, 0, 0, 0 } // Blank (Transparent)
177+(define-constant +blank+ '(0 0 0 0) :test #'equal)
178+;;#define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta
179+(define-constant +magenta+ '(255 0 255 255) :test #'equal)
180+;;#define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo)
181+(define-constant +raywhite+ '(245 245 245 255) :test #'equal)
182+
183+;;// Temporal hack to avoid breaking old codebases using
184+;;// deprecated raylib implementation of these functions
185+;;#define FormatText TextFormat
186+;;#define SubText TextSubtext
187+;;#define ShowWindow UnhideWindow
188+;;#define LoadText LoadFileText
189+;;
190+;;//----------------------------------------------------------------------------------
191+;;// Structures Definition
192+;;//----------------------------------------------------------------------------------
193+;;// Boolean type
194+;;#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
195+;; #include <stdbool.h>
196+;;#elif !defined(__cplusplus) && !defined(bool)
197+;; typedef enum { false, true } bool;
198+;;#endif
199+;;
200+;;// Vector2 type
201+;;typedef struct Vector2 {
202+;; float x;
203+;; float y;
204+;;} Vector2;
205+(defcstruct (%vector2 :class vector2-type)
206+ "Vector2 type"
207+ (x :float)
208+ (y :float))
209+
210+(defstruct vector2
211+ x y)
212+
213+(defmethod translate-into-foreign-memory (object (type vector2-type) pointer)
214+ (with-foreign-slots ((x y) pointer (:struct %vector2))
215+ (setf x (coerce (vector2-x object) 'float))
216+ (setf y (coerce (vector2-y object) 'float))))
217+
218+(defmethod translate-from-foreign (pointer (type vector2-type))
219+ (with-foreign-slots ((x y) pointer (:struct %vector2))
220+ (make-vector2 :x x :y y)))
221+
222+;;// Vector3 type
223+;;typedef struct Vector3 {
224+;; float x;
225+;; float y;
226+;; float z;
227+;;} Vector3;
228+(defcstruct (%vector3 :class vector3-type)
229+ "Vector3 type"
230+ (x :float)
231+ (y :float)
232+ (z :float))
233+
234+(defstruct vector3
235+ x y z)
236+
237+(defmethod translate-into-foreign-memory (object (type vector3-type) pointer)
238+ (with-foreign-slots ((x y z) pointer (:struct %vector3))
239+ (setf x (coerce (vector3-x object) 'float))
240+ (setf y (coerce (vector3-y object) 'float))
241+ (setf z (coerce (vector3-z object) 'float))))
242+
243+(defmethod translate-from-foreign (pointer (type vector3-type))
244+ (with-foreign-slots ((x y z) pointer (:struct %vector3))
245+ (make-vector3 :x x :y y :z z)))
246+
247+;;// Vector4 type
248+;;typedef struct Vector4 {
249+;; float x;
250+;; float y;
251+;; float z;
252+;; float w;
253+;;} Vector4;
254+(defcstruct (%vector4 :class vector4-type)
255+ "Vector4 type"
256+ (x :float)
257+ (y :float)
258+ (z :float)
259+ (w :float))
260+
261+(defstruct vector4
262+ x y z w)
263+
264+(defmethod translate-into-foreign-memory (object (type vector4-type) pointer)
265+ (with-foreign-slots ((x y z w) pointer (:struct %vector4))
266+ (setf x (coerce (vector4-x object) 'float))
267+ (setf y (coerce (vector4-y object) 'float))
268+ (setf z (coerce (vector4-z object) 'float))
269+ (setf w (coerce (vector4-w object) 'float))))
270+
271+(defmethod translate-from-foreign (pointer (type vector4-type))
272+ (with-foreign-slots ((x y z w) pointer (:struct %vector4))
273+ (make-vector4 :x x :y y :z z :w w)))
274+;;
275+;;// Quaternion type, same as Vector4
276+;;typedef Vector4 Quaternion;
277+;;
278+;;// Matrix type (OpenGL style 4x4 - right handed, column major)
279+;;typedef struct Matrix {
280+;; float m0, m4, m8, m12;
281+;; float m1, m5, m9, m13;
282+;; float m2, m6, m10, m14;
283+;; float m3, m7, m11, m15;
284+;;} Matrix;
285+(defcstruct (%matrix :class matrix-type)
286+ "Matrix type (OpenGL style 4x4"
287+ (m0 :float) (m4 :float) (m8 :float) (m12 :float)
288+ (m1 :float) (m5 :float) (m9 :float) (m13 :float)
289+ (m2 :float) (m6 :float) (m10 :float) (m14 :float)
290+ (m3 :float) (m7 :float) (m11 :float) (m15 :float))
291+
292+(defmethod translate-into-foreign-memory (object (type matrix-type) pointer)
293+ (with-foreign-slots ((m0 m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15) pointer (:struct %matrix))
294+ (setf m0 (coerce (nth 0 object) 'float))
295+ (setf m1 (coerce (nth 1 object) 'float))
296+ (setf m2 (coerce (nth 2 object) 'float))
297+ (setf m3 (coerce (nth 3 object) 'float))
298+ (setf m4 (coerce (nth 4 object) 'float))
299+ (setf m5 (coerce (nth 5 object) 'float))
300+ (setf m6 (coerce (nth 6 object) 'float))
301+ (setf m7 (coerce (nth 7 object) 'float))
302+ (setf m8 (coerce (nth 8 object) 'float))
303+ (setf m9 (coerce (nth 9 object) 'float))
304+ (setf m10 (coerce (nth 10 object) 'float))
305+ (setf m11 (coerce (nth 11 object) 'float))
306+ (setf m12 (coerce (nth 12 object) 'float))
307+ (setf m13 (coerce (nth 13 object) 'float))
308+ (setf m14 (coerce (nth 14 object) 'float))
309+ (setf m15 (coerce (nth 15 object) 'float))))
310+
311+(defmethod translate-from-foreign (pointer (type matrix-type))
312+ (with-foreign-slots ((m0 m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15) pointer (:struct %matrix))
313+ (list m0 m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15)))
314+
315+;;// Color type, RGBA (32bit)
316+;;typedef struct Color {
317+;; unsigned char r;
318+;; unsigned char g;
319+;; unsigned char b;
320+;; unsigned char a;
321+;;} Color;
322+(defcstruct (%color :class color-type)
323+ "Color type, RGBA (32bit)"
324+ (r :unsigned-char)
325+ (g :unsigned-char)
326+ (b :unsigned-char)
327+ (a :unsigned-char))
328+
329+(defmethod translate-into-foreign-memory (object (type color-type) pointer)
330+ (with-foreign-slots ((r g b a) pointer (:struct %color))
331+ (setf r (nth 0 object))
332+ (setf g (nth 1 object))
333+ (setf b (nth 2 object))
334+ (setf a (nth 3 object))))
335+
336+(defmethod translate-from-foreign (pointer (type color-type))
337+ (with-foreign-slots ((r g b a) pointer (:struct %color))
338+ (list r g b a)))
339+
340+;;// Rectangle type
341+;;typedef struct Rectangle {
342+;; float x;
343+;; float y;
344+;; float width;
345+;; float height;
346+;;} Rectangle;
347+(defcstruct (%rectangle :class rectangle-type)
348+ "Rectangle type"
349+ (x :float)
350+ (y :float)
351+ (width :float)
352+ (height :float))
353+
354+(defstruct rectangle
355+ x y width height)
356+
357+(defmethod translate-into-foreign-memory (object (type rectangle-type) pointer)
358+ (with-foreign-slots ((x y width height) pointer (:struct %rectangle))
359+ (setf x (coerce (rectangle-x object) 'float))
360+ (setf y (coerce (rectangle-y object) 'float))
361+ (setf width (coerce (rectangle-width object) 'float))
362+ (setf height (coerce (rectangle-height object) 'float))))
363+
364+(defmethod translate-from-foreign (pointer (type rectangle-type))
365+ (with-foreign-slots ((x y width height) pointer (:struct %rectangle))
366+ (make-rectangle :x x :y y :width width :height height)))
367+
368+;;// Image type, bpp always RGBA (32bit)
369+;;// NOTE: Data stored in CPU memory (RAM)
370+;;typedef struct Image {
371+;; void *data; // Image raw data
372+;; int width; // Image base width
373+;; int height; // Image base height
374+;; int mipmaps; // Mipmap levels, 1 by default
375+;; int format; // Data format (PixelFormat type)
376+;;} Image;
377+(defcstruct (%image :class image-type)
378+"Image type, bpp always RGBA (32bit)"
379+ (data :pointer)
380+ (width :int)
381+ (height :int)
382+ (maps :int)
383+ (ft :int))
384+
385+(defstruct image
386+ data width height maps ft)
387+
388+(defmethod translate-into-foreign-memory (object (type image-type) pointer)
389+ (with-foreign-slots ((data width height maps ft) pointer (:struct %image))
390+ (setf data (image-data object))
391+ (setf width (image-width object))
392+ (setf height (image-height object))
393+ (setf maps (image-maps object))
394+ (setf ft (image-ft object))))
395+
396+(defmethod translate-from-foreign (pointer (type image-type))
397+ (with-foreign-slots ((data width height maps ft) pointer (:struct %image))
398+ (make-image :data data :width width :height height :maps maps :ft ft)))
399+
400+;;// Texture2D type
401+;;// NOTE: Data stored in GPU memory
402+;;typedef struct Texture2D {
403+;; unsigned int id; // OpenGL texture id
404+;; int width; // Texture base width
405+;; int height; // Texture base height
406+;; int mipmaps; // Mipmap levels, 1 by default
407+;; int format; // Data format (PixelFormat type)
408+;;} Texture2D;
409+;;
410+;;// Texture type, same as Texture2D
411+;;typedef Texture2D Texture;
412+;;
413+(defcstruct (%texture :class texture-type)
414+ "Texture type"
415+ (id :unsigned-int)
416+ (width :int)
417+ (height :int)
418+ (mipmaps :int)
419+ (format :int))
420+
421+(defstruct texture
422+ id width height mipmaps format)
423+
424+(defmethod translate-into-foreign-memory (object (type texture-type) pointer)
425+ (with-foreign-slots ((id width height mipmaps format) pointer (:struct %texture))
426+ (setf id (texture-id object))
427+ (setf width (texture-width object))
428+ (setf height (texture-height object))
429+ (setf mipmaps (texture-mipmaps object))
430+ (setf format (texture-format object))))
431+
432+(defmethod translate-from-foreign (pointer (type texture-type))
433+ (with-foreign-slots ((id width height mipmaps format) pointer (:struct %texture))
434+ (make-texture :id id :width width :height height :mipmaps mipmaps :format format)))
435+
436+;;// TextureCubemap type, actually, same as Texture2D
437+;;typedef Texture2D TextureCubemap;
438+(defctype texture-cubemap (:struct %texture))
439+
440+;;// RenderTexture2D type, for texture rendering
441+;;typedef struct RenderTexture2D {
442+;; unsigned int id; // OpenGL Framebuffer Object (FBO) id
443+;; Texture2D texture; // Color buffer attachment texture
444+;; Texture2D depth; // Depth buffer attachment texture
445+;; bool depthTexture; // Track if depth attachment is a texture or renderbuffer
446+;;} RenderTexture2D;
447+;;
448+;;// RenderTexture type, same as RenderTexture2D
449+;;typedef RenderTexture2D RenderTexture;
450+(defcstruct (%render-texture :class render-texture-type)
451+ "RenderTexture2D type, for texture rendering"
452+ (id :unsigned-int)
453+ (texture (:struct %texture))
454+ (depth (:struct %texture))
455+ (depth-texture :boolean))
456+
457+(defstruct render-texture
458+ id texture depth depth-texture)
459+
460+(defmethod translate-into-foreign-memory (object (type render-texture-type) pointer)
461+ (with-foreign-slots ((id depth-texture) pointer (:struct %render-texture))
462+ (convert-into-foreign-memory (reander-texture-texture object) '(:struct %texture) (foreign-slot-pointer pointer '(:struct %render-texture) 'texture))
463+ (convert-into-foreign-memory (reander-texture-depth object) '(:struct %texture) (foreign-slot-pointer pointer '(:struct %render-texture) 'depth))
464+ (setf id (render-texture-id object))
465+ (setf depth-texture (render-texture-depth-texture object))))
466+
467+(defmethod translate-from-foreign (pointer (type render-texture-type))
468+ (with-foreign-slots ((id texture depth depth-texture) pointer (:struct %render-texture))
469+ (let* ((tid (foreign-slot-value texture '(:struct %texture) 'id))
470+ (twidth (foreign-slot-value texture '(:struct %texture) 'width))
471+ (theight (foreign-slot-value texture '(:struct %texture) 'height))
472+ (tmipmaps (foreign-slot-value texture '(:struct %texture) 'mipmaps))
473+ (tformat (foreign-slot-value texture '(:struct %texture) 'format))
474+ (did (foreign-slot-value depth '(:struct %texture) 'id))
475+ (dwidth (foreign-slot-value depth '(:struct %texture) 'width))
476+ (dheight (foreign-slot-value depth '(:struct %texture) 'height))
477+ (dmipmaps (foreign-slot-value depth '(:struct %texture) 'mipmaps))
478+ (dformat (foreign-slot-value depth '(:struct %texture) 'format)))
479+ (make-render-texture :id id
480+ :texture (make-texture :id tid :width twidth :height theight :mipmaps tmipmaps :format tformat)
481+ :depth (make-texture :id did :width dwidth :height dheight :mipmaps dmipmaps :format dformat)
482+ :depth-texture depth-texture))))
483+;;
484+;;// N-Patch layout info
485+;;typedef struct NPatchInfo {
486+;; Rectangle sourceRec; // Region in the texture
487+;; int left; // left border offset
488+;; int top; // top border offset
489+;; int right; // right border offset
490+;; int bottom; // bottom border offset
491+;; int type; // layout of the n-patch: 3x3, 1x3 or 3x1
492+;;} NPatchInfo;
493+(defcstruct (%patch-info :class patch-info-type)
494+ "N-Patch layout info"
495+ (source-rec (:struct %rectangle))
496+ (left :int)
497+ (top :int)
498+ (right :int)
499+ (bottom :int)
500+ (type :int))
501+
502+(defstruct patch-info
503+ rec left top right bottom type)
504+
505+(defmethod translate-into-foreign-memory (object (type patch-info-type) pointer)
506+ (with-foreign-slots ((left top right bottom type) pointer (:struct %patch-info))
507+ (convert-into-foreign-memory (patch-info-rec object) '(:struct %rectangle) (foreign-slot-pointer pointer '(:struct %patch-info) 'source-rec))
508+ (setf left (patch-info-left object))
509+ (setf top (patch-info-top object))
510+ (setf right (patch-info-right object))
511+ (setf bottom (patch-info-bottom object))
512+ (setf type (patch-info-type object))))
513+
514+(defmethod translate-from-foreign (pointer (type patch-info-type))
515+ (with-foreign-slots ((source-rec left top right bottom type) pointer (:struct %patch-info))
516+ (let ((rx (foreign-slot-value source-rec '(:struct %rectangle) 'x))
517+ (ry (foreign-slot-value source-rec '(:struct %rectangle) 'y))
518+ (rwidth (foreign-slot-value source-rec '(:struct %rectangle) 'width))
519+ (rheight (foreign-slot-value source-rec '(:struct %rectangle) 'height)))
520+ (make-patch-info :rec (make-rectangle :x rx :y ry :width rwidth :height :rheight) :left left :top top :right right :bottom bottom :type type))))
521+
522+;;// Font character info
523+;;typedef struct CharInfo {
524+;; int value; // Character value (Unicode)
525+;; int offsetX; // Character offset X when drawing
526+;; int offsetY; // Character offset Y when drawing
527+;; int advanceX; // Character advance position X
528+;; Image image; // Character image data
529+;;} CharInfo;
530+(defcstruct (%char-info :class char-info-type)
531+ "Font character info"
532+ (value :int)
533+ (offset-x :int)
534+ (offset-y :int)
535+ (advance-x :int)
536+ (image (:struct %image)))
537+
538+(defstruct char-info
539+ value offset-x offset-y advance-x image)
540+
541+(defmethod translate-into-foreign-memory (object (type char-info-type) pointer)
542+ (with-foreign-slots ((value offset-x offset-y advance-x) pointer (:struct %char-info))
543+ (convert-into-foreign-memory (char-info-image object) '(:struct %image) (foreign-slot-pointer pointer '(:struct %char-info) 'image))
544+ (setf value (char-info-value object))
545+ (setf offset-x (char-info-offset-x object))
546+ (setf offset-y (char-info-offset-y object))
547+ (setf advance-x (char-info-advance-x object))))
548+
549+(defmethod translate-from-foreign (pointer (type char-info-type))
550+ (with-foreign-slots ((value offset-x offset-y advance-x image) pointer (:struct %char-info))
551+ (let ((image-data (foreign-slot-value image '(:struct %image) 'data))
552+ (image-width (foreign-slot-value image '(:struct %image) 'width))
553+ (image-height (foreign-slot-value image '(:struct %image) 'height))
554+ (image-maps (foreign-slot-value image '(:struct %image) 'maps))
555+ (image-ft (foreign-slot-value image '(:struct %image) 'ft)))
556+ (make-char-info :value value
557+ :offset-x offset-x
558+ :offset-y offset-y
559+ :advance-x advance-x
560+ :image (make-image :data image-data :width image-width :height image-height :maps image-maps :ft image-ft)))))
561+
562+;;
563+;;// Font type, includes texture and charSet array data
564+;;typedef struct Font {
565+;; int baseSize; // Base size (default chars height)
566+;; int charsCount; // Number of characters
567+;; Texture2D texture; // Characters texture atlas
568+;; Rectangle *recs; // Characters rectangles in texture
569+;; CharInfo *chars; // Characters info data
570+;;} Font;
571+;;
572+;;#define SpriteFont Font // SpriteFont type fallback, defaults to Font
573+(defcstruct (%font :class font-type)
574+ "Font type, includes texture and charSet array data"
575+ (base-size :int)
576+ (chars-count :int)
577+ (texture (:struct %texture))
578+ (recs :pointer)
579+ (chars (:pointer (:struct %char-info))))
580+
581+(defstruct font
582+ base-size chars-count texture recs chars)
583+
584+(defmethod translate-into-foreign-memory (object (type font-type) pointer)
585+ (with-foreign-slots ((base-size chars-count recs chars) pointer (:struct %font))
586+ (convert-into-foreign-memory (font-texture object) '(:struct %texture) (foreign-slot-pointer pointer '(:struct %font) 'texture))
587+ (setf base-size (font-base-size object))
588+ (setf chars-count (font-chars-count object))
589+ (setf recs (font-recs object))
590+ (setf chars (font-chars object))))
591+
592+(defmethod translate-from-foreign (pointer (type font-type))
593+ (with-foreign-slots ((base-size chars-count texture recs chars) pointer (:struct %font))
594+ (let ((tid (foreign-slot-value texture '(:struct %texture) 'id))
595+ (twidth (foreign-slot-value texture '(:struct %texture) 'width))
596+ (theight (foreign-slot-value texture '(:struct %texture) 'height))
597+ (tmipmaps (foreign-slot-value texture '(:struct %texture) 'mipmaps))
598+ (tformat (foreign-slot-value texture '(:struct %texture) 'format)))
599+ (make-font :base-size base-size
600+ :chars-count chars-count
601+ :texture (make-texture :id tid :width twidth :height theight :mipmaps tmipmaps :format tformat)
602+ :recs recs
603+ :chars chars))))
604+
605+;;// Camera type, defines a camera position/orientation in 3d space
606+;;typedef struct Camera3D {
607+;; Vector3 position; // Camera position
608+;; Vector3 target; // Camera target it looks-at
609+;; Vector3 up; // Camera up vector (rotation over its axis)
610+;; float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
611+;; int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
612+;;} Camera3D;
613+;;
614+;;typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D
615+(defcstruct (%camera3d :class camera3d-type)
616+ "Camera type, defines a camera position/orientation in 3d space"
617+ (position (:struct %vector3))
618+ (target (:struct %vector3))
619+ (up (:struct %vector3))
620+ (fovy :float)
621+ (type :int))
622+
623+(defstruct camera3d
624+ position target up fovy type)
625+
626+(defmethod translate-into-foreign-memory (object (type camera3d-type) pointer)
627+ (with-foreign-slots ((fovy type) pointer (:struct %camera3d))
628+ (convert-into-foreign-memory (camera3d-position object) '(:struct %vector3) (foreign-slot-pointer pointer '(:struct %camera3d) 'position))
629+ (convert-into-foreign-memory (camera3d-target object) '(:struct %vector3) (foreign-slot-pointer pointer '(:struct %camera3d) 'target))
630+ (convert-into-foreign-memory (camera3d-up object) '(:struct %vector3) (foreign-slot-pointer pointer '(:struct %camera3d) 'up))
631+ (setf fovy (coerce (camera3d-fovy object) 'float)
632+ type (camera3d-type object))))
633+
634+(defmethod translate-from-foreign (pointer (type camera3d-type))
635+ (with-foreign-slots ((position target up fovy type) pointer (:struct %camera3d))
636+ (let ((px (foreign-slot-value position '(:struct %vector3) 'x))
637+ (py (foreign-slot-value position '(:struct %vector3) 'y))
638+ (pz (foreign-slot-value position '(:struct %vector3) 'z))
639+ (tx (foreign-slot-value target '(:struct %vector3) 'x))
640+ (ty (foreign-slot-value target '(:struct %vector3) 'y))
641+ (tz (foreign-slot-value target '(:struct %vector3) 'z))
642+ (ux (foreign-slot-value up '(:struct %vector3) 'x))
643+ (uy (foreign-slot-value up '(:struct %vector3) 'y))
644+ (uz (foreign-slot-value up '(:struct %vector3) 'z)))
645+ (make-camera3d :position (make-vector3 :x px :y py :z pz)
646+ :target (make-vector3 :x tx :y ty :z tz)
647+ :up (make-vector3 :x ux :y uy :z uz)
648+ :fovy fovy
649+ :type type))))
650+
651+;;// Camera2D type, defines a 2d camera
652+;;typedef struct Camera2D {
653+;; Vector2 offset; // Camera offset (displacement from target)
654+;; Vector2 target; // Camera target (rotation and zoom origin)
655+;; float rotation; // Camera rotation in degrees
656+;; float zoom; // Camera zoom (scaling), should be 1.0f by default
657+;;} Camera2D;
658+(defcstruct (%camera2d :class camera2d-type)
659+ "Camera2D type, defines a 2d camera"
660+ (offset (:struct %vector2))
661+ (target (:struct %vector2))
662+ (rotation :float)
663+ (zoom :float))
664+
665+(defstruct camera2d
666+ offset target rotation zoom)
667+
668+(defmethod translate-into-foreign-memory (object (type camera2d-type) pointer)
669+ (with-foreign-slots ((rotation zoom) pointer (:struct %camera2d))
670+ (convert-into-foreign-memory (camera2d-offset object) '(:struct %vector2) (foreign-slot-pointer pointer '(:struct %camera2d) 'offset))
671+ (convert-into-foreign-memory (camera2d-target object) '(:struct %vector2) (foreign-slot-pointer pointer '(:struct %camera2d) 'target))
672+ (setf rotation (coerce (camera2d-rotation object) 'float))
673+ (setf zoom (coerce (camera2d-zoom object) 'float))))
674+
675+(defmethod translate-from-foreign (pointer (type camera2d-type))
676+ (with-foreign-slots ((offset target rotation zoom) pointer (:struct %camera2d))
677+ (let ((ox (foreign-slot-value offset '(:struct %vector2) 'x))
678+ (oy (foreign-slot-value offset '(:struct %vector2) 'y))
679+ (tx (foreign-slot-value target '(:struct %vector2) 'x))
680+ (ty (foreign-slot-value target '(:struct %vector2) 'y)))
681+ (make-camera2d :offset (make-vector2 :x ox :y oy)
682+ :target (make-vector2 :x tx :y ty)
683+ :rotation rotation
684+ :zoom zoom))))
685+
686+;;// Vertex data definning a mesh
687+;;// NOTE: Data stored in CPU memory (and GPU)
688+;;typedef struct Mesh {
689+;; int vertexCount; // Number of vertices stored in arrays
690+;; int triangleCount; // Number of triangles stored (indexed or not)
691+;;
692+;; // Default vertex data
693+;; float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
694+;; float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
695+;; float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
696+;; float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
697+;; float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
698+;; unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
699+;; unsigned short *indices;// Vertex indices (in case vertex data comes indexed)
700+;;
701+;; // Animation vertex data
702+;; float *animVertices; // Animated vertex positions (after bones transformations)
703+;; float *animNormals; // Animated normals (after bones transformations)
704+;; int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning)
705+;; float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning)
706+;;
707+;; // OpenGL identifiers
708+;; unsigned int vaoId; // OpenGL Vertex Array Object id
709+;; unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data)
710+;;} Mesh;
711+(defcstruct (%mesh :class mesh-type)
712+ "Vertex data definning a mesh"
713+ (vertex-count :int)
714+ (triangle-count :int)
715+ (vertices (:pointer :float))
716+ (texcoords (:pointer :float))
717+ (texcoords2 (:pointer :float))
718+ (normals (:pointer :float))
719+ (tangents (:pointer :float))
720+ (colors (:pointer :unsigned-char))
721+ (indices (:pointer :unsigned-short))
722+ (anim-vertices (:pointer :float))
723+ (anim-normals (:pointer :float))
724+ (bone-ids (:pointer :int))
725+ (bone-weights (:pointer :float))
726+ (vao-id :unsigned-int)
727+ (vbo-id (:pointer :unsigned-int)))
728+
729+(defmethod translate-into-foreign-memory (object (type mesh-type) pointer)
730+ (with-foreign-slots ((vertex-count triangle-count vertices texcoords texcoords2 normals tangents colors indices anim-vertices anim-normals bone-ids bone-weights vao-id vbo-id) pointer (:struct %mesh))
731+ (setf vertex-count (nth 0 object))
732+ (setf triangle-count (nth 1 object))
733+ (setf vertices (nth 2 object))
734+ (setf texcoords (nth 3 object))
735+ (setf texcoords2 (nth 4 object))
736+ (setf normals (nth 5 object))
737+ (setf tangents (nth 6 object))
738+ (setf colors (nth 7 object))
739+ (setf indices (nth 8 object))
740+ (setf anim-vertices (nth 9 object))
741+ (setf anim-normals (nth 10 object))
742+ (setf bone-ids (nth 11 object))
743+ (setf bone-weights (nth 12 object))
744+ (setf vao-id (nth 13 object))
745+ (setf vbo-id (nth 14 object))))
746+
747+(defmethod translate-from-foreign (pointer (type mesh-type))
748+ (with-foreign-slots ((vertex-count triangle-count vertices texcoords texcoords2 normals tangents colors indices anim-vertices anim-normals bone-ids bone-weights vao-id vbo-id) pointer (:struct %mesh))
749+ (list vertex-count triangle-count vertices texcoords texcoords2 normals tangents colors indices anim-vertices anim-normals bone-ids bone-weights vao-id vbo-id)))
750+
751+;;// Shader type (generic)
752+;;typedef struct Shader {
753+;; unsigned int id; // Shader program id
754+;; int *locs; // Shader locations array (MAX_SHADER_LOCATIONS)
755+;;} Shader;
756+(defcstruct (%shader :class shader-type)
757+ "Shader type"
758+ (id :unsigned-int)
759+ (locs (:pointer :int)))
760+
761+ (defmethod translate-into-foreign-memory (object (type shader-type) pointer)
762+ (with-foreign-slots ((id locs) pointer (:struct %shader))
763+ (setf id (nth 0 object))
764+ (setf locs (nth 1 object))))
765+
766+(defmethod translate-from-foreign (pointer (type shader-type))
767+ (with-foreign-slots ((id locs) pointer (:struct %shader))
768+ (list id locs)))
769+
770+;;// Material texture map
771+;;typedef struct MaterialMap {
772+;; Texture2D texture; // Material map texture
773+;; Color color; // Material map color
774+;; float value; // Material map value
775+;;} MaterialMap;
776+(defcstruct (%material-map :class material-map-type)
777+ "Material texture map"
778+ (texture (:struct %texture))
779+ (color (:struct %color))
780+ (value :float))
781+
782+(defmethod translate-into-foreign-memory (object (type material-map-type) pointer)
783+ (with-foreign-slots ((texture color value) pointer (:struct %material-map))
784+ (setf texture (nth 0 object))
785+ (setf color (nth 1 object))
786+ (setf value (coerce (nth 2 object) 'float))))
787+
788+(defmethod translate-from-foreign (pointer (type material-map-type))
789+ (with-foreign-slots ((texture color value) pointer (:struct %material-map))
790+ (list texture color value)))
791+;;
792+;;// Material type (generic)
793+;;typedef struct Material {
794+;; Shader shader; // Material shader
795+;; MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS)
796+;; float *params; // Material generic parameters (if required)
797+;;} Material;
798+(defcstruct (%material :class material-type)
799+ "Material type"
800+ (shader (:struct %shader))
801+ (maps (:pointer (:struct %material-map)))
802+ (params (:pointer :float)))
803+
804+(defmethod translate-into-foreign-memory (object (type material-type) pointer)
805+ (with-foreign-slots ((shader maps params) pointer (:struct %material))
806+ (setf shader (nth 0 object))
807+ (setf maps (nth 1 object))
808+ (setf params (nth 2 object))))
809+
810+(defmethod translate-from-foreign (pointer (type material-type))
811+ (with-foreign-slots ((shader maps params) pointer (:struct %material))
812+ (list shader maps params)))
813+
814+;;
815+;;// Transformation properties
816+;;typedef struct Transform {
817+;; Vector3 translation; // Translation
818+;; Quaternion rotation; // Rotation
819+;; Vector3 scale; // Scale
820+;;} Transform;
821+(defcstruct (%transform :class transform-type)
822+ "Transformation properties"
823+ (translation (:struct %vector3))
824+ (rotation (:struct %vector4))
825+ (scale (:struct %vector3)))
826+
827+(defmethod translate-into-foreign-memory (object (type transform-type) pointer)
828+ (with-foreign-slots ((translation rotation scale) pointer (:struct %transform))
829+ (setf translation (nth 0 object))
830+ (setf rotation (nth 1 object))
831+ (setf scale (nth 2 object))))
832+
833+(defmethod translate-from-foreign (pointer (type transform-type))
834+ (with-foreign-slots ((translation rotation scale) pointer (:struct %transform))
835+ (list translation rotation scale)))
836+
837+;;
838+;;// Bone information
839+;;typedef struct BoneInfo {
840+;; char name[32]; // Bone name
841+;; int parent; // Bone parent
842+;;} BoneInfo;
843+(defcstruct (%bone-info :class bone-info-type)
844+ "Bone information"
845+ (name :string)
846+ (parent :int))
847+
848+(defmethod translate-into-foreign-memory (object (type bone-info-type) pointer)
849+ (with-foreign-slots ((name parent) pointer (:struct %bone-info))
850+ (setf name (nth 0 object))
851+ (setf parent (nth 1 object))))
852+
853+(defmethod translate-from-foreign (pointer (type bone-info-type))
854+ (with-foreign-slots ((name parent) pointer (:struct %bone-info))
855+ (list name parent)))
856+
857+;;
858+;;// Model type
859+;;typedef struct Model {
860+;; Matrix transform; // Local transform matrix
861+;;
862+;; int meshCount; // Number of meshes
863+;; Mesh *meshes; // Meshes array
864+;;
865+;; int materialCount; // Number of materials
866+;; Material *materials; // Materials array
867+;; int *meshMaterial; // Mesh material number
868+;;
869+;; // Animation data
870+;; int boneCount; // Number of bones
871+;; BoneInfo *bones; // Bones information (skeleton)
872+;; Transform *bindPose; // Bones base transformation (pose)
873+;;} Model;
874+(defcstruct (%model :class model-type)
875+ "Model type"
876+ (mesh (:struct %mesh))
877+ (transform (:struct %matrix))
878+ (material (:struct %material))
879+ (bone-count :int)
880+ (bones (:struct %bone-info))
881+ (bind-pose (:struct %transform)))
882+
883+(defmethod translate-into-foreign-memory (object (type model-type) pointer)
884+ (with-foreign-slots ((mesh transform material bone-count bones bind-pose) pointer (:struct %model))
885+ (setf mesh (nth 0 object))
886+ (setf transform (nth 1 object))
887+ (setf material (nth 2 object))
888+ (setf bone-count (nth 3 object))
889+ (setf bones (nth 4 object))
890+ (setf bind-pose (nth 5 object))))
891+
892+(defmethod translate-from-foreign (pointer (type model-type))
893+ (with-foreign-slots ((mesh transform material bone-count bones bind-pose) pointer (:struct %model))
894+ (list mesh transform material bone-count bones bind-pose)))
895+;;
896+;;// Model animation
897+;;typedef struct ModelAnimation {
898+;; int boneCount; // Number of bones
899+;; BoneInfo *bones; // Bones information (skeleton)
900+;;
901+;; int frameCount; // Number of animation frames
902+;; Transform **framePoses; // Poses array by frame
903+;;} ModelAnimation;
904+(defcstruct (%model-animation :class model-animation-type)
905+ "Model animation"
906+ (bone-count :int)
907+ (bones (:struct %bone-info))
908+ (frame-count :int)
909+ (frame-poses (:struct %transform)))
910+
911+(defmethod translate-into-foreign-memory (object (type model-animation-type) pointer)
912+ (with-foreign-slots ((bone-count bones frame-count frame-poses) pointer (:struct %model-animation))
913+ (setf bone-count (nth 0 object))
914+ (setf bones (nth 1 object))
915+ (setf frame-count (nth 0 object))
916+ (setf frame-poses (nth 1 object))))
917+
918+(defmethod translate-from-foreign (pointer (type model-animation-type))
919+ (with-foreign-slots ((bone-count bones frame-count frame-poses) pointer (:struct %model-animation))
920+ (list bone-count bones frame-count frame-poses)))
921+
922+;;
923+;;// Ray type (useful for raycast)
924+;;typedef struct Ray {
925+;; Vector3 position; // Ray position (origin)
926+;; Vector3 direction; // Ray direction
927+;;} Ray;
928+(defcstruct (%ray :class ray-type)
929+ "Ray type (useful for raycast)"
930+ (position (:struct %vector3))
931+ (direction (:struct %vector3)))
932+
933+(defmethod translate-into-foreign-memory (object (type ray-type) pointer)
934+ (with-foreign-slots ((position direction) pointer (:struct %ray))
935+ (setf position (nth 0 object))
936+ (setf direction (nth 1 object))))
937+
938+(defmethod translate-from-foreign (pointer (type ray-type))
939+ (with-foreign-slots ((position direction) pointer (:struct %ray))
940+ (list position direction)))
941+
942+;;
943+;;// Raycast hit information
944+;;typedef struct RayHitInfo {
945+;; bool hit; // Did the ray hit something?
946+;; float distance; // Distance to nearest hit
947+;; Vector3 position; // Position of nearest hit
948+;; Vector3 normal; // Surface normal of hit
949+;;} RayHitInfo;
950+(defcstruct (%ray-hit-info :class ray-hit-info-type)
951+ "Raycast hit information"
952+ (hit :boolean)
953+ (distance :float)
954+ (position (:struct %vector3))
955+ (normal (:struct %vector3)))
956+
957+(defmethod translate-into-foreign-memory (object (type ray-hit-info-type) pointer)
958+ (with-foreign-slots ((hit distance position normal) pointer (:struct %ray-hit-info))
959+ (setf hit (nth 0 object))
960+ (setf distance (nth 1 object))
961+ (setf position (nth 2 object))
962+ (setf normal (nth 3 object))))
963+
964+(defmethod translate-from-foreign (pointer (type ray-hit-info-type))
965+ (with-foreign-slots ((hit distance position normal) pointer (:struct %ray-hit-info))
966+ (list hit distance position normal)))
967+
968+;;
969+;;// Bounding box type
970+;;typedef struct BoundingBox {
971+;; Vector3 min; // Minimum vertex box-corner
972+;; Vector3 max; // Maximum vertex box-corner
973+;;} BoundingBox;
974+(defcstruct (%bounding-box :class bounding-box-type)
975+ "Bounding box type"
976+ (min (:struct %vector3))
977+ (max (:struct %vector3)))
978+
979+(defmethod translate-into-foreign-memory (object (type bounding-box-type) pointer)
980+ (with-foreign-slots ((min max) pointer (:struct %bounding-box))
981+ (setf min (nth 0 object))
982+ (setf max (nth 1 object))))
983+
984+(defmethod translate-from-foreign (pointer (type bounding-box-type))
985+ (with-foreign-slots ((min max) pointer (:struct %bounding-box))
986+ (list min max)))
987+
988+;;
989+;;// Wave type, defines audio wave data
990+;;typedef struct Wave {
991+;; unsigned int sampleCount; // Total number of samples
992+;; unsigned int sampleRate; // Frequency (samples per second)
993+;; unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
994+;; unsigned int channels; // Number of channels (1-mono, 2-stereo)
995+;; void *data; // Buffer data pointer
996+;;} Wave;
997+(defcstruct (%wave :class wave-type)
998+ "Wave type, defines audio wave data"
999+ (sample-count :unsigned-int)
1000+ (sample-rate :unsigned-int)
1001+ (sample-size :unsigned-int)
1002+ (channels :unsigned-int)
1003+ (data :pointer))
1004+
1005+(defmethod translate-into-foreign-memory (object (type wave-type) pointer)
1006+ (with-foreign-slots ((sample-count sample-rate sample-size channels data) pointer (:struct %wave))
1007+ (setf sample-count (nth 0 object))
1008+ (setf sample-rate (nth 1 object))
1009+ (setf sample-size (nth 2 object))
1010+ (setf channels (nth 3 object))
1011+ (setf data (nth 4 object))))
1012+
1013+(defmethod translate-from-foreign (pointer (type wave-type))
1014+ (with-foreign-slots ((sample-count sample-rate sample-size channels data) pointer (:struct %wave))
1015+ (list sample-count sample-rate sample-size channels data)))
1016+;;
1017+;;typedef struct rAudioBuffer rAudioBuffer;
1018+;;
1019+;;// Audio stream type
1020+;;// NOTE: Useful to create custom audio streams not bound to a specific file
1021+;;typedef struct AudioStream {
1022+;; unsigned int sampleRate; // Frequency (samples per second)
1023+;; unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
1024+;; unsigned int channels; // Number of channels (1-mono, 2-stereo)
1025+;;
1026+;; rAudioBuffer *buffer; // Pointer to internal data used by the audio system
1027+;;} AudioStream;
1028+(defcstruct (%audio-stream :class audio-stream-type)
1029+ "Audio stream type"
1030+ (sample-rate :unsigned-int)
1031+ (sample-size :unsigned-int)
1032+ (channels :unsigned-int)
1033+ (buffer :pointer))
1034+
1035+(defmethod translate-into-foreign-memory (object (type audio-stream-type) pointer)
1036+ (with-foreign-slots ((sample-rate sample-size channels buffer) pointer (:struct %audio-stream))
1037+ (setf sample-rate (nth 0 object))
1038+ (setf sample-size (nth 1 object))
1039+ (setf channels (nth 2 object))
1040+ (setf buffer (nth 3 object))))
1041+
1042+(defmethod translate-from-foreign (pointer (type audio-stream-type))
1043+ (with-foreign-slots ((sample-rate sample-size channels buffer) pointer (:struct %audio-stream))
1044+ (list sample-rate sample-size channels buffer)))
1045+
1046+;;// Sound source type
1047+;;typedef struct Sound {
1048+;; unsigned int sampleCount; // Total number of samples
1049+;; AudioStream stream; // Audio stream
1050+;;} Sound;
1051+(defcstruct (%sound :class sound-type)
1052+ "Sound source type"
1053+ (sample-count :unsigned-int)
1054+ (stream (:struct %audio-stream)))
1055+
1056+(defmethod translate-into-foreign-memory (object (type sound-type) pointer)
1057+ (with-foreign-slots ((sample-count stream) pointer (:struct %sound))
1058+ (setf sample-count (nth 0 object))
1059+ (convert-into-foreign-memory (nth 1 object)
1060+ '(:struct %audio-stream)
1061+ (foreign-slot-pointer pointer '(:struct %sound) 'stream))))
1062+
1063+(defmethod translate-from-foreign (pointer (type sound-type))
1064+ (with-foreign-slots ((sample-count stream) pointer (:struct %sound))
1065+ (list sample-count stream)))
1066+;;
1067+;;// Music stream type (audio file streaming from memory)
1068+;;// NOTE: Anything longer than ~10 seconds should be streamed
1069+;;typedef struct Music {
1070+;; int ctxType; // Type of music context (audio filetype)
1071+;; void *ctxData; // Audio context data, depends on type
1072+;;
1073+;; unsigned int sampleCount; // Total number of samples
1074+;; unsigned int loopCount; // Loops count (times music will play), 0 means infinite loop
1075+;;
1076+;; AudioStream stream; // Audio stream
1077+;;} Music;
1078+(defcstruct (%music :class music-type)
1079+ "Music stream type (audio file streaming from memory)"
1080+ (ctx-type :int)
1081+ (ctx-data :pointer)
1082+ (sample-count :unsigned-int)
1083+ (loop-count :unsigned-int)
1084+ (stream (:struct %audio-stream)))
1085+
1086+(defmethod translate-into-foreign-memory (object (type music-type) pointer)
1087+ (with-foreign-slots ((ctx-type ctx-data sample-count loop-count stream) pointer (:struct %music))
1088+ (setf ctx-type (nth 0 object))
1089+ (setf ctx-data (nth 1 object))
1090+ (setf sample-count (nth 2 object))
1091+ (setf loop-count (nth 3 object))
1092+ (convert-into-foreign-memory (nth 4 object)
1093+ '(:struct %audio-stream)
1094+ (foreign-slot-pointer pointer '(:struct %music) 'stream))))
1095+
1096+(defmethod translate-from-foreign (pointer (type music-type))
1097+ (with-foreign-slots ((ctx-type ctx-data sample-count loop-count stream) pointer (:struct %music))
1098+ (list ctx-type ctx-data sample-count loop-count stream)))
1099+
1100+;;// Head-Mounted-Display device parameters
1101+;;typedef struct VrDeviceInfo {
1102+;; int hResolution; // HMD horizontal resolution in pixels
1103+;; int vResolution; // HMD vertical resolution in pixels
1104+;; float hScreenSize; // HMD horizontal size in meters
1105+;; float vScreenSize; // HMD vertical size in meters
1106+;; float vScreenCenter; // HMD screen center in meters
1107+;; float eyeToScreenDistance; // HMD distance between eye and display in meters
1108+;; float lensSeparationDistance; // HMD lens separation distance in meters
1109+;; float interpupillaryDistance; // HMD IPD (distance between pupils) in meters
1110+;; float lensDistortionValues[4]; // HMD lens distortion constant parameters
1111+;; float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters
1112+;;} VrDeviceInfo;
1113+(defcstruct (%vr-device-info :class vr-device-info-type)
1114+ "Head-Mounted-Display device parameters"
1115+ (h-resolution :int)
1116+ (v-resolution :int)
1117+ (h-screen-size :float)
1118+ (v-screen-size :float)
1119+ (v-screen-center :float)
1120+ (eye-to-screen-distance :float)
1121+ (lens-separation-distance :float)
1122+ (interpupillary-distance :float)
1123+ (lens-distortion-values :float :count 4)
1124+ (chroma-ab-correction :float :count 4))
1125+
1126+(defmethod translate-into-foreign-memory (object (type vr-device-info-type) pointer)
1127+ (with-foreign-slots ((h-resolution v-resolution h-screen-size v-screen-size v-screen-center eye-to-screen-distance lens-separation-distance interpupillary-distance lens-distortion-values chroma-ab-correction) pointer (:struct %vr-device-info))
1128+ (setf h-resolution (nth 0 object))
1129+ (setf v-resolution (nth 1 object))
1130+ (setf h-screen-size (coerce (nth 2 object) 'float))
1131+ (setf v-screen-size (coerce (nth 3 object) 'float))
1132+ (setf v-screen-center (coerce (nth 4 object) 'float))
1133+ (setf eye-to-screen-distance (coerce (nth 5 object) 'float))
1134+ (setf lens-separation-distance (coerce (nth 6 object) 'float))
1135+ (setf interpupillary-distance (coerce (nth 7 object) 'float))
1136+ (setf lens-distortion-values (nth 8 object))
1137+ (setf chroma-ab-correction (nth 9 object))))
1138+
1139+(defmethod translate-from-foreign (pointer (type vr-device-info-type))
1140+ (with-foreign-slots ((h-resolution v-resolution h-screen-size v-screen-size v-screen-center eye-to-screen-distance lens-separation-distance interpupillary-distance lens-distortion-values chroma-ab-correction) pointer (:struct %vr-device-info))
1141+ (list h-resolution v-resolution h-screen-size v-screen-size v-screen-center eye-to-screen-distance lens-separation-distance interpupillary-distance lens-distortion-values chroma-ab-correction)))
1142+
1143+;;//----------------------------------------------------------------------------------
1144+;;// Enumerators Definition
1145+;;//----------------------------------------------------------------------------------
1146+;;// System config flags
1147+;;// NOTE: Used for bit masks
1148+;;typedef enum {
1149+;; FLAG_RESERVED = 1, // Reserved
1150+;; FLAG_FULLSCREEN_MODE = 2, // Set to run program in fullscreen
1151+;; FLAG_WINDOW_RESIZABLE = 4, // Set to allow resizable window
1152+;; FLAG_WINDOW_UNDECORATED = 8, // Set to disable window decoration (frame and buttons)
1153+;; FLAG_WINDOW_TRANSPARENT = 16, // Set to allow transparent window
1154+;; FLAG_WINDOW_HIDDEN = 128, // Set to create the window initially hidden
1155+;; FLAG_WINDOW_ALWAYS_RUN = 256, // Set to allow windows running while minimized
1156+;; FLAG_MSAA_4X_HINT = 32, // Set to try enabling MSAA 4X
1157+;; FLAG_VSYNC_HINT = 64 // Set to try enabling V-Sync on GPU
1158+;;} ConfigFlag;
1159+(define-constant +flag-reserved+ 1)
1160+(define-constant +flag-fullscreen-mode+ 2)
1161+(define-constant +flag-window-resizable+ 4)
1162+(define-constant +flag-window-undecorated+ 8)
1163+(define-constant +flag-window-transparent+ 16)
1164+(define-constant +flag-window-hidden+ 128)
1165+(define-constant +flag-window-always-run+ 256)
1166+(define-constant +flag-msaa-4x-hint+ 32)
1167+(define-constant +flag-vsync-hint+ 64)
1168+
1169+;;// Trace log type
1170+;;typedef enum {
1171+;; LOG_ALL = 0, // Display all logs
1172+;; LOG_TRACE,
1173+;; LOG_DEBUG,
1174+;; LOG_INFO,
1175+;; LOG_WARNING,
1176+;; LOG_ERROR,
1177+;; LOG_FATAL,
1178+;; LOG_NONE // Disable logging
1179+;;} TraceLogType;
1180+
1181+;;// Keyboard keys
1182+;;typedef enum {
1183+;; // Alphanumeric keys
1184+;; KEY_APOSTROPHE = 39,
1185+;; KEY_COMMA = 44,
1186+;; KEY_MINUS = 45,
1187+;; KEY_PERIOD = 46,
1188+;; KEY_SLASH = 47,
1189+;; KEY_ZERO = 48,
1190+;; KEY_ONE = 49,
1191+;; KEY_TWO = 50,
1192+;; KEY_THREE = 51,
1193+;; KEY_FOUR = 52,
1194+;; KEY_FIVE = 53,
1195+;; KEY_SIX = 54,
1196+;; KEY_SEVEN = 55,
1197+;; KEY_EIGHT = 56,
1198+;; KEY_NINE = 57,
1199+;; KEY_SEMICOLON = 59,
1200+;; KEY_EQUAL = 61,
1201+;; KEY_A = 65,
1202+;; KEY_B = 66,
1203+;; KEY_C = 67,
1204+;; KEY_D = 68,
1205+;; KEY_E = 69,
1206+;; KEY_F = 70,
1207+;; KEY_G = 71,
1208+;; KEY_H = 72,
1209+;; KEY_I = 73,
1210+;; KEY_J = 74,
1211+;; KEY_K = 75,
1212+;; KEY_L = 76,
1213+;; KEY_M = 77,
1214+;; KEY_N = 78,
1215+;; KEY_O = 79,
1216+;; KEY_P = 80,
1217+;; KEY_Q = 81,
1218+;; KEY_R = 82,
1219+;; KEY_S = 83,
1220+;; KEY_T = 84,
1221+;; KEY_U = 85,
1222+;; KEY_V = 86,
1223+;; KEY_W = 87,
1224+;; KEY_X = 88,
1225+;; KEY_Y = 89,
1226+;; KEY_Z = 90,
1227+(define-constant +key-apostrophe+ 39)
1228+(define-constant +key-comma+ 44)
1229+(define-constant +key-minus+ 45)
1230+(define-constant +key-period+ 46)
1231+(define-constant +key-slash+ 47)
1232+(define-constant +key-zero+ 48)
1233+(define-constant +key-one+ 49)
1234+(define-constant +key-two+ 50)
1235+(define-constant +key-three+ 51)
1236+(define-constant +key-four+ 52)
1237+(define-constant +key-five+ 53)
1238+(define-constant +key-six+ 54)
1239+(define-constant +key-seven+ 55)
1240+(define-constant +key-eight+ 56)
1241+(define-constant +key-nine+ 57)
1242+(define-constant +key-semicolon+ 59)
1243+(define-constant +key-equal+ 61)
1244+(define-constant +key-a+ 65)
1245+(define-constant +key-b+ 66)
1246+(define-constant +key-c+ 67)
1247+(define-constant +key-d+ 68)
1248+(define-constant +key-e+ 69)
1249+(define-constant +key-f+ 70)
1250+(define-constant +key-g+ 71)
1251+(define-constant +key-h+ 72)
1252+(define-constant +key-i+ 73)
1253+(define-constant +key-j+ 74)
1254+(define-constant +key-k+ 75)
1255+(define-constant +key-l+ 76)
1256+(define-constant +key-m+ 77)
1257+(define-constant +key-n+ 78)
1258+(define-constant +key-o+ 79)
1259+(define-constant +key-p+ 80)
1260+(define-constant +key-q+ 81)
1261+(define-constant +key-r+ 82)
1262+(define-constant +key-s+ 83)
1263+(define-constant +key-t+ 84)
1264+(define-constant +key-u+ 85)
1265+(define-constant +key-v+ 86)
1266+(define-constant +key-w+ 87)
1267+(define-constant +key-x+ 88)
1268+(define-constant +key-y+ 89)
1269+(define-constant +key-z+ 90)
1270+
1271+;; // Function keys
1272+;; KEY_SPACE = 32,
1273+;; KEY_ESCAPE = 256,
1274+;; KEY_ENTER = 257,
1275+;; KEY_TAB = 258,
1276+;; KEY_BACKSPACE = 259,
1277+;; KEY_INSERT = 260,
1278+;; KEY_DELETE = 261,
1279+;; KEY_RIGHT = 262,
1280+;; KEY_LEFT = 263,
1281+;; KEY_DOWN = 264,
1282+;; KEY_UP = 265,
1283+;; KEY_PAGE_UP = 266,
1284+;; KEY_PAGE_DOWN = 267,
1285+;; KEY_HOME = 268,
1286+;; KEY_END = 269,
1287+;; KEY_CAPS_LOCK = 280,
1288+;; KEY_SCROLL_LOCK = 281,
1289+;; KEY_NUM_LOCK = 282,
1290+;; KEY_PRINT_SCREEN = 283,
1291+;; KEY_PAUSE = 284,
1292+;; KEY_F1 = 290,
1293+;; KEY_F2 = 291,
1294+;; KEY_F3 = 292,
1295+;; KEY_F4 = 293,
1296+;; KEY_F5 = 294,
1297+;; KEY_F6 = 295,
1298+;; KEY_F7 = 296,
1299+;; KEY_F8 = 297,
1300+;; KEY_F9 = 298,
1301+;; KEY_F10 = 299,
1302+;; KEY_F11 = 300,
1303+;; KEY_F12 = 301,
1304+;; KEY_LEFT_SHIFT = 340,
1305+;; KEY_LEFT_CONTROL = 341,
1306+;; KEY_LEFT_ALT = 342,
1307+;; KEY_LEFT_SUPER = 343,
1308+;; KEY_RIGHT_SHIFT = 344,
1309+;; KEY_RIGHT_CONTROL = 345,
1310+;; KEY_RIGHT_ALT = 346,
1311+;; KEY_RIGHT_SUPER = 347,
1312+;; KEY_KB_MENU = 348,
1313+;; KEY_LEFT_BRACKET = 91,
1314+;; KEY_BACKSLASH = 92,
1315+;; KEY_RIGHT_BRACKET = 93,
1316+;; KEY_GRAVE = 96,
1317+(define-constant +key-space+ 32)
1318+(define-constant +key-escape+ 256)
1319+(define-constant +key-enter+ 257)
1320+(define-constant +key-tab+ 258)
1321+(define-constant +key-backspace+ 259)
1322+(define-constant +key-insert+ 260)
1323+(define-constant +key-delete+ 261)
1324+(define-constant +key-right+ 262)
1325+(define-constant +key-left+ 263)
1326+(define-constant +key-down+ 264)
1327+(define-constant +key-up+ 265)
1328+(define-constant +key-page-up+ 266)
1329+(define-constant +key-page-down+ 267)
1330+(define-constant +key-home+ 268)
1331+(define-constant +key-end+ 269)
1332+(define-constant +key-caps-lock+ 280)
1333+(define-constant +key-scroll-lock+ 281)
1334+(define-constant +key-num-lock+ 282)
1335+(define-constant +key-print-screen+ 283)
1336+(define-constant +key-pause+ 284)
1337+(define-constant +key-f1+ 290)
1338+(define-constant +key-f2+ 291)
1339+(define-constant +key-f3+ 292)
1340+(define-constant +key-f4+ 293)
1341+(define-constant +key-f5+ 294)
1342+(define-constant +key-f6+ 295)
1343+(define-constant +key-f7+ 296)
1344+(define-constant +key-f8+ 297)
1345+(define-constant +key-f9+ 298)
1346+(define-constant +key-f10+ 299)
1347+(define-constant +key-f11+ 300)
1348+(define-constant +key-f12+ 301)
1349+(define-constant +key-left-shift+ 340)
1350+(define-constant +key-left-control+ 341)
1351+(define-constant +key-left-alt+ 342)
1352+(define-constant +key-left-super+ 343)
1353+(define-constant +key-right-shift+ 344)
1354+(define-constant +key-right-control+ 345)
1355+(define-constant +key-right-alt+ 346)
1356+(define-constant +key-right-super+ 347)
1357+(define-constant +key-kb-menu+ 348)
1358+(define-constant +key-left-bracket+ 91)
1359+(define-constant +key-backslash+ 92)
1360+(define-constant +key-right-bracket+ 93)
1361+(define-constant +key-grave+ 96)
1362+
1363+;; // Keypad keys
1364+;; KEY_KP_0 = 320,
1365+;; KEY_KP_1 = 321,
1366+;; KEY_KP_2 = 322,
1367+;; KEY_KP_3 = 323,
1368+;; KEY_KP_4 = 324,
1369+;; KEY_KP_5 = 325,
1370+;; KEY_KP_6 = 326,
1371+;; KEY_KP_7 = 327,
1372+;; KEY_KP_8 = 328,
1373+;; KEY_KP_9 = 329,
1374+;; KEY_KP_DECIMAL = 330,
1375+;; KEY_KP_DIVIDE = 331,
1376+;; KEY_KP_MULTIPLY = 332,
1377+;; KEY_KP_SUBTRACT = 333,
1378+;; KEY_KP_ADD = 334,
1379+;; KEY_KP_ENTER = 335,
1380+;; KEY_KP_EQUAL = 336
1381+;;} KeyboardKey;
1382+(define-constant +key-kp-0+ 320)
1383+(define-constant +key-kp-1+ 321)
1384+(define-constant +key-kp-2+ 322)
1385+(define-constant +key-kp-3+ 323)
1386+(define-constant +key-kp-4+ 324)
1387+(define-constant +key-kp-5+ 325)
1388+(define-constant +key-kp-6+ 326)
1389+(define-constant +key-kp-7+ 327)
1390+(define-constant +key-kp-8+ 328)
1391+(define-constant +key-kp-9+ 329)
1392+(define-constant +key-kp-decimal+ 330)
1393+(define-constant +key-kp-divide+ 331)
1394+(define-constant +key-kp-multiply+ 332)
1395+(define-constant +key-kp-subtract+ 333)
1396+(define-constant +key-kp-add+ 334)
1397+(define-constant +key-kp-enter+ 335)
1398+(define-constant +key-kp-equal+ 336)
1399+
1400+;;// Android buttons
1401+;;typedef enum {
1402+;; KEY_BACK = 4,
1403+;; KEY_MENU = 82,
1404+;; KEY_VOLUME_UP = 24,
1405+;; KEY_VOLUME_DOWN = 25
1406+;;} AndroidButton;
1407+(define-constant +key-back+ 4)
1408+(define-constant +key-menu+ 82)
1409+(define-constant +key-volume-up+ 24)
1410+(define-constant +key-volume-down+ 25)
1411+
1412+;;// Mouse buttons
1413+;;typedef enum {
1414+;; MOUSE_LEFT_BUTTON = 0,
1415+;; MOUSE_RIGHT_BUTTON = 1,
1416+;; MOUSE_MIDDLE_BUTTON = 2
1417+;;} MouseButton;
1418+(define-constant +mouse-left-button+ 0)
1419+(define-constant +mouse-right-button+ 1)
1420+(define-constant +mouse-middle-button+ 2)
1421+
1422+;;// Gamepad number
1423+;;typedef enum {
1424+;; GAMEPAD_PLAYER1 = 0,
1425+;; GAMEPAD_PLAYER2 = 1,
1426+;; GAMEPAD_PLAYER3 = 2,
1427+;; GAMEPAD_PLAYER4 = 3
1428+;;} GamepadNumber;
1429+(define-constant +gamepad-player1+ 0)
1430+(define-constant +gamepad-player2+ 1)
1431+(define-constant +gamepad-player3+ 2)
1432+(define-constant +gamepad-player4+ 3)
1433+
1434+
1435+;;// Gamepad Buttons
1436+;;typedef enum {
1437+;; // This is here just for error checking
1438+;; GAMEPAD_BUTTON_UNKNOWN = 0,
1439+;;
1440+;; // This is normally a DPAD
1441+;; GAMEPAD_BUTTON_LEFT_FACE_UP,
1442+;; GAMEPAD_BUTTON_LEFT_FACE_RIGHT,
1443+;; GAMEPAD_BUTTON_LEFT_FACE_DOWN,
1444+;; GAMEPAD_BUTTON_LEFT_FACE_LEFT,
1445+;;
1446+;; // This normally corresponds with PlayStation and Xbox controllers
1447+;; // XBOX: [Y,X,A,B]
1448+;; // PS3: [Triangle,Square,Cross,Circle]
1449+;; // No support for 6 button controllers though..
1450+;; GAMEPAD_BUTTON_RIGHT_FACE_UP,
1451+;; GAMEPAD_BUTTON_RIGHT_FACE_RIGHT,
1452+;; GAMEPAD_BUTTON_RIGHT_FACE_DOWN,
1453+;; GAMEPAD_BUTTON_RIGHT_FACE_LEFT,
1454+;;
1455+;; // Triggers
1456+;; GAMEPAD_BUTTON_LEFT_TRIGGER_1,
1457+;; GAMEPAD_BUTTON_LEFT_TRIGGER_2,
1458+;; GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
1459+;; GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
1460+;;
1461+;; // These are buttons in the center of the gamepad
1462+;; GAMEPAD_BUTTON_MIDDLE_LEFT, //PS3 Select
1463+;; GAMEPAD_BUTTON_MIDDLE, //PS Button/XBOX Button
1464+;; GAMEPAD_BUTTON_MIDDLE_RIGHT, //PS3 Start
1465+;;
1466+;; // These are the joystick press in buttons
1467+;; GAMEPAD_BUTTON_LEFT_THUMB,
1468+;; GAMEPAD_BUTTON_RIGHT_THUMB
1469+;;} GamepadButton;
1470+(define-constant +gamepad-button-unknown+ 0)
1471+(define-constant +gamepad-button-left-face-up+ 1)
1472+(define-constant +gamepad-button-left-face-right+ 2)
1473+(define-constant +gamepad-button-left-face-down+ 3)
1474+(define-constant +gamepad-button-left-face-left+ 4)
1475+(define-constant +gamepad-button-right-face-up+ 5)
1476+(define-constant +gamepad-button-right-face-right+ 6)
1477+(define-constant +gamepad-button-right-face-down+ 7)
1478+(define-constant +gamepad-button-right-face-left+ 8)
1479+(define-constant +gamepad-button-left-trigger-1+ 9)
1480+(define-constant +gamepad-button-left-trigger-2+ 10)
1481+(define-constant +gamepad-button-right-trigger-1+ 11)
1482+(define-constant +gamepad-button-right-trigger-2+ 12)
1483+(define-constant +gamepad-button-middle-left+ 13)
1484+(define-constant +gamepad-button-middle+ 14)
1485+(define-constant +gamepad-button-middle-right+ 15)
1486+(define-constant +gamepad-button-left-thumb+ 16)
1487+(define-constant +gamepad-button-right-thumb+ 17)
1488+
1489+;;typedef enum {
1490+;; // This is here just for error checking
1491+;; GAMEPAD_AXIS_UNKNOWN = 0,
1492+;;
1493+;; // Left stick
1494+;; GAMEPAD_AXIS_LEFT_X,
1495+;; GAMEPAD_AXIS_LEFT_Y,
1496+;;
1497+;; // Right stick
1498+;; GAMEPAD_AXIS_RIGHT_X,
1499+;; GAMEPAD_AXIS_RIGHT_Y,
1500+;;
1501+;; // Pressure levels for the back triggers
1502+;; GAMEPAD_AXIS_LEFT_TRIGGER, // [1..-1] (pressure-level)
1503+;; GAMEPAD_AXIS_RIGHT_TRIGGER // [1..-1] (pressure-level)
1504+;;} GamepadAxis;
1505+(define-constant +gamepad-axis-unknown+ 0)
1506+(define-constant +gamepad-axis-left-x+ 1)
1507+(define-constant +gamepad-axis-left-y+ 2)
1508+(define-constant +gamepad-axis-right-x+ 3)
1509+(define-constant +gamepad-axis-right-y+ 4)
1510+(define-constant +gamepad-axis-left-trigger+ 5)
1511+(define-constant +gamepad-axis-right-trigger+ 6)
1512+
1513+;;// Shader location point type
1514+;;typedef enum {
1515+;; LOC_VERTEX_POSITION = 0,
1516+;; LOC_VERTEX_TEXCOORD01,
1517+;; LOC_VERTEX_TEXCOORD02,
1518+;; LOC_VERTEX_NORMAL,
1519+;; LOC_VERTEX_TANGENT,
1520+;; LOC_VERTEX_COLOR,
1521+;; LOC_MATRIX_MVP,
1522+;; LOC_MATRIX_MODEL,
1523+;; LOC_MATRIX_VIEW,
1524+;; LOC_MATRIX_PROJECTION,
1525+;; LOC_VECTOR_VIEW,
1526+;; LOC_COLOR_DIFFUSE,
1527+;; LOC_COLOR_SPECULAR,
1528+;; LOC_COLOR_AMBIENT,
1529+;; LOC_MAP_ALBEDO, // LOC_MAP_DIFFUSE
1530+;; LOC_MAP_METALNESS, // LOC_MAP_SPECULAR
1531+;; LOC_MAP_NORMAL,
1532+;; LOC_MAP_ROUGHNESS,
1533+;; LOC_MAP_OCCLUSION,
1534+;; LOC_MAP_EMISSION,
1535+;; LOC_MAP_HEIGHT,
1536+;; LOC_MAP_CUBEMAP,
1537+;; LOC_MAP_IRRADIANCE,
1538+;; LOC_MAP_PREFILTER,
1539+;; LOC_MAP_BRDF
1540+;;} ShaderLocationIndex;
1541+(define-constant +loc-vertex-position+ 0)
1542+(define-constant +loc-vertex-texcoord01+ 1)
1543+(define-constant +loc-vertex-texcoord02+ 2)
1544+(define-constant +loc-vertex-normal+ 3)
1545+(define-constant +loc-vertex-tangent+ 4)
1546+(define-constant +loc-vertex-color+ 5)
1547+(define-constant +loc-matrix-mvp+ 6)
1548+(define-constant +loc-matrix-model+ 7)
1549+(define-constant +loc-matrix-view+ 8)
1550+(define-constant +loc-matrix-projection+ 9)
1551+(define-constant +loc-vector-view+ 10)
1552+(define-constant +loc-color-diffuse+ 11)
1553+(define-constant +loc-color-specular+ 12)
1554+(define-constant +loc-color-ambient+ 13)
1555+(define-constant +loc-map-albedo+ 14)
1556+(define-constant +loc-map-metalness+ 15)
1557+(define-constant +loc-map-normal+ 16)
1558+(define-constant +loc-map-roughness+ 17)
1559+(define-constant +loc-map-occlusion+ 18)
1560+(define-constant +loc-map-emission+ 19)
1561+(define-constant +loc-map-height+ 20)
1562+(define-constant +loc-map-cubemap+ 21)
1563+(define-constant +loc-map-irradiance+ 22)
1564+(define-constant +loc-map-prefilter+ 23)
1565+(define-constant +loc-map-brdf+ 24)
1566+
1567+;;#define LOC_MAP_DIFFUSE LOC_MAP_ALBEDO
1568+;;#define LOC_MAP_SPECULAR LOC_MAP_METALNESS
1569+(define-constant +loc-map-diffuse+ +loc-map-albedo+)
1570+(define-constant +loc-map-specular+ +loc-map-metalness+)
1571+
1572+;;// Shader uniform data types
1573+;;typedef enum {
1574+;; UNIFORM_FLOAT = 0,
1575+;; UNIFORM_VEC2,
1576+;; UNIFORM_VEC3,
1577+;; UNIFORM_VEC4,
1578+;; UNIFORM_INT,
1579+;; UNIFORM_IVEC2,
1580+;; UNIFORM_IVEC3,
1581+;; UNIFORM_IVEC4,
1582+;; UNIFORM_SAMPLER2D
1583+;;} ShaderUniformDataType;
1584+(define-constant +uniform-float+ 0)
1585+(define-constant +uniform-vec2+ 1)
1586+(define-constant +uniform-vec3+ 2)
1587+(define-constant +uniform-vec4+ 3)
1588+(define-constant +uniform-int+ 4)
1589+(define-constant +uniform-ivec2+ 5)
1590+(define-constant +uniform-ivec3+ 6)
1591+(define-constant +uniform-ivec4+ 7)
1592+(define-constant +uniform-sampler2d+ 8)
1593+
1594+;;// Material map type
1595+;;typedef enum {
1596+;; MAP_ALBEDO = 0, // MAP_DIFFUSE
1597+;; MAP_METALNESS = 1, // MAP_SPECULAR
1598+;; MAP_NORMAL = 2,
1599+;; MAP_ROUGHNESS = 3,
1600+;; MAP_OCCLUSION,
1601+;; MAP_EMISSION,
1602+;; MAP_HEIGHT,
1603+;; MAP_CUBEMAP, // NOTE: Uses GL_TEXTURE_CUBE_MAP
1604+;; MAP_IRRADIANCE, // NOTE: Uses GL_TEXTURE_CUBE_MAP
1605+;; MAP_PREFILTER, // NOTE: Uses GL_TEXTURE_CUBE_MAP
1606+;; MAP_BRDF
1607+;;} MaterialMapType;
1608+(define-constant +map-albedo+ 0)
1609+(define-constant +map-metalness+ 1)
1610+(define-constant +map-normal+ 2)
1611+(define-constant +map-roughness+ 3)
1612+(define-constant +map-occlusion+ 4)
1613+(define-constant +map-emission+ 5)
1614+(define-constant +map-height+ 6)
1615+(define-constant +map-cubemap+ 7)
1616+(define-constant +map-irradianc+ 8)
1617+(define-constant +map-prefilter+ 9)
1618+(define-constant +map-brdf+ 10)
1619+
1620+;;#define MAP_DIFFUSE MAP_ALBEDO
1621+;;#define MAP_SPECULAR MAP_METALNESS
1622+(define-constant +map-diffuse+ +map-albedo+)
1623+(define-constant +map-specular+ +map-metalness+)
1624+
1625+;;// Pixel formats
1626+;;// NOTE: Support depends on OpenGL version and platform
1627+;;typedef enum {
1628+;; UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha)
1629+;; UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
1630+;; UNCOMPRESSED_R5G6B5, // 16 bpp
1631+;; UNCOMPRESSED_R8G8B8, // 24 bpp
1632+;; UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
1633+;; UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
1634+;; UNCOMPRESSED_R8G8B8A8, // 32 bpp
1635+;; UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
1636+;; UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
1637+;; UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
1638+;; COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
1639+;; COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
1640+;; COMPRESSED_DXT3_RGBA, // 8 bpp
1641+;; COMPRESSED_DXT5_RGBA, // 8 bpp
1642+;; COMPRESSED_ETC1_RGB, // 4 bpp
1643+;; COMPRESSED_ETC2_RGB, // 4 bpp
1644+;; COMPRESSED_ETC2_EAC_RGBA, // 8 bpp
1645+;; COMPRESSED_PVRT_RGB, // 4 bpp
1646+;; COMPRESSED_PVRT_RGBA, // 4 bpp
1647+;; COMPRESSED_ASTC_4x4_RGBA, // 8 bpp
1648+;; COMPRESSED_ASTC_8x8_RGBA // 2 bpp
1649+;;} PixelFormat;
1650+(define-constant +uncompressed-grayscale+ 1)
1651+(define-constant +uncompressed-gray-alpha+ 2)
1652+(define-constant +uncompressed-r5g6b5+ 3)
1653+(define-constant +uncompressed-r8g8b8+ 4)
1654+(define-constant +uncompressed-r5g5b5a1+ 5)
1655+(define-constant +uncompressed-r4g4b4a4+ 6)
1656+(define-constant +uncompressed-r8g8b8a8+ 7)
1657+(define-constant +uncompressed-r32+ 8)
1658+(define-constant +uncompressed-r32g32b32+ 9)
1659+(define-constant +uncompressed-r32g32b32a32+ 10)
1660+(define-constant +compressed-dxt1-rgb+ 11)
1661+(define-constant +compressed-dxt1-rgba+ 12)
1662+(define-constant +compressed-dxt3-rgba+ 13)
1663+(define-constant +compressed-dxt5-rgba+ 14)
1664+(define-constant +compressed-etc1-rgb+ 15)
1665+(define-constant +compressed-etc2-rgb+ 16)
1666+(define-constant +compressed-etc2-eac-rgba+ 17)
1667+(define-constant +compressed-pvrt-rgb+ 18)
1668+(define-constant +compressed-pvrt-rgba+ 19)
1669+(define-constant +compressed-astc-4x4-rgba+ 20)
1670+(define-constant +compressed-astc-8x8-rgba+ 21)
1671+
1672+;;// Texture parameters: filter mode
1673+;;// NOTE 1: Filtering considers mipmaps if available in the texture
1674+;;// NOTE 2: Filter is accordingly set for minification and magnification
1675+;;typedef enum {
1676+;; FILTER_POINT = 0, // No filter, just pixel aproximation
1677+;; FILTER_BILINEAR, // Linear filtering
1678+;; FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps)
1679+;; FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x
1680+;; FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x
1681+;; FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x
1682+;;} TextureFilterMode;
1683+(define-constant +filter-point+ 0)
1684+(define-constant +filter-bilinear+ 1)
1685+(define-constant +filter-trilinear+ 2)
1686+(define-constant +filter-anisotropic-4x+ 3)
1687+(define-constant +filter-anisotropic-8x+ 4)
1688+(define-constant +filter-anisotropic-16x+ 5)
1689+
1690+;;// Cubemap layout type
1691+;;typedef enum {
1692+;; CUBEMAP_AUTO_DETECT = 0, // Automatically detect layout type
1693+;; CUBEMAP_LINE_VERTICAL, // Layout is defined by a vertical line with faces
1694+;; CUBEMAP_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces
1695+;; CUBEMAP_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
1696+;; CUBEMAP_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces
1697+;; CUBEMAP_PANORAMA // Layout is defined by a panorama image (equirectangular map)
1698+;;} CubemapLayoutType;
1699+(define-constant +cubemap-auto-detect+ 0)
1700+(define-constant +cubemap-line-vertical+ 1)
1701+(define-constant +cubemap-line-horizontal+ 2)
1702+(define-constant +cubemap-cross-three-by-four+ 3)
1703+(define-constant +cubemap-cross-four-by-three+ 4)
1704+(define-constant +cubemap-panorama+ 5)
1705+
1706+;;// Texture parameters: wrap mode
1707+;;typedef enum {
1708+;; WRAP_REPEAT = 0, // Repeats texture in tiled mode
1709+;; WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode
1710+;; WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode
1711+;; WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode
1712+;;} TextureWrapMode;
1713+(define-constant +cubemap-auto-detect+ 0)
1714+(define-constant +cubemap-line-vertical+ 1)
1715+(define-constant +cubemap-line-horizontal+ 2)
1716+(define-constant +cubemap-cross-three-by-four+ 3)
1717+(define-constant +cubemap-cross-four-by-three+ 4)
1718+(define-constant +cubemap-panorama+ 5)
1719+
1720+;;// Font type, defines generation method
1721+;;typedef enum {
1722+;; FONT_DEFAULT = 0, // Default font generation, anti-aliased
1723+;; FONT_BITMAP, // Bitmap font generation, no anti-aliasing
1724+;; FONT_SDF // SDF font generation, requires external shader
1725+;;} FontType;
1726+(define-constant +font-default+ 0)
1727+(define-constant +font-bitmap+ 1)
1728+(define-constant +font-sdf+ 2)
1729+
1730+;;// Color blending modes (pre-defined)
1731+;;typedef enum {
1732+;; BLEND_ALPHA = 0, // Blend textures considering alpha (default)
1733+;; BLEND_ADDITIVE, // Blend textures adding colors
1734+;; BLEND_MULTIPLIED // Blend textures multiplying colors
1735+;;} BlendMode;
1736+(define-constant +blend-alpha+ 0)
1737+(define-constant +blend-additive+ 1)
1738+(define-constant +blend-multiplied+ 2)
1739+
1740+;;// Gestures type
1741+;;// NOTE: It could be used as flags to enable only some gestures
1742+;;typedef enum {
1743+;; GESTURE_NONE = 0,
1744+;; GESTURE_TAP = 1,
1745+;; GESTURE_DOUBLETAP = 2,
1746+;; GESTURE_HOLD = 4,
1747+;; GESTURE_DRAG = 8,
1748+;; GESTURE_SWIPE_RIGHT = 16,
1749+;; GESTURE_SWIPE_LEFT = 32,
1750+;; GESTURE_SWIPE_UP = 64,
1751+;; GESTURE_SWIPE_DOWN = 128,
1752+;; GESTURE_PINCH_IN = 256,
1753+;; GESTURE_PINCH_OUT = 512
1754+;;} GestureType;
1755+(define-constant +gesture-none+ 0)
1756+(define-constant +gesture-tap+ 1)
1757+(define-constant +gesture-doubletap+ 2)
1758+(define-constant +gesture-hold+ 4)
1759+(define-constant +gesture-drag+ 8)
1760+(define-constant +gesture-swipe-right+ 16)
1761+(define-constant +gesture-swipe-left+ 32)
1762+(define-constant +gesture-swipe-up+ 64)
1763+(define-constant +gesture-swipe-down+ 128)
1764+(define-constant +gesture-pinch-in+ 256)
1765+(define-constant +gesture-pinch-out+ 512)
1766+
1767+;;// Camera system modes
1768+;;typedef enum {
1769+;; CAMERA_CUSTOM = 0,
1770+;; CAMERA_FREE,
1771+;; CAMERA_ORBITAL,
1772+;; CAMERA_FIRST_PERSON,
1773+;; CAMERA_THIRD_PERSON
1774+;;} CameraMode;
1775+(define-constant +camera-custom+ 0)
1776+(define-constant +camera-free+ 1)
1777+(define-constant +camera-orbital+ 2)
1778+(define-constant +camera-first_person+ 3)
1779+(define-constant +camera-third_person+ 4)
1780+
1781+;;// Camera projection modes
1782+;;typedef enum {
1783+;; CAMERA_PERSPECTIVE = 0,
1784+;; CAMERA_ORTHOGRAPHIC
1785+;;} CameraType;
1786+(define-constant +camera-perspective+ 0)
1787+(define-constant +camera-orthographic+ 1)
1788+
1789+;;// Type of n-patch
1790+;;typedef enum {
1791+;; NPT_9PATCH = 0, // Npatch defined by 3x3 tiles
1792+;; NPT_3PATCH_VERTICAL, // Npatch defined by 1x3 tiles
1793+;; NPT_3PATCH_HORIZONTAL // Npatch defined by 3x1 tiles
1794+;;} NPatchType;
1795+(define-constant +npt-9patch+ 0)
1796+(define-constant +npt-3patch-vertical+ 1)
1797+(define-constant +npt-3patch-horizontal+ 2)
1798+
1799+;;// Callbacks to be implemented by users
1800+;;typedef void (*TraceLogCallback)(int logType, const char *text, va_list args);
1801+;;
1802+;;#if defined(__cplusplus)
1803+;;extern "C" { // Prevents name mangling of functions
1804+;;#endif
1805+;;
1806+;;//------------------------------------------------------------------------------------
1807+;;// Global Variables Definition
1808+;;//------------------------------------------------------------------------------------
1809+;;// It's lonely here...
1810+;;
1811+;;//------------------------------------------------------------------------------------
1812+;;// Window and Graphics Device Functions (Module: core)
1813+;;//------------------------------------------------------------------------------------
1814+;;
1815+;;// Window-related functions
1816+;;RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
1817+(defcfun "InitWindow" :void
1818+ "Initialize window and OpenGL context"
1819+ (width :int)
1820+ (height :int)
1821+ (title :string))
1822+
1823+;;RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
1824+(defcfun "WindowShouldClose" :bool
1825+ "Check if KEY_ESCAPE pressed or Close icon pressed")
1826+
1827+;;RLAPI void CloseWindow(void); // Close window and unload OpenGL context
1828+(defcfun "CloseWindow" :void
1829+ "Close window and unload OpenGL context")
1830+
1831+;;RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
1832+(defcfun "IsWindowReady" :boolean
1833+ "Check if window has been initialized successfully")
1834+
1835+;;RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus)
1836+(defcfun "IsWindowMinimized" :boolean
1837+ "Check if window has been minimized (or lost focus)")
1838+
1839+;;RLAPI bool IsWindowResized(void); // Check if window has been resized
1840+(defcfun "IsWindowResized" :boolean
1841+ "Check if window has been resized")
1842+
1843+;;RLAPI bool IsWindowHidden(void); // Check if window is currently hidden
1844+(defcfun "IsWindowHidden" :boolean
1845+ "Check if window is currently hidden")
1846+
1847+;;RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen
1848+(defcfun "IsWindowFullscreen" :boolean
1849+ "Check if window is currently fullscreen")
1850+
1851+;;RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP)
1852+(defcfun "ToggleFullscreen" :void
1853+ "Toggle fullscreen mode (only PLATFORM_DESKTOP)")
1854+
1855+;;RLAPI void UnhideWindow(void); // Show the window
1856+(defcfun "UnhideWindow" :void
1857+ "Show the window")
1858+
1859+;;RLAPI void HideWindow(void); // Hide the window
1860+(defcfun "HideWindow" :void
1861+ "Hide the window")
1862+
1863+;;RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP)
1864+(defcfun "SetWindowIcon" :void
1865+ "Set icon for window (only PLATFORM_DESKTOP)"
1866+ (image (:struct %image)))
1867+
1868+;;RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP)
1869+(defcfun "SetWindowTitle" :void
1870+ "Set title for window (only PLATFORM_DESKTOP)"
1871+ (title :string))
1872+
1873+;;RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
1874+(defcfun "SetWindowPosition" :void
1875+ "Set window position on screen (only PLATFORM_DESKTOP)"
1876+ (x :int)
1877+ (y :int))
1878+
1879+;;RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
1880+(defcfun "SetWindowMonitor" :void
1881+ "Set monitor for the current window (fullscreen mode)"
1882+ (monitor :int))
1883+
1884+;;RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
1885+(defcfun "SetWindowMinSize" :void
1886+ "Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)"
1887+ (width :int)
1888+ (height :int))
1889+
1890+;;RLAPI void SetWindowSize(int width, int height); // Set window dimensions
1891+(defcfun "SetWindowSize" :void
1892+ "Set window dimensions"
1893+ (width :int)
1894+ (height :int))
1895+
1896+;;RLAPI void *GetWindowHandle(void); // Get native window handle
1897+(defcfun "GetWindowHandle" :pointer
1898+ "Get native window handle")
1899+
1900+;;RLAPI int GetScreenWidth(void); // Get current screen width
1901+(defcfun "GetScreenWidth" :int
1902+ "Get current screen width")
1903+
1904+;;RLAPI int GetScreenHeight(void); // Get current screen height
1905+(defcfun "GetScreenHeight" :int
1906+ "Get current screen height")
1907+
1908+;;RLAPI int GetMonitorCount(void); // Get number of connected monitors
1909+(defcfun "GetMonitorCount" :int
1910+ "Get number of connected monitors")
1911+
1912+;;RLAPI int GetMonitorWidth(int monitor); // Get primary monitor width
1913+(defcfun "GetMonitorWidth" :int
1914+ "Get primary monitor width"
1915+ (monitor :int))
1916+
1917+;;RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height
1918+(defcfun "GetMonitorHeight" :int
1919+ "Get primary monitor height"
1920+ (monitor :int))
1921+
1922+;;RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
1923+(defcfun "GetMonitorPhysicalWidth" :int
1924+ "Get primary monitor physical width in millimetres"
1925+ (monitor :int))
1926+
1927+;;RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
1928+(defcfun "GetMonitorPhysicalHeight" :int
1929+ "Get primary monitor physical height in millimetres"
1930+ (monitor :int))
1931+
1932+;;RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
1933+(defcfun "GetWindowPosition" (:struct %vector2)
1934+ "Get window position XY on monitor")
1935+
1936+;;RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
1937+(defcfun "GetMonitorName" :string
1938+ "Get the human-readable, UTF-8 encoded name of the primary monitor"
1939+ (monitor :int))
1940+
1941+;;RLAPI const char *GetClipboardText(void); // Get clipboard text content
1942+(defcfun "GetClipboardText" :string
1943+ "Get clipboard text content")
1944+
1945+;;RLAPI void SetClipboardText(const char *text); // Set clipboard text content
1946+(defcfun "SetClipboardText" :void
1947+ "Set clipboard text content"
1948+ (text :string))
1949+
1950+;;// Cursor-related functions
1951+;;RLAPI void ShowCursor(void); // Shows cursor
1952+(defcfun "ShowCursor" :void
1953+ "Shows cursor")
1954+
1955+;;RLAPI void HideCursor(void); // Hides cursor
1956+(defcfun "HideCursor" :void
1957+ "Hides cursor")
1958+
1959+;;RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
1960+(defcfun "IsCursorHidden" :boolean
1961+ "Check if cursor is not visible")
1962+
1963+;;RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
1964+(defcfun "EnableCursor" :void
1965+ "Enables cursor (unlock cursor)")
1966+
1967+;;RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
1968+(defcfun "DisableCursor" :void
1969+ "Disables cursor (lock cursor)")
1970+
1971+;;// Drawing-related functions
1972+;;RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
1973+(defcfun "ClearBackground" :void
1974+ "Set background color (framebuffer clear color)"
1975+ (color (:struct %color)))
1976+
1977+;;RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing
1978+(defcfun "BeginDrawing" :void
1979+ "Setup canvas (framebuffer) to start drawing")
1980+
1981+;;RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering)
1982+(defcfun "EndDrawing" :void
1983+ "End canvas drawing and swap buffers (double buffering)")
1984+
1985+;;RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D)
1986+(defcfun "BeginMode2D" :void
1987+ "Initialize 2D mode with custom camera (2D)"
1988+ (camera (:struct %camera2d)))
1989+
1990+;;RLAPI void EndMode2D(void); // Ends 2D mode with custom camera
1991+(defcfun "EndMode2D" :void
1992+ "Ends 2D mode with custom camera")
1993+
1994+;;RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D)
1995+(defcfun "BeginMode3D" :void
1996+ "Initializes 3D mode with custom camera (3D)"
1997+ (camera (:struct %camera3d)))
1998+
1999+;;RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode
2000+(defcfun "EndMode3D" :void
2001+ "Ends 3D mode and returns to default 2D orthographic mode")
2002+
2003+;;RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing
2004+(defcfun "BeginTextureMode" :void
2005+ "Initializes render texture for drawing"
2006+ (target (:struct %render-texture)))
2007+
2008+;;RLAPI void EndTextureMode(void); // Ends drawing to render texture
2009+(defcfun "EndTextureMode" :void
2010+ "Ends drawing to render texture")
2011+
2012+;;RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing)
2013+(defcfun "BeginScissorMode" :void
2014+ "Begin scissor mode (define screen area for following drawing)"
2015+ (x :int)
2016+ (y :int)
2017+ (width :int)
2018+ (height :int))
2019+
2020+;;RLAPI void EndScissorMode(void); // End scissor mode
2021+(defcfun "EndScissorMode" :void
2022+ "End scissor mode")
2023+
2024+;;// Screen-space-related functions
2025+;;RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position
2026+(defcfun "GetMouseRay" (:struct %ray)
2027+ "Returns a ray trace from mouse position"
2028+ (mouse-position (:struct %vector2))
2029+ (camera (:struct %camera3d)))
2030+
2031+;;RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix)
2032+(defcfun "GetCameraMatrix" (:struct %matrix)
2033+ "Returns camera transform matrix (view matrix)"
2034+ (camera (:struct %camera3d)))
2035+
2036+;;RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Returns camera 2d transform matrix
2037+(defcfun "GetCameraMatrix2D" (:struct %matrix)
2038+ "Returns camera 2d transform matrix"
2039+ (camera (:struct %camera2d)))
2040+
2041+;;RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position
2042+(defcfun "GetWorldToScreen" (:struct %vector2)
2043+ "Returns the screen space position for a 3d world space position"
2044+ (position (:struct %vector3))
2045+ (camera (:struct %camera3d)))
2046+
2047+;;RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Returns size position for a 3d world space position
2048+;;RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Returns the screen space position for a 2d camera world space position
2049+;;RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Returns the world space position for a 2d camera screen space position
2050+;;
2051+;;// Timing-related functions
2052+;;RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
2053+(defcfun "SetTargetFPS" :void
2054+ "Set target FPS (maximum)"
2055+ (fps :int))
2056+
2057+;;RLAPI int GetFPS(void); // Returns current FPS
2058+(defcfun "GetFPS" :int
2059+ "Returns current FPS")
2060+
2061+;;RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn
2062+(defcfun "GetFrameTime" :float
2063+ "Returns time in seconds for last frame drawn")
2064+
2065+;;RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow()
2066+(defcfun "GetTime" :double
2067+ "Returns elapsed time in seconds since InitWindow()")
2068+
2069+;;// Color-related functions
2070+;;RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color
2071+(defcfun "ColorToInt" :int
2072+ "Returns hexadecimal value for a Color"
2073+ (color (:struct %color)))
2074+
2075+;;RLAPI Vector4 ColorNormalize(Color color); // Returns color normalized as float [0..1]
2076+(defcfun "ColorNormalize" (:struct %vector4)
2077+ "Returns color normalized as float [0..1]"
2078+ (color (:struct %color)))
2079+
2080+;;RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns color from normalized values [0..1]
2081+(defcfun "ColorFromNormalized" (:struct %color)
2082+ "Returns color from normalized values [0..1]"
2083+ (normalized (:struct %vector4)))
2084+
2085+;;RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color
2086+(defcfun "ColorToHSV" (:struct %vector3)
2087+ "Returns HSV values for a Color"
2088+ (color (:struct %color)))
2089+
2090+;;RLAPI Color ColorFromHSV(Vector3 hsv); // Returns a Color from HSV values
2091+(defcfun "ColorFromHSV" (:struct %color)
2092+ "Returns a Color from HSV values"
2093+ (hsv (:struct %vector3)))
2094+
2095+;;RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
2096+(defcfun "GetColor" (:struct %color)
2097+ "Returns a Color struct from hexadecimal value"
2098+ (hex-value :int))
2099+
2100+;;RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
2101+(defcfun "Fade" (:struct %color)
2102+ "Color fade-in or fade-out, alpha goes from 0.0f to 1.0f"
2103+ (color (:struct %color))
2104+ (alpha :float))
2105+
2106+;;// Misc. functions
2107+;;RLAPI void SetConfigFlags(unsigned int flags); // Setup window configuration flags (view FLAGS)
2108+(defcfun "SetConfigFlags" :void
2109+ "Setup window configuration flags (view FLAGS)"
2110+ (flags :unsigned-int))
2111+
2112+;;RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level
2113+(defcfun "SetTraceLogLevel" :void
2114+ "Set the current threshold (minimum) log level"
2115+ (log-type :int))
2116+
2117+;;RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level
2118+(defcfun "SetTraceLogExit" :void
2119+ "Set the exit threshold (minimum) log level"
2120+ (log-type :int))
2121+
2122+;;RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging
2123+;;RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)
2124+(defcfun "TraceLog" :void
2125+ "Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)"
2126+ (log-type :int)
2127+ (text :string)
2128+ &rest)
2129+
2130+;;RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png)
2131+(defcfun "TakeScreenshot" :void
2132+ "Takes a screenshot of current screen (saved a .png)"
2133+ (file-name :string))
2134+
2135+;;RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
2136+(defcfun "GetRandomValue" :int
2137+ "Returns a random value between min and max (both included)"
2138+ (min :int)
2139+ (max :int))
2140+
2141+;;// Files management functions
2142+;;RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read)
2143+(defcfun "LoadFileData" (:pointer :unsigned-char)
2144+ "Load file data as byte array (read)"
2145+ (file-name :string)
2146+ (bytes-read (:pointer :unsigned-int)))
2147+
2148+;;RLAPI void SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write)
2149+(defcfun "SaveFileData" :void
2150+ "Save data to file from byte array (write)"
2151+ (file-name :string)
2152+ (data :pointer)
2153+ (bytes-to-write :unsigned-int))
2154+
2155+;;RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
2156+(defcfun "LoadFileText" (:pointer :char)
2157+ "Load text data from file (read), returns a '\0' terminated string"
2158+ (file-name :string))
2159+
2160+;;RLAPI void SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated
2161+(defcfun "SaveFileText" :void
2162+ "Save text data to file (write), string must be '\0' terminated"
2163+ (file-name :string)
2164+ (text (:pointer :char)))
2165+
2166+;;RLAPI bool FileExists(const char *fileName); // Check if file exists
2167+(defcfun "FileExists" :boolean
2168+ "Check if file exists"
2169+ (filename :string))
2170+
2171+;;RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension
2172+(defcfun "IsFileExtension" :boolean
2173+ "Check file extension"
2174+ (file-name :string)
2175+ (ext :string))
2176+
2177+;;RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists
2178+(defcfun "DirectoryExists" :boolean
2179+ "Check if a directory path exists"
2180+ (dir-path :string))
2181+
2182+;;RLAPI const char *GetExtension(const char *fileName); // Get pointer to extension for a filename string
2183+(defcfun "GetExtension" :string
2184+ "Get pointer to extension for a filename string"
2185+ (file-name :string))
2186+
2187+;;RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
2188+(defcfun "GetFileName" :string
2189+ "Get pointer to filename for a path string"
2190+ (file-name :string))
2191+
2192+;;RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (memory should be freed)
2193+(defcfun "GetFileNameWithoutExt" :string
2194+ "Get filename string without extension (memory should be freed)"
2195+ (file-name :string))
2196+;;RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
2197+(defcfun "GetDirectoryPath" :string
2198+ "Get full path for a given fileName (uses static string)"
2199+ (file-path :string))
2200+
2201+;;RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
2202+(defcfun "GetPrevDirectoryPath" :string
2203+ "Get previous directory path for a given path (uses static string)"
2204+ (dir-path :string))
2205+
2206+;;RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
2207+(defcfun "GetWorkingDirectory" :string
2208+ "Get current working directory (uses static string)")
2209+
2210+;;RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed)
2211+(defcfun "GetDirectoryFiles" :pointer
2212+ "Get filenames in a directory path (memory should be freed)"
2213+ (dir-path :string)
2214+ (count (:pointer :int)))
2215+
2216+;;RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory)
2217+(defcfun "ClearDirectoryFiles" :void
2218+ "Clear directory files paths buffers (free memory)")
2219+
2220+;;RLAPI bool ChangeDirectory(const char *dir); // Change working directory, returns true if success
2221+(defcfun "ChangeDirectory" :bool
2222+ "Change working directory, returns true if success"
2223+ (dir :string))
2224+
2225+;;RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
2226+(defcfun "IsFileDropped" :boolean
2227+ "Check if a file has been dropped into window")
2228+
2229+;;RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed)
2230+(defcfun "GetDroppedFiles" :pointer
2231+ "Get dropped files names (memory should be freed)"
2232+ (count :int))
2233+
2234+;;RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory)
2235+(defcfun "ClearDroppedFiles" :void
2236+ "Clear dropped files paths buffer (free memory)")
2237+
2238+;;RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
2239+(defcfun "GetFileModTime" :long
2240+ "Get file modification time (last write time)"
2241+ (file-name :string))
2242+
2243+;;RLAPI unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorythm)
2244+(defcfun "CompressData" (:pointer :unsigned-char)
2245+ "Compress data (DEFLATE algorythm)"
2246+ (data (:pointer :unsigned-char))
2247+ (data-length :int)
2248+ (comp-data-length (:pointer :int)))
2249+
2250+;;RLAPI unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorythm)
2251+(defcfun "DecompressData" (:pointer :unsigned-char)
2252+ "Decompress data (DEFLATE algorythm)"
2253+ (comp-data (:pointer :unsigned-char))
2254+ (comp-data-length :int)
2255+ (data-length (:pointer :int)))
2256+
2257+;;// Persistent storage management
2258+;;RLAPI void SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position)
2259+(defcfun "SaveStorageValue" :void
2260+ "Save integer value to storage file (to defined position)"
2261+ (position :unsigned-int)
2262+ (value :int))
2263+
2264+;;RLAPI int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position)
2265+(defcfun "LoadStorageValue" :int
2266+ "Load integer value from storage file (from defined position)"
2267+ (position :unsigned-int))
2268+
2269+;;RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available)
2270+(defcfun "OpenURL" :void
2271+ "Open URL with default system browser (if available)"
2272+ (url :string))
2273+
2274+;;//------------------------------------------------------------------------------------
2275+;;// Input Handling Functions (Module: core)
2276+;;//------------------------------------------------------------------------------------
2277+;;
2278+;;// Input-related functions: keyboard
2279+;;RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once
2280+(defcfun "IsKeyPressed" :bool
2281+ "Detect if a key has been pressed once"
2282+ (key :int))
2283+
2284+;;RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed
2285+(defcfun "IsKeyDown" :bool
2286+ "Detect if a key is being pressed"
2287+ (key :int))
2288+
2289+;;RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once
2290+(defcfun "IsKeyReleased" :bool
2291+ "Detect if a key has been released once"
2292+ (key :int))
2293+
2294+;;RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed
2295+(defcfun "IsKeyUp" :bool
2296+ "Detect if a key is NOT being pressed"
2297+ (key :int))
2298+
2299+;;RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
2300+(defcfun "SetExitKey" :void
2301+ "Set a custom key to exit program (default is ESC)"
2302+ (key :int))
2303+
2304+;;RLAPI int GetKeyPressed(void); // Get key pressed, call it multiple times for chars queued
2305+(defcfun "GetKeyPressed" :int
2306+ "Get key pressed, call it multiple times for chars queued")
2307+;;
2308+;;// Input-related functions: gamepads
2309+;;RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available
2310+(defcfun "IsGamepadAvailable" :boolean
2311+ "Detect if a gamepad is available"
2312+ (gamepad :int))
2313+
2314+;;RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available)
2315+(defcfun "IsGamepadName" :boolean
2316+ "Check gamepad name (if available)"
2317+ (gamepad :int)
2318+ (name :string))
2319+
2320+;;RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id
2321+(defcfun "GetGamepadName" :string
2322+ "Return gamepad internal name id"
2323+ (gamepad :int))
2324+
2325+;;RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once
2326+(defcfun "IsGamepadButtonPressed" :boolean
2327+ "Detect if a gamepad button has been pressed once"
2328+ (gamepad :int)
2329+ (button :int))
2330+
2331+;;RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed
2332+(defcfun "IsGamepadButtonDown" :boolean
2333+ "Detect if a gamepad button is being pressed"
2334+ (gamepad :int)
2335+ (button :int))
2336+
2337+;;RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once
2338+(defcfun "IsGamepadButtonReleased" :boolean
2339+ "Detect if a gamepad button has been released once"
2340+ (gamepad :int)
2341+ (button :int))
2342+
2343+;;RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed
2344+(defcfun "IsGamepadButtonUp" :boolean
2345+ "Detect if a gamepad button is NOT being pressed"
2346+ (gamepad :int)
2347+ (button :int))
2348+
2349+;;RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
2350+(defcfun "GetGamepadButtonPressed" :int
2351+ "Get the last gamepad button pressed")
2352+
2353+;;RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad
2354+(defcfun "GetGamepadAxisCount" :int
2355+ "Return gamepad axis count for a gamepad"
2356+ (gamepad :int))
2357+
2358+;;RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis
2359+(defcfun "GetGamepadAxisMovement" :float
2360+ "Return axis movement value for a gamepad axis"
2361+ (gamepad :int)
2362+ (axis :int))
2363+
2364+;;// Input-related functions: mouse
2365+;;RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once
2366+(defcfun "IsMouseButtonPressed" :boolean
2367+ "Detect if a mouse button has been pressed once"
2368+ (button :int))
2369+
2370+;;RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed
2371+(defcfun "IsMouseButtonDown" :boolean
2372+ "Detect if a mouse button is being pressed"
2373+ (button :int))
2374+
2375+;;RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once
2376+(defcfun "IsMouseButtonReleased" :boolean
2377+ "Detect if a mouse button has been released once"
2378+ (button :int))
2379+
2380+;;RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed
2381+(defcfun "IsMouseButtonUp" :boolean
2382+ "Detect if a mouse button is NOT being pressed"
2383+ (button :int))
2384+
2385+;;RLAPI int GetMouseX(void); // Returns mouse position X
2386+(defcfun "GetMouseX" :int
2387+ "Returns mouse position X")
2388+
2389+;;RLAPI int GetMouseY(void); // Returns mouse position Y
2390+(defcfun "GetMouseY" :int
2391+ "Returns mouse position Y")
2392+
2393+;;RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY
2394+(defcfun "GetMousePosition" (:struct %vector2)
2395+ "Returns mouse position XY")
2396+
2397+;;RLAPI void SetMousePosition(int x, int y); // Set mouse position XY
2398+(defcfun "SetMousePosition" :void
2399+ "Set mouse position XY"
2400+ (x :int)
2401+ (y :int))
2402+
2403+;;RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset
2404+(defcfun "SetMouseOffset" :void
2405+ "Set mouse offset"
2406+ (offset-x :int)
2407+ (offset-y :int))
2408+
2409+;;RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling
2410+(defcfun "SetMouseScale" :void
2411+ "Set mouse scaling"
2412+ (scale-x :float)
2413+ (scale-y :float))
2414+
2415+;;RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y
2416+(defcfun "GetMouseWheelMove" :int
2417+ "Returns mouse wheel movement Y")
2418+
2419+;;// Input-related functions: touch
2420+;;RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size)
2421+(defcfun "GetTouchX" :int
2422+ "Returns touch position X for touch point 0 (relative to screen size)")
2423+
2424+;;RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size)
2425+(defcfun "GetTouchY" :int
2426+ "Returns touch position Y for touch point 0 (relative to screen size)")
2427+
2428+;;RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size)
2429+(defcfun "GetTouchPosition" (:struct %vector2)
2430+ "Returns touch position XY for a touch point index (relative to screen size)"
2431+ (index :int))
2432+
2433+;;//------------------------------------------------------------------------------------
2434+;;// Gestures and Touch Handling Functions (Module: gestures)
2435+;;//------------------------------------------------------------------------------------
2436+;;RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags
2437+(defcfun "SetGesturesEnabled" :void
2438+ "Enable a set of gestures using flags"
2439+ (gesture-flags :unsigned-int))
2440+
2441+;;RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected
2442+(defcfun "IsGestureDetected" :boolean
2443+ "Check if a gesture have been detected"
2444+ (gesture :int))
2445+
2446+;;RLAPI int GetGestureDetected(void); // Get latest detected gesture
2447+(defcfun "GetGestureDetected" :int
2448+ "Get latest detected gesture")
2449+
2450+;;RLAPI int GetTouchPointsCount(void); // Get touch points count
2451+(defcfun "GetTouchPointsCount" :int
2452+ "Get touch points count")
2453+
2454+;;RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
2455+(defcfun "GetGestureHoldDuration" :float
2456+ "Get gesture hold time in milliseconds")
2457+
2458+;;RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector
2459+(defcfun "GetGestureDragVector" (:struct %vector2)
2460+ "Get gesture drag vector")
2461+
2462+;;RLAPI float GetGestureDragAngle(void); // Get gesture drag angle
2463+(defcfun "GetGestureDragAngle" :float
2464+ "Get gesture drag angle")
2465+
2466+;;RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
2467+(defcfun "GetGesturePinchVector" (:struct %vector2)
2468+ "Get gesture pinch delta")
2469+
2470+;;RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle
2471+(defcfun "GetGesturePinchAngle" :float
2472+ "Get gesture pinch angle")
2473+
2474+;;//------------------------------------------------------------------------------------
2475+;;// Camera System Functions (Module: camera)
2476+;;//------------------------------------------------------------------------------------
2477+;;RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
2478+(defcfun "SetCameraMode" :void
2479+ "Set camera mode (multiple camera modes available)"
2480+ (camera (:struct %camera3d))
2481+ (mode :int))
2482+
2483+;;RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode
2484+(defcfun "UpdateCamera" :void
2485+ (camera (:pointer (:struct %camera3d))))
2486+
2487+;;RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera)
2488+(defcfun "SetCameraPanControl" :void
2489+ (pan-key :int))
2490+
2491+;;RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera)
2492+(defcfun "SetCameraAltControl" :void
2493+ (alt-key :int))
2494+
2495+;;RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera)
2496+(defcfun "SetCameraSmoothZoomControl" :void
2497+ "Set camera smooth zoom key to combine with mouse (free camera)"
2498+ (sz-key :int))
2499+
2500+;;RLAPI void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras)
2501+(defcfun "SetCameraMoveControls" :void
2502+ "Set camera move controls (1st person and 3rd person cameras)"
2503+ (front-key :int)
2504+ (back-key :int)
2505+ (right-key :int)
2506+ (left-key :int)
2507+ (up-key :int)
2508+ (down-key :int))
2509+
2510+;;//------------------------------------------------------------------------------------
2511+;;// Basic Shapes Drawing Functions (Module: shapes)
2512+;;//------------------------------------------------------------------------------------
2513+;;
2514+;;// Basic shapes drawing functions
2515+;;RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel
2516+(defcfun "DrawPixel" :void
2517+ "Draw a pixel"
2518+ (pos-x :int)
2519+ (pos-y :int)
2520+ (color (:struct %color)))
2521+
2522+;;RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
2523+(defcfun "DrawPixelV" :void
2524+ "Draw a pixel (Vector version)"
2525+ (position (:struct %vector2))
2526+ (color (:struct %color)))
2527+
2528+;;RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
2529+(defcfun "DrawLine" :void
2530+ "Draw a line"
2531+ (start-pos-x :int)
2532+ (start-pos-y :int)
2533+ (end-pos-x :int)
2534+ (end-pos-y :int)
2535+ (color (:struct %color)))
2536+
2537+;;RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version)
2538+(defcfun "DrawLineV" :void
2539+ "Draw a line (Vector version)"
2540+ (start-pos (:struct %vector2))
2541+ (end-pos (:struct %vector2))
2542+ (color (:struct %color)))
2543+
2544+;;RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness
2545+(defcfun "DrawLineEx" :void
2546+ "Draw a line defining thickness"
2547+ (start-pos (:struct %vector2))
2548+ (end-pos (:struct %vector2))
2549+ (thick :float)
2550+ (color (:struct %color)))
2551+
2552+;;RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out
2553+(defcfun "DrawLineBezier" :void
2554+ "Draw a line using cubic-bezier curves in-out"
2555+ (start-pos (:struct %vector2))
2556+ (end-pos (:struct %vector2))
2557+ (thick :float)
2558+ (color (:struct %color)))
2559+
2560+;;RLAPI void DrawLineStrip(Vector2 *points, int numPoints, Color color); // Draw lines sequence
2561+(defcfun "DrawLineStrip" :void
2562+ "Draw lines sequence"
2563+ (points (:struct %vector2))
2564+ (num-points :int)
2565+ (color (:struct %color)))
2566+
2567+;;RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
2568+(defcfun "DrawCircle" :void
2569+ "Draw a color-filled circle"
2570+ (center-x :int)
2571+ (center-y :int)
2572+ (radius :float)
2573+ (color (:struct %color)))
2574+
2575+;;RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle
2576+(defcfun "DrawCircleSector" :void
2577+ "Draw a piece of a circle"
2578+ (center (:struct %vector2))
2579+ (radius :float)
2580+ (start-angle :int)
2581+ (end-angle :int)
2582+ (segments :int)
2583+ (color (:struct %color)))
2584+
2585+;;RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline
2586+(defcfun "DrawCircleSectorLines" :void
2587+ "Draw circle sector outline"
2588+ (center (:struct %vector2))
2589+ (radius :float)
2590+ (start-angle :int)
2591+ (end-angle :int)
2592+ (segments :int)
2593+ (color (:struct %color)))
2594+
2595+;;RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
2596+(defcfun "DrawCircleGradient" :void
2597+ "Draw a gradient-filled circle"
2598+ (center-x :int)
2599+ (center-y :int)
2600+ (radius :float)
2601+ (color1 (:struct %color))
2602+ (color2 (:struct %color)))
2603+
2604+;;RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
2605+(defcfun "DrawCircleV" :void
2606+ "Draw a color-filled circle (Vector version)"
2607+ (center (:struct %vector2))
2608+ (radius :float)
2609+ (color (:struct %color)))
2610+
2611+;;RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
2612+(defcfun "DrawCircleLines" :void
2613+ "Draw circle outline"
2614+ (center-x :int)
2615+ (center-y :int)
2616+ (radius :float)
2617+ (color (:struct %color)))
2618+
2619+;;RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
2620+(defcfun "DrawEllipse" :void
2621+ "Draw ellipse"
2622+ (center-x :int)
2623+ (center-y :int)
2624+ (radius-h :float)
2625+ (radius-v :float)
2626+ (color (:struct %color)))
2627+
2628+;;RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
2629+(defcfun "DrawEllipseLines" :void
2630+ "Draw ellipse outline"
2631+ (center-x :int)
2632+ (center-y :int)
2633+ (radius-h :float)
2634+ (radius-v :float)
2635+ (color (:struct %color)))
2636+
2637+;;RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring
2638+(defcfun "DrawRing" :void
2639+ "Draw ring"
2640+ (center (:struct %vector2))
2641+ (inner-radius :float)
2642+ (outer-radius :float)
2643+ (start-angle :int)
2644+ (end-angle :int)
2645+ (segments :int)
2646+ (color (:struct %color)))
2647+
2648+;;RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline
2649+(defcfun "DrawRingLines" :void
2650+ "Draw ring outline"
2651+ (center (:struct %vector2))
2652+ (inner-radius :float)
2653+ (outer-radius :float)
2654+ (start-angle :int)
2655+ (end-angle :int)
2656+ (segments :int)
2657+ (color (:struct %color)))
2658+
2659+;;RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
2660+(defcfun "DrawRectangle" :void
2661+ "Draw a color-filled rectangle"
2662+ (pos-x :int)
2663+ (pos-y :int)
2664+ (width :int)
2665+ (height :int)
2666+ (color (:struct %color)))
2667+
2668+;;RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
2669+(defcfun "DrawRectangleV" :void
2670+ "Draw a color-filled rectangle (Vector version)"
2671+ (position (:struct %vector2))
2672+ (size (:struct %vector2))
2673+ (color (:struct %color)))
2674+
2675+;;RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
2676+(defcfun "DrawRectangleRec" :void
2677+ "Draw a color-filled rectangle"
2678+ (rec (:struct %rectangle))
2679+ (color (:struct %color)))
2680+
2681+;;RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
2682+(defcfun "DrawRectanglePro" :void
2683+ "Draw a color-filled rectangle with pro parameters"
2684+ (rec (:struct %rectangle))
2685+ (origin (:struct %vector2))
2686+ (rotation :float)
2687+ (color (:struct %color)))
2688+
2689+;;RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle
2690+(defcfun "DrawRectangleGradientV" :void
2691+ "Draw a vertical-gradient-filled rectangle"
2692+ (pos-x :int)
2693+ (pos-y :int)
2694+ (width :int)
2695+ (height :int)
2696+ (color1 (:struct %color))
2697+ (color2 (:struct %color)))
2698+
2699+;;RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle
2700+(defcfun "DrawRectangleGradientH" :void
2701+ "Draw a horizontal-gradient-filled rectangle"
2702+ (pos-x :int)
2703+ (pos-y :int)
2704+ (width :int)
2705+ (height :int)
2706+ (color1 (:struct %color))
2707+ (color2 (:struct %color)))
2708+
2709+;;RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
2710+(defcfun "DrawRectangleGradientEx" :void
2711+ "Draw a gradient-filled rectangle with custom vertex colors"
2712+ (rec (:struct %rectangle))
2713+ (col1 (:struct %color))
2714+ (col2 (:struct %color))
2715+ (col3 (:struct %color))
2716+ (col4 (:struct %color)))
2717+
2718+;;RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
2719+(defcfun "DrawRectangleLines" :void
2720+ "Draw rectangle outline"
2721+ (pos-x :int)
2722+ (pos-y :int)
2723+ (width :int)
2724+ (height :int)
2725+ (color (:struct %color)))
2726+
2727+;;RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters
2728+(defcfun "DrawRectangleLinesEx" :void
2729+ "Draw rectangle outline with extended parameters"
2730+ (rec (:struct %rectangle))
2731+ (line-thick :int)
2732+ (color (:struct %color)))
2733+
2734+;;RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
2735+(defcfun "DrawRectangleRounded" :void
2736+ "Draw rectangle with rounded edges"
2737+ (rec (:struct %rectangle))
2738+ (roundness :float)
2739+ (segments :int)
2740+ (color (:struct %color)))
2741+
2742+;;RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline
2743+(defcfun "DrawRectangleRoundedLines" :void
2744+ "Draw rectangle with rounded edges outline"
2745+ (rec (:struct %rectangle))
2746+ (roundness :float)
2747+ (segments :int)
2748+ (line-thick :int)
2749+ (color (:struct %color)))
2750+
2751+;;RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle
2752+(defcfun "DrawTriangle" :void
2753+ "Draw a color-filled triangle"
2754+ (v1 (:struct %vector2))
2755+ (v2 (:struct %vector2))
2756+ (v3 (:struct %vector2))
2757+ (color (:struct %color)))
2758+
2759+;;RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline
2760+(defcfun "DrawTriangleLines" :void
2761+ "Draw triangle outline"
2762+ (v1 (:struct %vector2))
2763+ (v2 (:struct %vector2))
2764+ (v3 (:struct %vector2))
2765+ (color (:struct %color)))
2766+
2767+;;RLAPI void DrawTriangleFan(Vector2 *points, int numPoints, Color color); // Draw a triangle fan defined by points (first vertex is the center)
2768+(defcfun "DrawTriangleFan" :void
2769+ "Draw a triangle fan defined by points"
2770+ (points (:pointer (:struct %vector2)))
2771+ (num-points :int)
2772+ (color (:struct %color)))
2773+
2774+;;RLAPI void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color); // Draw a triangle strip defined by points
2775+(defcfun "DrawTriangleStrip" :void
2776+ "Draw a triangle strip defined by points"
2777+ (points (:pointer (:struct %vector2)))
2778+ (points-count :int)
2779+ (color (:struct %color)))
2780+
2781+;;RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
2782+(defcfun "DrawPoly" :void
2783+ "Draw a regular polygon (Vector version)"
2784+ (center (:struct %vector2))
2785+ (sides :int)
2786+ (radius :float)
2787+ (rotation :float)
2788+ (color (:struct %color)))
2789+
2790+;;RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides
2791+(defcfun "DrawPolyLines" :void
2792+ "Draw a polygon outline of n sides"
2793+ (center (:struct %vector2))
2794+ (sides :int)
2795+ (radius :float)
2796+ (rotation :float)
2797+ (color (:struct %color)))
2798+
2799+;;// Basic shapes collision detection functions
2800+;;RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
2801+(defcfun "CheckCollisionRecs" :bool
2802+ (rec1 (:struct %rectangle))
2803+ (rec2 (:struct %rectangle)))
2804+
2805+;;RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
2806+(defcfun "CheckCollisionCircles" :bool
2807+ (center1 (:struct %vector2))
2808+ (radius1 :float)
2809+ (center2 (:struct %vector2))
2810+ (radius2 :float))
2811+
2812+;;RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
2813+(defcfun "CheckCollisionCircleRec" :bool
2814+ (center (:struct %vector2))
2815+ (radius :float)
2816+ (rec (:struct %rectangle)))
2817+
2818+;;RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
2819+(defcfun "GetCollisionRec" (:struct %rectangle)
2820+ (rec1 (:struct %rectangle))
2821+ (rec2 (:struct %rectangle)))
2822+
2823+;;RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
2824+(defcfun "CheckCollisionPointRec" :bool
2825+ (point (:struct %vector2))
2826+ (rec (:struct %rectangle)))
2827+
2828+;;RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
2829+(defcfun "CheckCollisionPointCircle" :bool
2830+ (point (:struct %vector2))
2831+ (center (:struct %vector2))
2832+ (radius :float))
2833+
2834+;;RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
2835+(defcfun "CheckCollisionPointTriangle" :bool
2836+ (point (:struct %vector2))
2837+ (p1 (:struct %vector2))
2838+ (p2 (:struct %vector2))
2839+ (p3 (:struct %vector2)))
2840+
2841+;;//------------------------------------------------------------------------------------
2842+;;// Texture Loading and Drawing Functions (Module: textures)
2843+;;//------------------------------------------------------------------------------------
2844+;;
2845+;;// Image loading functions
2846+;;// NOTE: This functions do not require GPU access
2847+;;RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
2848+(defcfun "LoadImage" (:struct %image)
2849+ (file-name :string))
2850+
2851+;;RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit)
2852+(defcfun "LoadImageEx" (:struct %image)
2853+ (pixels (:pointer (:struct %color)))
2854+ (width :int)
2855+ (height :int))
2856+
2857+;;RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters
2858+(defcfun "LoadImagePro" (:struct %image)
2859+ "Load image from raw data with parameters"
2860+ (data :pointer)
2861+ (width :int)
2862+ (height :int)
2863+ (format :int))
2864+
2865+;;RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
2866+(defcfun "LoadImageRaw" (:struct %image)
2867+ "Load image from RAW file data"
2868+ (filename :string)
2869+ (width :int)
2870+ (height :int)
2871+ (format :int)
2872+ (header-size :int))
2873+
2874+;;RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
2875+(defcfun "UnloadImage" :void
2876+ "Unload image from CPU memory (RAM)"
2877+ (image (:struct %image)))
2878+
2879+;;RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file
2880+(defcfun "ExportImage" :void
2881+ "Export image data to file"
2882+ (image (:struct %image))
2883+ (filename :string))
2884+
2885+;;RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes
2886+(defcfun "ExportImageAsCode" :void
2887+ "Export image as code file defining an array of bytes"
2888+ (image (:struct %image))
2889+ (filename :string))
2890+
2891+;;RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
2892+(defcfun "GetImageData" :pointer
2893+ "Get pixel data from image as a Color struct array"
2894+ (image (:struct %image)))
2895+
2896+;;RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
2897+(defcfun "GetImageDataNormalized" :pointer
2898+ "Get pixel data from image as Vector4 array (float normalized)"
2899+ (image (:struct %image)))
2900+
2901+;;// Image generation functions
2902+;;RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
2903+(defcfun "GenImageColor" (:struct %image)
2904+ "Generate image: plain color"
2905+ (width :int)
2906+ (height :int)
2907+ (color (:struct %color)))
2908+
2909+;;RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient
2910+(defcfun "GenImageGradientV" (:struct %image)
2911+ "Generate image: vertical gradient"
2912+ (width :int)
2913+ (height :int)
2914+ (top (:struct %color))
2915+ (bottom (:struct %color)))
2916+
2917+;;RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient
2918+(defcfun "GenImageGradientH" (:struct %image)
2919+ "Generate image: horizontal gradient"
2920+ (width :int)
2921+ (height :int)
2922+ (left (:struct %color))
2923+ (right (:struct %color)))
2924+
2925+;;RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
2926+(defcfun "GenImageGradientRadial" (:struct %image)
2927+ "Generate image: radial gradient"
2928+ (width :int)
2929+ (height :int)
2930+ (density :float)
2931+ (inner (:struct %color))
2932+ (outer (:struct %color)))
2933+
2934+;;RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
2935+(defcfun "GenImageChecked" (:struct %image)
2936+ "Generate image: checked"
2937+ (width :int)
2938+ (height :int)
2939+ (checks-x :int)
2940+ (checks-y :int)
2941+ (col1 (:struct %color))
2942+ (col2 (:struct %color)))
2943+
2944+;;RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
2945+(defcfun "GenImageWhiteNoise" (:struct %image)
2946+ "Generate image: white noise"
2947+ (width :int)
2948+ (height :int)
2949+ (factor :float))
2950+
2951+;;RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
2952+(defcfun "GenImagePerlinNoise" (:struct %image)
2953+ "Generate image: perlin noise"
2954+ (width :int)
2955+ (height :int)
2956+ (offset-x :int)
2957+ (offset-y :int)
2958+ (scale :float))
2959+
2960+;;RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells
2961+(defcfun "GenImageCellular" (:struct %image)
2962+ "Generate image: cellular algorithm. Bigger tileSize means bigger cells"
2963+ (width :int)
2964+ (height :int)
2965+ (tile-size :int))
2966+
2967+;;// Image manipulation functions
2968+;;RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
2969+(defcfun "ImageCopy" (:struct %image)
2970+ "Create an image duplicate (useful for transformations)"
2971+ (image (:struct %image)))
2972+
2973+;;RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
2974+(defcfun "ImageFromImage" (:struct %image)
2975+ "Create an image from another image piece"
2976+ (image (:struct %image))
2977+ (rec (:struct %rectangle)))
2978+
2979+;;RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
2980+(defcfun "ImageText" (:struct %image)
2981+ "Create an image from text (default font)"
2982+ (text :string)
2983+ (font-size :int)
2984+ (color (:struct %color)))
2985+
2986+;;RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
2987+(defcfun "ImageTextEx" (:struct %image)
2988+ "Create an image from text (custom sprite font)"
2989+ (font (:struct %font))
2990+ (text :string)
2991+ (font-size :float)
2992+ (spacing :float)
2993+ (tint (:struct %color)))
2994+
2995+;;RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two)
2996+(defcfun "ImageToPOT" :void
2997+ (image (:pointer (:struct %image)))
2998+ (fill-color (:struct %color)))
2999+
3000+;;RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
3001+(defcfun "ImageFormat" :void
3002+ (image (:pointer (:struct %image)))
3003+ (new-format :int))
3004+
3005+;;RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
3006+(defcfun "ImageAlphaMask" :void
3007+ (image (:pointer (:struct %image)))
3008+ (alpha-mask (:struct %image)))
3009+
3010+;;RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
3011+(defcfun "ImageAlphaClear" :void
3012+ "Clear alpha channel to desired color"
3013+ (image :pointer)
3014+ (color (:struct %color))
3015+ (threshold :float))
3016+
3017+;;RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
3018+(defcfun "ImageAlphaCrop" :void
3019+ "Crop image depending on alpha value"
3020+ (image :pointer)
3021+ (threshold :float))
3022+
3023+;;RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
3024+(defcfun "ImageAlphaPremultiply" :void
3025+ "Premultiply alpha channel"
3026+ (image :pointer))
3027+
3028+;;RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
3029+(defcfun "ImageCrop" :void
3030+ "rop an image to a defined rectangle"
3031+ (image :pointer)
3032+ (crop (:struct %rectangle)))
3033+
3034+;;RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
3035+(defcfun "ImageResize" :void
3036+ "Resize image (Bicubic scaling algorithm)"
3037+ (image :pointer)
3038+ (new-width :int)
3039+ (new-height :int))
3040+
3041+;;RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
3042+(defcfun "ImageResizeNN" :void
3043+ "Resize image (Nearest-Neighbor scaling algorithm)"
3044+ (image :pointer)
3045+ (new-width :int)
3046+ (new-height :int))
3047+
3048+;;RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color
3049+(defcfun "ImageResizeCanvas" :void
3050+ "Resize canvas and fill with color"
3051+ (image :pointer)
3052+ (new-width :int)
3053+ (new-height :int)
3054+ (offset-x :int)
3055+ (offset-y :int)
3056+ (color (:struct %color)))
3057+
3058+;;RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
3059+(defcfun "ImageMipmaps" :void
3060+ "Generate all mipmap levels for a provided image"
3061+ (image :pointer))
3062+
3063+;;RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
3064+(defcfun "ImageDither" :void
3065+ "Dither image data to 16bpp or lower (Floyd-Steinberg dithering)"
3066+ (image :pointer)
3067+ (r-bpp :int)
3068+ (g-bpp :int)
3069+ (b-bpp :int)
3070+ (a-bpp :int))
3071+
3072+;;RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
3073+(defcfun "ImageFlipVertical" :void
3074+ (image (:pointer (:struct %image))))
3075+
3076+;;RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
3077+(defcfun "ImageFlipHorizontal" :void
3078+ (image (:pointer (:struct %image))))
3079+
3080+;;RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
3081+(defcfun "ImageRotateCW" :void
3082+ "Rotate image clockwise 90deg"
3083+ (image :pointer))
3084+
3085+;;RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
3086+(defcfun "ImageRotateCCW" :void
3087+ "Rotate image counter-clockwise 90deg"
3088+ (image :pointer))
3089+
3090+;;RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
3091+(defcfun "ImageColorTint" :void
3092+ (image (:pointer (:struct %image)))
3093+ (color (:struct %color)))
3094+
3095+;;RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
3096+(defcfun "ImageColorInvert" :void
3097+ (image (:pointer (:struct %image))))
3098+
3099+;;RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
3100+(defcfun "ImageColorGrayscale" :void
3101+ (image (:pointer (:struct %image))))
3102+
3103+;;RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
3104+(defcfun "ImageColorContrast" :void
3105+ (image (:pointer (:struct %image)))
3106+ (contrast :float))
3107+
3108+;;RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
3109+(defcfun "ImageColorBrightness" :void
3110+ (image (:pointer (:struct %image)))
3111+ (brightness :int))
3112+
3113+;;RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
3114+(defcfun "ImageColorReplace" :void
3115+ "Modify image color: replace color"
3116+ (image :pointer)
3117+ (color (:struct %color))
3118+ (replace (:struct %color)))
3119+
3120+;;RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); // Extract color palette from image to maximum size (memory should be freed)
3121+(defcfun "ImageExtractPalette" (:pointer (:struct %color))
3122+ "Extract color palette from image to maximum size (memory should be freed)"
3123+ (image (:struct %image))
3124+ (max-palette-size :int)
3125+ (extract-count (:pointer :int)))
3126+
3127+;;RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle
3128+(defcfun "GetImageAlphaBorder" (:struct %rectangle)
3129+ "Get image alpha border rectangle"
3130+ (image (:struct %image))
3131+ (threshold :float))
3132+
3133+;;// Image drawing functions
3134+;;// NOTE: Image software-rendering functions (CPU)
3135+;;RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color
3136+;;RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image
3137+;;RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
3138+;;RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
3139+;;RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
3140+;;RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image
3141+;;RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version)
3142+;;RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image
3143+;;RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version)
3144+;;RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
3145+;;RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
3146+;;RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
3147+;;RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination)
3148+;;RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination)
3149+;;
3150+;;// Texture loading functions
3151+;;// NOTE: These functions require GPU access
3152+;;RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM)
3153+(defcfun "LoadTexture" (:struct %texture)
3154+ "Load texture from file into GPU memory (VRAM)"
3155+ (file-name :string))
3156+
3157+;;RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data
3158+(defcfun "LoadTextureFromImage" (:struct %texture)
3159+ "Load texture from image data"
3160+ (image (:struct %image)))
3161+
3162+;;RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported
3163+(defcfun "LoadTextureCubemap" texture-cubemap
3164+ "Load cubemap from image, multiple image cubemap layouts supported"
3165+ (image (:struct %image))
3166+ (layout-type :int))
3167+
3168+;;RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
3169+(defcfun "LoadRenderTexture" (:struct %render-texture)
3170+ "Load texture for rendering (framebuffer)"
3171+ (width :int)
3172+ (height :int))
3173+
3174+;;RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
3175+(defcfun "UnloadTexture" :void
3176+ "Unload texture from GPU memory (VRAM)"
3177+ (texture (:struct %texture)))
3178+
3179+;;RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
3180+(defcfun "UnloadRenderTexture" :void
3181+ "Unload render texture from GPU memory (VRAM)"
3182+ (target (:struct %render-texture)))
3183+
3184+;;RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
3185+(defcfun "UpdateTexture" :void
3186+ "Update GPU texture with new data"
3187+ (texture (:struct %texture))
3188+ (pixels :pointer))
3189+
3190+;;RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
3191+(defcfun "GetTextureData" (:struct %image)
3192+ "Get pixel data from GPU texture and return an Image"
3193+ (texture (:struct %texture)))
3194+
3195+;;RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot)
3196+(defcfun "GetScreenData" (:struct %image)
3197+ "Get pixel data from screen buffer and return an Image (screenshot)")
3198+
3199+;;// Texture configuration functions
3200+;;RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
3201+(defcfun "GenTextureMipmaps" :void
3202+ (texture (:pointer (:struct %texture))))
3203+
3204+;;RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode
3205+(defcfun "SetTextureFilter" :void
3206+ (texture (:struct %texture))
3207+ (filter-mode :int))
3208+
3209+;;RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode
3210+(defcfun "SetTextureWrap" :void
3211+ (texture (:struct %texture))
3212+ (wrap-mode :int))
3213+
3214+;;// Texture drawing functions
3215+;;RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D
3216+(defcfun "DrawTexture" :void
3217+ (texture (:struct %texture))
3218+ (pos-x :int)
3219+ (pos-y :int)
3220+ (tint (:struct %color)))
3221+
3222+;;RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
3223+(defcfun "DrawTextureV" :void
3224+ (texture (:struct %texture))
3225+ (position (:struct %vector2))
3226+ (tint (:struct %color)))
3227+
3228+;;RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
3229+(defcfun "DrawTextureEx" :void
3230+ (texture (:struct %texture))
3231+ (position (:struct %vector2))
3232+ (rotation :float)
3233+ (scale :float)
3234+ (tint (:struct %color)))
3235+
3236+;;RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
3237+(defcfun "DrawTextureRec" :void
3238+ "Draw a part of a texture defined by a rectangle"
3239+ (texture (:struct %texture))
3240+ (source-rec (:struct %rectangle))
3241+ (position (:struct %vector2))
3242+ (tint (:struct %color)))
3243+
3244+;;RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters
3245+(defcfun "DrawTextureQuad" :void
3246+ "Draw texture quad with tiling and offset parameters"
3247+ (texture (:struct %texture))
3248+ (tiling (:struct %vector2))
3249+ (offset (:struct %vector2))
3250+ (quad (:struct %rectangle))
3251+ (tint (:struct %color)))
3252+
3253+;;RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
3254+(defcfun "DrawTexturePro" :void
3255+ "Draw a part of a texture defined by a rectangle with 'pro' parameters"
3256+ (texture (:struct %texture))
3257+ (source-rec (:struct %rectangle))
3258+ (dest-rec (:struct %rectangle))
3259+ (origin (:struct %vector2))
3260+ (rotation :float)
3261+ (tint (:struct %color)))
3262+
3263+;;RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely
3264+(defcfun "DrawTextureNPatch" :void
3265+ "raws a texture (or part of it) that stretches or shrinks nicely"
3266+ (texture (:struct %texture))
3267+ (patch-info (:struct %patch-info))
3268+ (dest-rec (:struct %rectangle))
3269+ (origin (:struct %vector2))
3270+ (rotation :float)
3271+ (tint (:struct %color)))
3272+
3273+;;// Image/Texture misc functions
3274+;;RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
3275+;;
3276+;;//------------------------------------------------------------------------------------
3277+;;// Font Loading and Text Drawing Functions (Module: text)
3278+;;//------------------------------------------------------------------------------------
3279+;;
3280+;;// Font loading/unloading functions
3281+;;RLAPI Font GetFontDefault(void); // Get the default Font
3282+(defcfun "GetFontDefault" (:struct %font)
3283+ "Get the default Font")
3284+
3285+;;RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
3286+(defcfun "LoadFont" (:struct %font)
3287+ "Load font from file into GPU memory (VRAM)"
3288+ (file-name :string))
3289+
3290+;;RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters
3291+(defcfun "LoadFontEx" (:struct %font)
3292+ "Load font from file with extended parameters"
3293+ (file-name :string)
3294+ (font-size :int)
3295+ (font-chars (:pointer (:int)))
3296+ (chars-count :int))
3297+
3298+;;RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
3299+(defcfun "LoadFontFromImage" (:struct %font)
3300+ "Load font from Image (XNA style)"
3301+ (image (:struct %image))
3302+ (key (:struct %color))
3303+ (first-char :int))
3304+
3305+;;RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use
3306+(defcfun "LoadFontData" :pointer
3307+ "Load font data for further use"
3308+ (file-name :string)
3309+ (font-chars :int)
3310+ (chars-count :int)
3311+ (type :int))
3312+
3313+;;RLAPI Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
3314+;;RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
3315+(defcfun "UnloadFont" :void
3316+ "Unload Font from GPU memory (VRAM)"
3317+ (font (:struct %font)))
3318+
3319+;;// Text drawing functions
3320+;;RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
3321+(defcfun "DrawFPS" :void
3322+ "Shows current FPS"
3323+ (pos-x :int)
3324+ (pos-y :int))
3325+
3326+;;RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
3327+(defcfun "DrawText" :void
3328+ "Draw text (using default font)"
3329+ (text :string)
3330+ (pos-x :int)
3331+ (pos-y :int)
3332+ (font-size :int)
3333+ (color (:struct %color)))
3334+
3335+;;RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
3336+(defcfun "DrawTextEx" :void
3337+ "Draw text using font and additional parameters"
3338+ (font (:struct %font))
3339+ (text :string)
3340+ (position (:struct %vector2))
3341+ (font-size :float)
3342+ (spacing :float)
3343+ (tint (:struct %color)))
3344+
3345+;;RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits
3346+(defcfun "DrawTextRec" :void
3347+ "Draw text using font inside rectangle limits"
3348+ (font (:struct %font))
3349+ (text :string)
3350+ (rec (:struct %rectangle))
3351+ (font-size :float)
3352+ (spacing :float)
3353+ (word-wrap :boolean)
3354+ (tint (:struct %color)))
3355+
3356+;;RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint,
3357+;; int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection
3358+(defcfun "DrawTextRecEx" :void
3359+ "Draw text using font inside rectangle limits with support for text selection"
3360+ (font (:struct %font))
3361+ (text :string)
3362+ (rec (:struct %rectangle))
3363+ (font-size :float)
3364+ (spacing :float)
3365+ (word-wrap :boolean)
3366+ (tint (:struct %color))
3367+ (select-start :int)
3368+ (select-length :int)
3369+ (select-tint (:struct %color))
3370+ (select-back-tint (:struct %color)))
3371+
3372+;;RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float scale, Color tint); // Draw one character (codepoint)
3373+(defcfun "DrawTextCodepoint" :void
3374+ "Draw one character (codepoint)"
3375+ (font (:struct %font))
3376+ (codepoint :int)
3377+ (position (:struct %vector2))
3378+ (scale :float)
3379+ (tint (:struct %color)))
3380+
3381+;;
3382+;;// Text misc. functions
3383+;;RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
3384+(defcfun "MeasureText" :int
3385+ "Measure string width for default font"
3386+ (text :string)
3387+ (font-size :int))
3388+
3389+;;RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
3390+(defcfun "MeasureTextEx" (:struct %vector2)
3391+ (font (:struct %font))
3392+ (text :string)
3393+ (font-size :float)
3394+ (spacing :float))
3395+
3396+;;RLAPI int GetGlyphIndex(Font font, int codepoint); // Get index position for a unicode character on font
3397+(defcfun "GetGlyphIndex" :int
3398+ "Get index position for a unicode character on font"
3399+ (font (:struct %font))
3400+ (codepoint :int))
3401+
3402+;;// Text strings management functions (no utf8 strings, only byte chars)
3403+;;// NOTE: Some strings allocate memory internally for returned strings, just be careful!
3404+;;RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
3405+(defcfun "TextCopy" :int
3406+ "Copy one string to another, returns bytes copied"
3407+ (dst (:pointer :char))
3408+ (src :string))
3409+
3410+;;RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
3411+(defcfun "TextIsEqual" :boolean
3412+ "Check if two text string are equal"
3413+ (text1 :string)
3414+ (text2 :string))
3415+
3416+;;RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
3417+(defcfun "TextLength" :unsigned-int
3418+ "Get text length, checks for '\0' ending"
3419+ (text :string))
3420+
3421+;;RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style)
3422+(defcfun "TextFormat" :string
3423+ "Text formatting with variables (sprintf style)"
3424+ (text :string)
3425+ &rest)
3426+
3427+;;RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
3428+(defcfun "TextSubtext" :string
3429+ "Get a piece of a text string"
3430+ (text :string)
3431+ (position :int)
3432+ (length :int))
3433+
3434+;;RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory must be freed!)
3435+(defcfun "TextReplace" (:pointer :char)
3436+ "Replace text string (memory must be freed!)"
3437+ (text (:pointer :char))
3438+ (replace :string)
3439+ (by :string))
3440+
3441+;;RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory must be freed!)
3442+(defcfun "TextInsert" (:pointer :char)
3443+ "Insert text in a position (memory must be freed!)"
3444+ (text :string)
3445+ (insert :string)
3446+ (position :int))
3447+
3448+;;RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
3449+(defcfun "TextJoin" :string
3450+ "Join text strings with delimiter"
3451+ (text-list (:pointer :string))
3452+ (delimiter :string))
3453+
3454+;;RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
3455+(defcfun "TextSplit" (:pointer :string)
3456+ "Split text into multiple strings"
3457+ (text :string)
3458+ (delimiter :char)
3459+ (count (:pointer :int)))
3460+
3461+;;RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
3462+(defcfun "TextAppend" :void
3463+ "Append text at specific position and move cursor!"
3464+ (text (:pointer :char))
3465+ (append :string)
3466+ (position (:pointer :int)))
3467+
3468+;;RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
3469+(defcfun "TextFindIndex" :int
3470+ "Find first text occurrence within a string"
3471+ (text :string)
3472+ (find :string))
3473+
3474+;;RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string
3475+(defcfun "TextToUpper" :string
3476+ "Get upper case version of provided string"
3477+ (text :string))
3478+
3479+;;RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string
3480+(defcfun "TextToLower" :string
3481+ "Get lower case version of provided string"
3482+ (text :string))
3483+
3484+;;RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
3485+(defcfun "TextToPascal" :string
3486+ "Get Pascal case notation version of provided string"
3487+ (text :string))
3488+
3489+;;RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
3490+(defcfun "TextToInteger" :int
3491+ "Get integer value from text (negative values not supported)"
3492+ (text :string))
3493+
3494+;;RLAPI char *TextToUtf8(int *codepoints, int length); // Encode text codepoint into utf8 text (memory must be freed!)
3495+(defcfun ("TextToUtf8" text-to-utf8) (:pointer :char)
3496+ "Encode text codepoint into utf8 text (memory must be freed!)"
3497+ (codepoints (:pointer :int))
3498+ (length :int))
3499+
3500+;;// UTF8 text strings management functions
3501+;;RLAPI int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters
3502+(defcfun "GetCodepoints" :int
3503+ "Get all codepoints in a string, codepoints count returned by parameters"
3504+ (text :string)
3505+ (count (:pointer :int)))
3506+
3507+;; example
3508+;; (let ((ptr (cffi:foreign-alloc :int)))
3509+;; (raylib:get-codepoints "hello" ptr)
3510+;; (cffi:mem-aref ptr) => 5
3511+
3512+;;RLAPI int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string
3513+(defcfun "GetCodepointsCount" :int
3514+ "Get total number of characters (codepoints) in a UTF8 encoded string"
3515+ (text :string))
3516+
3517+;;RLAPI int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure
3518+(defcfun "GetNextCodepoint" :int
3519+ "Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure"
3520+ (text :string)
3521+ (bytes-processed (:pointer :int)))
3522+
3523+;;RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter)
3524+(defcfun ("CodepointToUtf8" codepoint-to-utf8) :string
3525+ "Encode codepoint into utf8 text (char array length returned as parameter)"
3526+ (codepoint :int)
3527+ (byte-length (:pointer :int)))
3528+
3529+;;
3530+;;//------------------------------------------------------------------------------------
3531+;;// Basic 3d Shapes Drawing Functions (Module: models)
3532+;;//------------------------------------------------------------------------------------
3533+;;
3534+;;// Basic geometric 3D shapes drawing functions
3535+;;RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
3536+(defcfun "DrawLine3D" :void
3537+ (start-pos (:struct %vector3))
3538+ (end-pos (:struct %vector3))
3539+ (color (:struct %color)))
3540+
3541+;;RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
3542+(defcfun "DrawPoint3D" :void
3543+ "Draw a point in 3D space, actually a small line"
3544+ (position (:struct %vector3))
3545+ (color (:struct %color)))
3546+
3547+;;RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
3548+(defcfun "DrawCircle3D" :void
3549+ (position (:struct %vector3))
3550+ (radius :float)
3551+ (rotation-axis (:struct %vector3))
3552+ (rotation-angle :float)
3553+ (color (:struct %color)))
3554+
3555+;;RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
3556+(defcfun "DrawCube" :void
3557+ (position (:struct %vector3))
3558+ (width :float)
3559+ (height :float)
3560+ (length :float)
3561+ (color (:struct %color)))
3562+
3563+;;RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
3564+(defcfun "DrawCubeV" :void
3565+ (position (:struct %vector3))
3566+ (size (:struct %vector3))
3567+ (color (:struct %color)))
3568+
3569+;;RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
3570+(defcfun "DrawCubeWires" :void
3571+ "Draw cube wires"
3572+ (position (:struct %vector3))
3573+ (width :float)
3574+ (height :float)
3575+ (length :float)
3576+ (color (:struct %color)))
3577+
3578+;;RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version)
3579+(defcfun "DrawCubeWiresV" :void
3580+ "Draw cube wires (Vector version)"
3581+ (position (:struct %vector3))
3582+ (size (:struct %vector3))
3583+ (color (:struct %color)))
3584+
3585+;;RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured
3586+(defcfun "DrawCubeTexture" :void
3587+ (texture (:struct %texture))
3588+ (position (:struct %vector3))
3589+ (width :float)
3590+ (height :float)
3591+ (length :float)
3592+ (color (:struct %color)))
3593+
3594+;;RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere
3595+(defcfun "DrawSphere" :void
3596+ "Draw sphere"
3597+ (center-pos (:struct %vector3))
3598+ (radius :float)
3599+ (color (:struct %color)))
3600+
3601+;;RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters
3602+(defcfun "DrawSphereEx" :void
3603+ "Draw sphere with extended parameters"
3604+ (center-pos (:struct %vector3))
3605+ (radius :float)
3606+ (rings :int)
3607+ (slices :int)
3608+ (color (:struct %color)))
3609+
3610+;;RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
3611+(defcfun "DrawSphereWires" :void
3612+ (center-pos (:struct %vector3))
3613+ (radius :float)
3614+ (rings :int)
3615+ (slices :int)
3616+ (color (:struct %color)))
3617+
3618+;;RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
3619+(defcfun "DrawCylinder" :void
3620+ (position (:struct %vector3))
3621+ (radius-top :float)
3622+ (radius-bottom :float)
3623+ (height :float)
3624+ (slices :int)
3625+ (color (:struct %color)))
3626+
3627+;;RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
3628+(defcfun "DrawCylinderWires" :void
3629+ (position (:struct %vector3))
3630+ (radius-top :float)
3631+ (radius-bottom :float)
3632+ (height :float)
3633+ (slices :int)
3634+ (color (:struct %color)))
3635+
3636+;;RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
3637+(defcfun "DrawPlance" :void
3638+ (current-pos (:struct %vector3))
3639+ (size (:struct %vector2))
3640+ (color (:struct %color)))
3641+
3642+;;RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
3643+(defcfun "DrawRay" :void
3644+ (ray (:struct %ray))
3645+ (color (:struct %color)))
3646+
3647+;;RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
3648+(defcfun "DrawGrid" :void
3649+ (slices :int)
3650+ (spacing :float))
3651+
3652+;;RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo
3653+(defcfun "DrawGizmo" :void
3654+ (position (:struct %vector3)))
3655+
3656+;;//DrawTorus(), DrawTeapot() could be useful?
3657+;;
3658+;;//------------------------------------------------------------------------------------
3659+;;// Model 3d Loading and Drawing Functions (Module: models)
3660+;;//------------------------------------------------------------------------------------
3661+;;
3662+;;// Model loading/unloading functions
3663+;;RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials)
3664+(defcfun "LoadModel" (:struct %model)
3665+ "Load model from files (meshes and materials)"
3666+ (file-name :string))
3667+
3668+;;RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material)
3669+(defcfun "LoadModelFromMesh" (:struct %model)
3670+ "Load model from generated mesh (default material)"
3671+ (mesh (:struct %mesh)))
3672+
3673+;;RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM)
3674+(defcfun "UnloadModel" :void
3675+ (model (:struct %model)))
3676+
3677+;;// Mesh loading/unloading functions
3678+;;RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file
3679+(defcfun "LoadMeshes" :pointer
3680+ "Load meshes from model file"
3681+ (file-name :string)
3682+ (mesh-count :int))
3683+
3684+;;RLAPI void ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file
3685+(defcfun "ExportMesh" :void
3686+ "Export mesh data to file"
3687+ (mesh (:struct %mesh))
3688+ (file-name :string))
3689+
3690+;;RLAPI void UnloadMesh(Mesh mesh); // Unload mesh from memory (RAM and/or VRAM)
3691+(defcfun "UnloadMesh" :void
3692+ "Unload mesh from memory (RAM and/or VRAM)"
3693+ (mesh (:struct %mesh)))
3694+
3695+;;// Material loading/unloading functions
3696+;;RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file
3697+(defcfun "LoadMaterials" (:struct %material)
3698+ "Load materials from model file"
3699+ (file-name :string)
3700+ (material-count (:pointer :int)))
3701+
3702+;;RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
3703+(defcfun "LoadMaterialDefault" (:struct %material)
3704+ "Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)")
3705+
3706+;;RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
3707+(defcfun "UnloadMaterial" :void
3708+ "Unload material from GPU memory (VRAM)"
3709+ (material (:struct %material)))
3710+
3711+;;RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)
3712+(defcfun "SetMaterialTexture" :void
3713+ "Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)"
3714+ (material (:struct %material))
3715+ (map-type :int)
3716+ (texture (:struct %texture)))
3717+
3718+;;RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh
3719+(defcfun "SetModelMeshMaterial" :void
3720+ "Set material for a mesh"
3721+ (model (:struct %model))
3722+ (mesh-id :int)
3723+ (material-id :int))
3724+
3725+;;
3726+;;// Model animations loading/unloading functions
3727+;;RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file
3728+(defcfun "LoadModelAnimations" (:struct %model-animation)
3729+ "Load model animations from file"
3730+ (file-name :string)
3731+ (animation-count (:pointer :int)))
3732+
3733+;;RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose
3734+(defcfun "UpdateModelAnimation" :void
3735+ "Update model animation pose"
3736+ (model (:struct %model))
3737+ (anim (:struct %model-animation))
3738+ (frame :int))
3739+
3740+;;RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
3741+(defcfun "UnloadModelAnimation" :void
3742+ "Unload animation data"
3743+ (anim (:struct %model-animation)))
3744+
3745+;;RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
3746+(defcfun "IsModelAnimationValid" :bool
3747+ "Check model animation skeleton match"
3748+ (model (:struct %model))
3749+ (anim (:struct %model-animation)))
3750+
3751+;;
3752+;;// Mesh generation functions
3753+;;RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh
3754+(defcfun "GenMeshPoly" (:struct %mesh)
3755+ "Generate polygonal mesh"
3756+ (sides :int)
3757+ (radius :float))
3758+
3759+;;RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions)
3760+(defcfun "GenMeshPlane" (:struct %mesh)
3761+ "Generate plane mesh (with subdivisions)"
3762+ (width :float)
3763+ (length :float)
3764+ (res-x :int)
3765+ (res-z :int))
3766+
3767+;;RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh
3768+(defcfun "GenMeshCube" (:struct %mesh)
3769+ "Generate cuboid mesh"
3770+ (width :float)
3771+ (height :float)
3772+ (length :float))
3773+
3774+;;RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere)
3775+(defcfun "GenMeshSphere" (:struct %mesh)
3776+ "Generate sphere mesh (standard sphere)"
3777+ (radius :float)
3778+ (rings :int)
3779+ (slices :int))
3780+
3781+;;RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap)
3782+(defcfun "GenMeshHemiSphere" (:struct %mesh)
3783+ "Generate half-sphere mesh (no bottom cap)"
3784+ (radius :float)
3785+ (rings :int)
3786+ (slices :int))
3787+
3788+;;RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh
3789+(defcfun "GenMeshCylinder" (:struct %mesh)
3790+ "Generate cylinder mesh"
3791+ (radius :float)
3792+ (height :float)
3793+ (slices :int))
3794+
3795+;;RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh
3796+(defcfun "GenMeshTorus" (:struct %mesh)
3797+ "Generate torus mesh"
3798+ (radius :float)
3799+ (size :float)
3800+ (rad-seg :int)
3801+ (sides :int))
3802+
3803+;;RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh
3804+(defcfun "GenMeshKnot" (:struct %mesh)
3805+ "Generate trefoil knot mesh"
3806+ (radius :float)
3807+ (size :float)
3808+ (rad-seg :int)
3809+ (sides :int))
3810+
3811+;;RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data
3812+(defcfun "GenMeshHeightmap" (:struct %mesh)
3813+ "Generate heightmap mesh from image data"
3814+ (heightmap (:struct %image))
3815+ (size (:struct %vector3)))
3816+
3817+;;RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data
3818+(defcfun "GenMeshCubicmap" (:struct %mesh)
3819+ "Generate cubes-based map mesh from image data"
3820+ (cubicmap (:struct %image))
3821+ (cube-size (:struct %vector3)))
3822+
3823+;;// Mesh manipulation functions
3824+;;RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
3825+(defcfun "MeshBoundingBox" (:struct %bounding-box)
3826+ "Compute mesh bounding box limits"
3827+ (mesh (:struct %mesh)))
3828+
3829+;;RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
3830+(defcfun "MeshTangents" :void
3831+ "Compute mesh tangents"
3832+ (mesh :pointer))
3833+
3834+;;RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals
3835+(defcfun "MeshBinormals" :void
3836+ "Compute mesh binormals"
3837+ (mesh :pointer))
3838+
3839+;;// Model drawing functions
3840+;;RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
3841+(defcfun "DrawModel" :void
3842+ (model (:struct %model))
3843+ (position (:struct %vector3))
3844+ (scale (:struct %vector3))
3845+ (tint (:struct %color)))
3846+
3847+;;RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
3848+(defcfun "DrawModelEx" :void
3849+ (model (:struct %model))
3850+ (position (:struct %vector3))
3851+ (rotation-axis (:struct %vector3))
3852+ (rotation-angle :float)
3853+ (scale (:struct %vector3))
3854+ (tint (:struct %color)))
3855+
3856+;;RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
3857+(defcfun "DrawModelWires" :void
3858+ (model (:struct %model))
3859+ (position (:struct %vector3))
3860+ (scale (:struct %vector3))
3861+ (tint (:struct %color)))
3862+
3863+;;RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
3864+(defcfun "DrawModelWiresEx" :void
3865+ (model (:struct %model))
3866+ (position (:struct %vector3))
3867+ (rotation-axis (:struct %vector3))
3868+ (rotation-angle :float)
3869+ (scale (:struct %vector3))
3870+ (tint (:struct %color)))
3871+
3872+;;RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
3873+(defcfun "DrawBoundingBox" :void
3874+ (box (:struct %bounding-box))
3875+ (color (:struct %color)))
3876+
3877+;;RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture
3878+(defcfun "DrawBillboard" :void
3879+ (camera (:struct %camera3d))
3880+ (texture (:struct %texture))
3881+ (center (:struct %vector3))
3882+ (size :float)
3883+ (tint (:struct %color)))
3884+
3885+;;RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec
3886+(defcfun "DrawBillboardRec" :void
3887+ (camera (:struct %camera3d))
3888+ (texture (:struct %texture))
3889+ (source-rec (:struct %rectangle))
3890+ (center (:struct %vector3))
3891+ (size :float)
3892+ (tint (:struct %color)))
3893+
3894+;;// Collision detection functions
3895+;;RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres
3896+(defcfun "CheckCollisionSpheres" :bool
3897+ (center-a (:struct %vector3))
3898+ (radius-a :float)
3899+ (center-b (:struct %vector3))
3900+ (radius-b :float))
3901+
3902+;;RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes
3903+(defcfun "CheckCollisionBoxes" :bool
3904+ (box1 (:struct %bounding-box))
3905+ (box2 (:struct %bounding-box)))
3906+
3907+;;RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Detect collision between box and sphere
3908+(defcfun "CheckCollisionBoxSphere" :bool
3909+ (box (:struct %bounding-box))
3910+ (center (:struct %vector3))
3911+ (radius :float))
3912+;;RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius); // Detect collision between ray and sphere
3913+(defcfun "CheckCollisionRaySphere" :bool
3914+ "Detect collision between ray and sphere"
3915+ (ray (:struct %ray))
3916+ (center (:struct %vector3))
3917+ (radius :float))
3918+
3919+;;RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point
3920+(defcfun "CheckCollisionRaySphereEx" :bool
3921+ (ray (:struct %ray))
3922+ (center (:struct %vector3))
3923+ (radius :float)
3924+ (collision-point (:pointer (:struct %vector3))))
3925+
3926+;;RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box
3927+(defcfun "CheckCollisionRayBox" :bool
3928+ (ray (:struct %ray))
3929+ (box (:struct %bounding-box)))
3930+
3931+;;RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); // Get collision info between ray and model
3932+(defcfun "GetCollisionRayModel" (:struct %ray-hit-info)
3933+ "Get collision info between ray and model"
3934+ (ray (:struct %ray))
3935+ (model (:struct %model)))
3936+
3937+;;RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
3938+(defcfun "GetCollisionRayTriangle" (:struct %ray-hit-info)
3939+ "Get collision info between ray and triangle"
3940+ (ray (:struct %ray))
3941+ (p1 (:struct %vector3))
3942+ (p2 (:struct %vector3))
3943+ (p3 (:struct %vector3)))
3944+
3945+;;RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
3946+(defcfun "GetCollisionRayGround" (:struct %ray-hit-info)
3947+ "Get collision info between ray and ground plane (Y-normal plane)"
3948+ (ray (:struct %ray))
3949+ (ground-height :float))
3950+
3951+;;//------------------------------------------------------------------------------------
3952+;;// Shaders System Functions (Module: rlgl)
3953+;;// NOTE: This functions are useless when using OpenGL 1.1
3954+;;//------------------------------------------------------------------------------------
3955+;;
3956+;;// Shader loading/unloading functions
3957+;;RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations
3958+(defcfun "LoadShader" (:struct %shader)
3959+ (vs-file-name :string)
3960+ (fs-file-name :string))
3961+
3962+;;RLAPI Shader LoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations
3963+(defcfun "LoadShaderCode" (:struct %shader)
3964+ "Load shader from code strings and bind default locations"
3965+ (vs-code :pointer)
3966+ (fs-code :pointer))
3967+
3968+;;RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
3969+(defcfun "UnloadShader" :void
3970+ (shader (:struct %shader)))
3971+
3972+;;RLAPI Shader GetShaderDefault(void); // Get default shader
3973+(defcfun "GetShaderDefault" (:struct %shader))
3974+
3975+;;RLAPI Texture2D GetTextureDefault(void); // Get default texture
3976+(defcfun "GetTextureDefault" (:struct %texture))
3977+
3978+;;RLAPI Texture2D GetShapesTexture(void); // Get texture to draw shapes
3979+(defcfun "GetShapesTexture" (:struct %texture)
3980+ "Get texture to draw shapes")
3981+
3982+;;RLAPI Rectangle GetShapesTextureRec(void); // Get texture rectangle to draw shapes
3983+(defcfun "GetShapesTextureRec" (:struct %rectangle)
3984+ "Get texture rectangle to draw shapes")
3985+
3986+;;RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes
3987+(defcfun "SetShapesTexture" :void
3988+ "Define default texture used to draw shapes"
3989+ (texture (:struct %texture))
3990+ (source (:struct %rectangle)))
3991+
3992+;;// Shader configuration functions
3993+;;RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
3994+(defcfun "GetShaderLocation" :int
3995+ "Get shader uniform location"
3996+ (shader (:struct %shader))
3997+ (uniform-name :string))
3998+
3999+;;RLAPI void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType); // Set shader uniform value
4000+(defcfun "SetShaderValue" :void
4001+ "Set shader uniform value"
4002+ (shader (:struct %shader))
4003+ (uniform-loc :int)
4004+ (value :pointer)
4005+ (uniform-type :int))
4006+
4007+;;RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector
4008+(defcfun "SetShaderValueV" :void
4009+ "Set shader uniform value vector"
4010+ (shader (:struct %shader))
4011+ (uniform-loc :int)
4012+ (value :pointer)
4013+ (uniform-type :int)
4014+ (count :int))
4015+
4016+;;RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
4017+(defcfun "SetShaderValueMatrix" :void
4018+ "Set shader uniform value (matrix 4x4)"
4019+ (shader (:struct %shader))
4020+ (uniform-loc :int)
4021+ (mat (:struct %matrix)))
4022+
4023+;;RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture
4024+(defcfun "SetShaderValueTexture" :void
4025+ "Set shader uniform value for texture"
4026+ (shader (:struct %shader))
4027+ (uniform-loc :int)
4028+ (texture (:struct %texture)))
4029+
4030+;;RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
4031+(defcfun "SetMatrixProjection" :void
4032+ (proj (:struct %matrix)))
4033+
4034+;;RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
4035+(defcfun "SetMatrixModelview" :void
4036+ (view (:struct %matrix)))
4037+
4038+;;RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix
4039+(defcfun "GetMatrixModelview" (:struct %matrix)
4040+ "Get internal modelview matrix")
4041+
4042+;;RLAPI Matrix GetMatrixProjection(void); // Get internal projection matrix
4043+(defcfun "GetMatrixProjection" (:struct %matrix)
4044+ "Get internal projection matrix")
4045+
4046+;;// Texture maps generation (PBR)
4047+;;// NOTE: Required shaders should be provided
4048+;;RLAPI Texture2D GenTextureCubemap(Shader shader, Texture2D map, int size); // Generate cubemap texture from 2D texture
4049+(defcfun "GenTextureCubemap" (:struct %texture)
4050+ "Generate cubemap texture from HDR texture"
4051+ (shader (:struct %shader))
4052+ (map (:struct %texture))
4053+ (size :int))
4054+
4055+;;RLAPI Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size); // Generate irradiance texture using cubemap data
4056+(defcfun "GenTextureIrradiance" (:struct %texture)
4057+ "Generate irradiance texture using cubemap data"
4058+ (shader (:struct %shader))
4059+ (cubemap (:struct %texture))
4060+ (size :int))
4061+
4062+;;RLAPI Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size); // Generate prefilter texture using cubemap data
4063+(defcfun "GenTexturePrefilter" (:struct %texture)
4064+ "Generate prefilter texture using cubemap data"
4065+ (shader (:struct %shader))
4066+ (cubemap (:struct %texture))
4067+ (size :int))
4068+
4069+;;RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture
4070+(defcfun "GenTextureBRDF" (:struct %texture)
4071+ "Generate BRDF texture"
4072+ (shader (:struct %shader))
4073+ (size :int))
4074+
4075+;;// Shading begin/end functions
4076+;;RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing
4077+(defcfun "BeginShaderMode" :void
4078+ "Begin custom shader drawing"
4079+ (shader (:struct %shader)))
4080+
4081+;;RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader)
4082+(defcfun "EndShaderMode" :void
4083+ "End custom shader drawing (use default shader)")
4084+
4085+;;RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied)
4086+(defcfun "BeginBlendMode" :void
4087+ "Begin blending mode (alpha, additive, multiplied)"
4088+ (mode :int))
4089+
4090+;;RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
4091+(defcfun "EndBlendMode" :void
4092+ "End blending mode (reset to default: alpha blending)")
4093+
4094+;;// VR control functions
4095+;;RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters
4096+(defcfun "InitVrSimulator" :void
4097+ "Init VR simulator for selected device parameters")
4098+
4099+;;RLAPI void CloseVrSimulator(void); // Close VR simulator for current device
4100+(defcfun "CloseVrSimulator" :void
4101+ "Close VR simulator for current device")
4102+
4103+;;RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera
4104+(defcfun "UpdateVrTracking" :void
4105+ "Update VR tracking (position and orientation) and camera"
4106+ (camera :pointer))
4107+
4108+;;RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters
4109+(defcfun "SetVrConfiguration" :void
4110+ "Set stereo rendering configuration parameters"
4111+ (info (:struct %vr-device-info))
4112+ (distortion (:struct %shader)))
4113+
4114+;;RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready
4115+(defcfun "IsVrSimulatorReady" :bool
4116+ "Detect if VR simulator is ready")
4117+
4118+;;RLAPI void ToggleVrMode(void); // Enable/Disable VR experience
4119+(defcfun "ToggleVrMode" :void
4120+ "Enable/Disable VR experience")
4121+
4122+;;RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering
4123+(defcfun "BeginVrDrawing" :void
4124+ "Begin VR simulator stereo rendering")
4125+
4126+;;RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering
4127+(defcfun "EndVrDrawing" :void
4128+ "End VR simulator stereo rendering")
4129+
4130+;;//------------------------------------------------------------------------------------
4131+;;// Audio Loading and Playing Functions (Module: audio)
4132+;;//------------------------------------------------------------------------------------
4133+;;
4134+;;// Audio device management functions
4135+;;RLAPI void InitAudioDevice(void); // Initialize audio device and context
4136+(defcfun "InitAudioDevice" :void
4137+ "Initialize audio device and context")
4138+
4139+;;RLAPI void CloseAudioDevice(void); // Close the audio device and context
4140+(defcfun "CloseAudioDevice" :void
4141+ "Close the audio device and context")
4142+
4143+;;RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
4144+(defcfun "IsAudioDeviceReady" :boolean
4145+ "Check if audio device has been initialized successfully")
4146+
4147+;;RLAPI void SetMasterVolume(float volume); // Set master volume (listener)
4148+(defcfun "SetMasterVolume" :void
4149+ "Set master volume (listener)"
4150+ (volume :float))
4151+
4152+;;// Wave/Sound loading/unloading functions
4153+;;RLAPI Wave LoadWave(const char *fileName); // Load wave data from file
4154+(defcfun "LoadWave" (:struct %wave)
4155+ "Load wave data from file"
4156+ (file-name :string))
4157+
4158+;;RLAPI Sound LoadSound(const char *fileName); // Load sound from file
4159+(defcfun "LoadSound" (:struct %sound)
4160+ "Load sound from file"
4161+ (file-name :string))
4162+
4163+;;RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
4164+(defcfun "LoadSoundFromWave" (:struct %sound)
4165+ "Load sound from wave data"
4166+ (wave (:struct %wave)))
4167+
4168+;;RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data
4169+(defcfun "UpdateSound" :void
4170+ "Update sound buffer with new data"
4171+ (sound (:struct %sound))
4172+ (data :pointer)
4173+ (samples-count :int))
4174+
4175+;;RLAPI void UnloadWave(Wave wave); // Unload wave data
4176+(defcfun "UnloadWave" :void
4177+ "Unload wave data"
4178+ (wave (:struct %wave)))
4179+
4180+;;RLAPI void UnloadSound(Sound sound); // Unload sound
4181+(defcfun "UnloadSound" :void
4182+ "Unload sound"
4183+ (sound (:struct %sound)))
4184+
4185+;;RLAPI void ExportWave(Wave wave, const char *fileName); // Export wave data to file
4186+(defcfun "ExportWave" :void
4187+ "Export wave data to file"
4188+ (wave (:struct %wave))
4189+ (file-name :string))
4190+
4191+;;RLAPI void ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h)
4192+(defcfun "ExportWaveAsCode" :void
4193+ "Export wave sample data to code (.h)"
4194+ (wave (:struct %wave))
4195+ (file-name :string))
4196+
4197+;;// Wave/Sound management functions
4198+;;RLAPI void PlaySound(Sound sound); // Play a sound
4199+(defcfun "PlaySound" :void
4200+ "Play a sound"
4201+ (sound (:struct %sound)))
4202+
4203+;;RLAPI void StopSound(Sound sound); // Stop playing a sound
4204+(defcfun "StopSound" :void
4205+ "Stop playing a sound"
4206+ (sound (:struct %sound)))
4207+
4208+;;RLAPI void PauseSound(Sound sound); // Pause a sound
4209+(defcfun "PauseSound" :void
4210+ "Pause a sound"
4211+ (sound (:struct %sound)))
4212+
4213+;;RLAPI void ResumeSound(Sound sound); // Resume a paused sound
4214+(defcfun "ResumeSound" :void
4215+ "Resume a paused sound"
4216+ (sound (:struct %sound)))
4217+
4218+;;RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool)
4219+(defcfun "PlaySoundMulti" :void
4220+ "Play a sound (using multichannel buffer pool)"
4221+ (sound (:struct %sound)))
4222+
4223+;;RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool)
4224+(defcfun "StopSoundMulti" :void
4225+ "Stop any sound playing (using multichannel buffer pool)")
4226+
4227+;;RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel
4228+(defcfun "GetSoundsPlaying" :int
4229+ "Get number of sounds playing in the multichannel")
4230+
4231+;;RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
4232+(defcfun "IsSoundPlaying" :bool
4233+ "Check if a sound is currently playing"
4234+ (sound (:struct %sound)))
4235+
4236+;;RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
4237+(defcfun "SetSoundVolume" :void
4238+ "Set volume for a sound (1.0 is max level)"
4239+ (sound (:struct %sound))
4240+ (volume :float))
4241+
4242+;;RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
4243+(defcfun "SetSoundPitch" :void
4244+ "Set pitch for a sound (1.0 is base level)"
4245+ (sound (:struct %sound))
4246+ (pitch :float))
4247+
4248+;;RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
4249+(defcfun "WaveFormat" :void
4250+ "Convert wave data to desired format"
4251+ (wave (:pointer (:struct %wave)))
4252+ (sample-rate :int)
4253+ (sample-size :int)
4254+ (channels :int))
4255+
4256+;;RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
4257+(defcfun "WaveCopy" (:struct %wave)
4258+ "Copy a wave to a new wave"
4259+ (wave (:struct %wave)))
4260+
4261+;;RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
4262+(defcfun "WaveCrop" :void
4263+ "Crop a wave to defined samples range"
4264+ (wave (:pointer (:struct %wave)))
4265+ (init-sample :int)
4266+ (final-sample :int))
4267+
4268+;;RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array
4269+(defcfun "GetWaveData" (:pointer :float)
4270+ "Get samples data from wave as a floats array"
4271+ (wave (:struct %wave)))
4272+
4273+;;// Music management functions
4274+;;RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file
4275+(defcfun "LoadMusicStream" (:struct %music)
4276+ "Load music stream from file"
4277+ (file-name :string))
4278+
4279+;;RLAPI void UnloadMusicStream(Music music); // Unload music stream
4280+(defcfun "UnloadMusicStream" :void
4281+ "Unload music stream"
4282+ (music (:struct %music)))
4283+
4284+;;RLAPI void PlayMusicStream(Music music); // Start music playing
4285+(defcfun "PlayMusicStream" :void
4286+ "Start music playing"
4287+ (music (:struct %music)))
4288+
4289+;;RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming
4290+(defcfun "UpdateMusicStream" :void
4291+ "Updates buffers for music streaming"
4292+ (music (:struct %music)))
4293+
4294+;;RLAPI void StopMusicStream(Music music); // Stop music playing
4295+(defcfun "StopMusicStream" :void
4296+ "Stop music playing"
4297+ (music (:struct %music)))
4298+
4299+;;RLAPI void PauseMusicStream(Music music); // Pause music playing
4300+(defcfun "PauseMusicStream" :void
4301+ "Pause music playing"
4302+ (music (:struct %music)))
4303+
4304+;;RLAPI void ResumeMusicStream(Music music); // Resume playing paused music
4305+(defcfun "ResumeMusicStream" :void
4306+ "Resume playing paused music"
4307+ (music (:struct %music)))
4308+
4309+;;RLAPI bool IsMusicPlaying(Music music); // Check if music is playing
4310+(defcfun "IsMusicPlaying" :bool
4311+ "Check if music is playing"
4312+ (music (:struct %music)))
4313+
4314+;;RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
4315+(defcfun "SetMusicVolume" :void
4316+ "Set volume for music (1.0 is max level)"
4317+ (music (:struct %music))
4318+ (volume :float))
4319+
4320+;;RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
4321+(defcfun "SetMusicPitch" :void
4322+ "Set pitch for a music (1.0 is base level)"
4323+ (music (:struct %music))
4324+ (pitch :float))
4325+
4326+;;RLAPI void SetMusicLoopCount(Music music, int count); // Set music loop count (loop repeats)
4327+(defcfun "SetMusicLoopCount" :void
4328+ "Set music loop count (loop repeats)"
4329+ (music (:struct %music))
4330+ (count :int))
4331+
4332+;;RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
4333+(defcfun "GetMusicTimeLength" :float
4334+ "Get music time length (in seconds)"
4335+ (music (:struct %music)))
4336+
4337+;;RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
4338+(defcfun "GetMusicTimePlayed" :float
4339+ "Get current music time played (in seconds)"
4340+ (music (:struct %music)))
4341+
4342+;;// AudioStream management functions
4343+;;RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data)
4344+(defcfun "InitAudioStream" (:struct %audio-stream)
4345+ "Init audio stream (to stream raw audio pcm data)"
4346+ (sample-rate :unsigned-int)
4347+ (sample-size :unsigned-int)
4348+ (channels :unsigned-int))
4349+
4350+;;RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data
4351+(defcfun "UpdateAudioStream" :void
4352+ "Update audio stream buffers with data"
4353+ (stream (:struct %audio-stream))
4354+ (data :pointer)
4355+ (samples-count :int))
4356+
4357+;;RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory
4358+(defcfun "CloseAudioStream" :void
4359+ "Close audio stream and free memory"
4360+ (stream (:struct %audio-stream)))
4361+
4362+;;RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
4363+(defcfun "IsAudioStreamProcessed" :bool
4364+ "Check if any audio stream buffers requires refill"
4365+ (stream (:struct %audio-stream)))
4366+
4367+;;RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream
4368+(defcfun "PlayAudioStream" :void
4369+ "Play audio stream"
4370+ (stream (:struct %audio-stream)))
4371+
4372+;;RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream
4373+(defcfun "PauseAudioStream" :void
4374+ "Pause audio stream"
4375+ (stream (:struct %audio-stream)))
4376+
4377+;;RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream
4378+(defcfun "ResumeAudioStream" :void
4379+ "Resume audio stream"
4380+ (stream (:struct %audio-stream)))
4381+
4382+;;RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing
4383+(defcfun "IsAudioStreamPlaying" :bool
4384+ "Check if audio stream is playing"
4385+ (stream (:struct %audio-stream)))
4386+
4387+;;RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
4388+(defcfun "StopAudioStream" :void
4389+ "Stop audio stream"
4390+ (stream (:struct %audio-stream)))
4391+
4392+;;RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
4393+(defcfun "SetAudioStreamVolume" :void
4394+ "Set volume for audio stream (1.0 is max level)"
4395+ (stream (:struct %audio-stream))
4396+ (volume :float))
4397+
4398+;;RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
4399+(defcfun "SetAudioStreamPitch" :void
4400+ "Set pitch for audio stream (1.0 is base level)"
4401+ (stream (:struct %audio-stream))
4402+ (pitch :float))
4403+
4404+;;RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
4405+(defcfun "SetAudioStreamBufferSizeDefault" :void
4406+ "Default size for new audio streams"
4407+ (size :int))
4408+
4409+;;//------------------------------------------------------------------------------------
4410+;;// Network (Module: network)
4411+;;//------------------------------------------------------------------------------------
4412+;;
4413+;;// IN PROGRESS: Check rnet.h for reference
4414+;;
4415+;;#if defined(__cplusplus)
4416+;;}
4417+;;#endif
4418+;;
4419+;;#endif // RAYLIB_H
diff -r b30940a5b53e -r f964dff7e1de raylib/util.lisp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/raylib/util.lisp Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,10 @@
1+(in-package #:cl-raylib)
2+
3+(defmethod translate-name-from-foreign ((spec string) (package (eql *package*)) &optional varp)
4+ (let ((name (translate-camelcase-name spec :upper-initial-p t :special-words '("2D" "3D" "FPS" "HSV" "POT" "RES" "TTF" "BRDF" "URL"))))
5+ (if varp (intern (format nil "*~a" name)) name)))
6+
7+(defmethod translate-name-to-foreign ((spec symbol) (package (eql *package*)) &optional varp)
8+ (let ((name (translate-camelcase-name spec :upper-initial-p t :special-words '("2D" "3D" "FPS" "HSV" "POT" "RES" "TTF" "BRDF" "URL"))))
9+ (if varp (subseq name 1 (1- (length name))) name)))
10+
diff -r b30940a5b53e -r f964dff7e1de rulp.lisp
--- a/rulp.lisp Fri Oct 22 12:39:49 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
1-(require :cl-raylib)
2-(load "layers.lisp")
3-(load "grids.lisp")
4-
5-(defvar +layers+ nil)
6-(defvar screen-width 1000)
7-(defvar screen-height 750)
8-(defvar +pointer+ nil)
9-;; Grid is now global, local grid implementation will be done with the scene system
10-(defvar +grid+ (make-instance 'grid
11- :grid-size 70
12- :is-grid-visible t))
13-
14-(defun actor-layers ()
15- "function which get +layers+ and return only the actors in there"
16- (remove-if-not #'(lambda (x) (typep x 'actor-layer)) +layers+))
17-
18-(defun vectorize (a b)
19- "make an array from the two elements"
20- (make-array '(2) :initial-contents (list a b)))
21-
22-;; This function, starting with the x and y position of the mouse, find the actor that is placed in there
23-;; and return the pointer of the special "actor-from-layers" list
24-;; what this does is get the actors from the list with actor-layers
25-;; get a list of the coordinates
26-;; get the mouse position in the actor space
27-;; find the position of the first actor which is in that space
28-;; return the position if there is one or nil if there is none
29-(defun select-pointer (mouse-x mouse-y)
30- (let* ((coordinate-list (map 'list #'(lambda (x) (layer-coordinate x)) (actor-layers)))
31- ; clusterfucked
32- (mouse-on-grid-vec (vectorize (x-to-entity mouse-x +grid+) (y-to-entity mouse-y +grid+)))
33- (return-pointer (position-if #'(lambda (x) (compare x mouse-on-grid-vec)) coordinate-list)))
34- return-pointer))
35-
36-;; this transform the mouse position in actor position, and change the selected actor position here
37-(defun move-actor (mouse-x mouse-y)
38- (let* ((mouse-on-grid-vec (vectorize (x-to-entity mouse-x +grid+) (y-to-entity mouse-y +grid+))))
39- (setf (layer-coordinate (nth +pointer+ (actor-layers))) mouse-on-grid-vec)))
40-
41-#|
42-Layer render implementation with raylib
43-They are here as this is the file with the
44-raylib imported, also this makes the layer
45-file easy to convert in another implementations
46-|#
47-(defmethod render-grid ()
48- (when (is-grid-visible +grid+)
49- (let* ((span (grid-size +grid+))
50- (horizontal-lines (floor (/ screen-width span)))
51- (vertical-lines (floor (/ screen-height span))))
52- (loop for i from 1 to horizontal-lines
53- do (raylib:draw-line (* i span) 0 (* i span) screen-height raylib:+lightgray+))
54- (loop for j from 1 to vertical-lines
55- do (raylib:draw-line 0 (* j span) screen-width (* j span) raylib:+lightgray+))
56- )))
57-
58-(defmethod render ((object layer))
59- (raylib:draw-rectangle (l-x object) (l-y object) 20 20 raylib:+black+))
60-
61-(defmethod render ((object image-layer))
62- (if (null (image-mipmap object))
63- (setf (slot-value object 'image-mipmap) (raylib:load-texture (image-source object)))
64- (raylib:draw-texture (image-mipmap object) (l-x object) (l-y object) raylib:+raywhite+)))
65-
66-;; this render method doesn't resize images, it has to be implemented here or somewhere else
67-;; so it is not necessary to manually resize images to fit in here
68-(defmethod render ((object entity-layer))
69- (if (null (image-mipmap object))
70- (setf (slot-value object 'image-mipmap) (raylib:load-texture (image-source object)))
71- (raylib:draw-texture (image-mipmap object)
72- (x-to-grid (l-x object) +grid+)
73- (y-to-grid (l-y object) +grid+)
74- raylib:+raywhite+)))
75-
76-
77-;(defmethod render ((object entity-layer))
78-; (let* ((span (grid-layer-span (entity-layer-grid object)))
79-; (dimension (* span (entity-layer-size object))))
80-; (if (null (image-mipmap object))
81-; (let* ((temp-img (raylib:load-image (image-source object)))
82-; (temp-img-res (raylib:image-resize 'temp-img dimension dimension)))
83-; (setf (slot-value object 'image-mipmap)
84-; (raylib:load-texture-from-image temp-img-res))
85-; (raylib:unload-image temp-img-res)
86-; (raylib:unload-image temp-img)))
87-; (raylib:draw-texture (image-mipmap object)
88-; (* span (l-x object))
89-; (* span (l-y object))
90-; raylib:+raywhite+)))
91-
92-(defmethod render ((object actor-layer))
93- (if (null (image-mipmap object))
94- (setf (slot-value object 'image-mipmap) (raylib:load-texture (image-source object)))
95- (raylib:draw-texture (image-mipmap object)
96- (x-to-grid (l-x object) +grid+)
97- (y-to-grid (l-y object) +grid+)
98- raylib:+raywhite+))
99- (let* ((grid-span (grid-size +grid+)) ; to simplify
100- (x-position (x-to-grid (l-x object) +grid+))
101- (y-position (y-to-grid (l-y object) +grid+))
102- (y-position-bottom (y-to-grid (+ 1 (l-y object)) +grid+)))
103- ;; Draw the name box
104- (raylib:draw-rectangle x-position (- y-position-bottom 15) grid-span 15 raylib:+raywhite+)
105- (raylib:draw-text (entity-name object) x-position (- y-position-bottom 15) 15 raylib:+black+)))
106-
107-#|
108-End render section
109-|#
110-
111-; This function should blank the screen and then eval/apply the s-expression put in the input.
112-(defun playground ()
113- (raylib:with-drawing
114- (raylib:clear-background raylib:+raywhite+)
115-; (raylib:draw-texture board 0 0 raylib:+raywhite+)
116- (raylib:draw-text "Ru*** Lisp Playground" 400 365 20 raylib:+lightgray+)
117- (map 'list #'render +layers+)
118- (render-grid)
119- (raylib:draw-fps 20 20)
120- ;; Draw pointer
121- (when (numberp +pointer+)
122- ;; !! Reduce these let* around the code
123- (let* ((actors-from-layers (remove-if-not #'(lambda (x) (typep x 'actor-layer)) +layers+))
124- (actor-to-select (nth +pointer+ actors-from-layers))
125- (actor-x (l-x actor-to-select))
126- (actor-y (l-y actor-to-select))
127- (actor-size (entity-layer-size actor-to-select))
128- (span (grid-size +grid+)))
129- ;; Grammar to resolve, remove all the (* grid _) in the draw below
130- (raylib:draw-rectangle-lines (x-to-grid actor-x +grid+) (y-to-grid actor-y +grid+) (* span actor-size) (* span actor-size) raylib:+red+)
131- ))))
132-
133-(defun main ()
134- (load "blank.lisp" :if-does-not-exist nil)
135- (defvar mouse-position nil)
136- (raylib:with-window (screen-width screen-height "Ru■■■ Lisp Playground")
137- (raylib:set-target-fps 90)
138- (loop
139- (setf mouse-position (raylib:get-mouse-position)) ;; this is a structure (defstruct vector2 x y)
140- (cond ((raylib:window-should-close)(return))
141- ;; !! this is detected every frame, you have to make separate section that detect only
142- ;; once every few frames (now is not possible to implement grid modifier options)
143- ((raylib:is-mouse-button-pressed raylib:+mouse-left-button+)
144- (setf +pointer+ (select-pointer (raylib:vector2-x mouse-position) (raylib:vector2-y mouse-position))))
145- ((raylib:is-mouse-button-pressed raylib:+mouse-right-button+)
146- (if (numberp +pointer+) ;; here you add the right mouse action when nothing is selected
147- (move-actor (raylib:vector2-x mouse-position) (raylib:vector2-y mouse-position)))))
148- (playground)
149- ))
150- (quit))
151-
152-(main)
diff -r b30940a5b53e -r f964dff7e1de rulp_text.png
Binary file rulp_text.png has changed
diff -r b30940a5b53e -r f964dff7e1de system.asd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/system.asd Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,34 @@
1+(asdf:defsystem "rulp"
2+ :description "Ru*** roLeplay Playground: a D&D/Pathfinder style digital table"
3+ :version "0.0.0"
4+ :author "Zull"
5+ :licence "GPLv3"
6+ :build-operation "program-op"
7+ :build-pathname "rulp"
8+ :entry-point "core:main"
9+ :depends-on ("cffi-libffi" "alexandria" "ltk" "bordeaux-threads" "bt-semaphore")
10+ :components ((:module "raylib"
11+ :serial t
12+ :components ((:file "package")
13+ (:file "library")
14+ (:file "util")
15+ (:file "raylib")
16+ (:file "macro")))
17+ (:module "layers"
18+ :depends-on ("raylib")
19+ :serial t
20+ :components ((:file "package")
21+ (:file "planes")
22+ (:file "entities")))
23+ (:module "lobby"
24+ :serial t
25+ :components ((:file "package")
26+ (:file "main")))
27+ (:module "graphics"
28+ :depends-on ("raylib")
29+ :components ((:file "package")
30+ (:file "inputs" :depends-on ("package"))
31+ (:file "render" :depends-on ("package"))
32+ (:file "grid" :depends-on ("package"))
33+ (:file "view" :depends-on ("package" "grid" "render" "inputs"))))
34+ (:file "core" :depends-on ("layers" "lobby" "graphics"))))
diff -r b30940a5b53e -r f964dff7e1de test.png
Binary file test.png has changed
diff -r b30940a5b53e -r f964dff7e1de tools/debian_control
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/debian_control Sun Apr 10 01:53:45 2022 +0200
@@ -0,0 +1,5 @@
1+Package: RuLP
2+Version: 0.0.1
3+Architecture: amd64
4+Mantainer: Zull
5+Description: Virtual programmable tabletop
Show on old repository browser