Running "allegro game library" within NewLisp?

Started by molniya345, January 08, 2021, 09:16:24 AM

Previous topic - Next topic

molniya345

Goodday to eveyone.

Could anyone please explain me and help step by step on how to bind "allegro game library" dll-s to newlisp? Here: https://liballeg.org/">https://liballeg.org/

Well, not really "to bind" it, but just to load some functions one by one during coding progress. Which exactly dll-s and functions I have to import? Obviously the mainest one, for a beginning, at least. But... I tried to import for example "al_init" function from "alleg40.dll" but it gave me error that "al_init" function is not found. I've tried different dll-s but the error is same. I skimmed the documentation, both on liballegro and newlisp, but it didn't help much. Or maybe there is somewhere better simple library than liballegro? I need it for making simple 2d games.



Please consider this (not necessary to read, but...): I am not programmer, though I've tried once be become programmer. I have somewhat unusual head, so I can't get to other languages than Lisp. I simply cannot understand them fully (or maybe that's partly because I haven't found a great book on the subject, though I really hardly tried to find one). Also I'm very stubborn person and I have browsed really huge amount of information before I found and appreciated such a thing as Lisp. I know just a little about basic coding concepts and little experience with coding, though I don't need extra explanations of what a byte or loop is or and even what assembly language is. Actually I never used iterational style in Lisp, I always coded procedures with recursion, simply because I like this way and hardly understand the opposite. Also I like Lisp because I need(-ed) to get a simple tool, something that fits "alright" to and not-too-hard for my artistic perception, and also it must be a minimalistic tool for writing programs, a tool that helps to concentrate on ideas rather than on qeasy flow of numbers. Otherwise I could not handle programming at all.



Also, if you'll answer something, please try to avoid slang because I am not very good in engish language. Also I am not good with math... but sometimes that doesn't matter much.



I hope for heart understanding.



P.S. I am from Ukraine.

newBert

#1
First, you need to understand how the function http://www.newlisp.org/downloads/newlisp_manual.html#import">import works. And see some examples where it is used, like http://www.newlisp.org/syntax.cgi?code/opengl-demo-ffi-lsp.txt">here for instance (see especially the first part with the 'import' and the 'constant'). Then after recovering all the functions from Allegro, the rest is a work of patience, a little repetitive, to create a module that can be used by programs.
<r><I>>Bertrand<e></e></I> − <COLOR color=\"#808080\">><B>newLISP<e></e></B> v.10.7.6 64-bit <B>>on Linux<e></e></B> (<I>>Linux Mint 20.1<e></e></I>)<e></e></COLOR></r>