1. question about liballeg.a
- Posted by bernie Sep 16, 2008
- 987 views
There is an allegro library in the source code called liballeg.a
I would like to know the following.
1. Where is the source that created this library ?
2. Where is the "C" header file for this library ?
3. What specific functions does it contain ?
2. Re: question about liballeg.a
- Posted by mattlewis (admin) Sep 16, 2008
- 1016 views
There is an allegro library in the source code called liballeg.a. I would like to know the following.
Looks like it's part of/included with DJGPP. From be_w.c:
#ifdef EDJGPP #include <pc.h> #include <sys/farptr.h> #include <dpmi.h> #include <go32.h> #include <allegro.h> #else
Matt
3. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 987 views
There is an allegro library in the source code called liballeg.a. I would like to know the following.
Looks like it's part of/included with DJGPP. From be_w.c:
#ifdef EDJGPP #include <pc.h> #include <sys/farptr.h> #include <dpmi.h> #include <go32.h> #include <allegro.h> #else
Matt:
I looked it up in DJGPP and it says this:
All the Allegro functions, variables, and data structures are defined in
allegro.h. You should include this in your programs, and link with
liballeg.a.
My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.
4. Re: question about liballeg.a
- Posted by mattlewis (admin) Sep 16, 2008
- 972 views
I looked it up in DJGPP and it says this:
All the Allegro functions, variables, and data structures are defined in
allegro.h. You should include this in your programs, and link with
liballeg.a.
My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.
Sounds good. Get on it.
Matt
5. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 1018 views
I vaguely remember that someone had written a library called eu_engine or somesuch that wrapped svgalib on linux and allows graphics support through that.
That should still work. A better option would be a port of eu_engine to run under graphapp or EuGTK to allow simulating graphics functions with X11.
My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.
Sounds good. Get on it.
Matt
6. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 1169 views
I vaguely remember that someone had written a library called eu_engine or somesuch that wrapped svgalib on linux and allows graphics support through that.
That should still work. A better option would be a port of eu_engine to run under graphapp or EuGTK to allow simulating graphics functions with X11.
My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.
Sounds good. Get on it.
Matt
Jim:
I wrote eu_engine
The svgalib is no longer supported.
I already have written pure euphoria code and tested it to run directly
( without using third-party code ) in the Linux-Frame buffer.
The only problem I have now is not having frame-buffer mouse support.
7. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 1036 views
The only problem I have now is not having frame-buffer mouse support.
What's the problem with doing: integer h = open("/dev/mice", "r") ?! or "/dev/psaux", etc?
That should still work. A better option would be a port of eu_engine to run under graphapp or EuGTK to allow simulating graphics functions with X11.
I still maintain that this is a nice option to have.
8. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 1038 views
The only problem I have now is not having frame-buffer mouse support.
What's the problem with doing: integer h = open("/dev/mice", "r") ?! or "/dev/psaux", etc?
Because that gives you the GPM mouse which doesn't seem to work
in frame-buffer mode.
Incidentally my motor library will run X11, Motif, Xt, Athena euphoria
code but they require a lot of work to write a program.
9. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 939 views
The only problem I have now is not having frame-buffer mouse support.
What's the problem with doing: integer h = open("/dev/mice", "r") ?! or "/dev/psaux", etc?
Because that gives you the GPM mouse which doesn't seem to work
in frame-buffer mode.
What?!
/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.
GPM works (or used to work) by opening /dev/psaux (or whatever device pointed to the mouse) in a daemon process and then allowed client applications to get mouse events by reading a fifo named /dev/gpmctl.
Incidentally my motor library will run X11, Motif, Xt, Athena euphoria
code but they require a lot of work to write a program.
If all you need are graphics primitives, I do not see why this is so much work (other than to create the initial window to draw on).
10. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 990 views
The only problem I have now is not having frame-buffer mouse support.
What?!
/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.
GPM works (or used to work) by opening /dev/psaux (or whatever device pointed to the mouse) in a daemon process and then allowed client applications to get mouse events by reading a fifo named /dev/gpmctl.
What I think you are forgeting is those are all compiled dlls or compiled
programs or special fbdev's ; not euphoria code.
When you are using the frame-buffer the X11 server is shutdown.
11. Re: question about liballeg.a
- Posted by mattlewis (admin) Sep 16, 2008
- 942 views
/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.
On Kubuntu, I can get /dev/input/mice, though it requires root to read.
Matt
12. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 966 views
/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.
GPM works (or used to work) by opening /dev/psaux (or whatever device pointed to the mouse) in a daemon process and then allowed client applications to get mouse events by reading a fifo named /dev/gpmctl.
What I think you are forgeting is those are all compiled dlls or compiled
programs or special fbdev's ; not euphoria code.
[/quote]
This comment makes no sense in regard to /dev/psaux or /dev/mice. Those are just regular device files, so in theory you can use getc() and puts() to control them. (For the cases where you can not, you may need to wrap C code to handle ioctl() and read()/write() or write assembly code to make the syscalls into the linux kernel directly.)
For X11, GTK, etc... this is true in that you need to wrap the compiled dlls and call C code from Eu. However, Irv Mullins has already wrapped the minimum you should need to use GTK, so you can just use his euphoria code to make the graphics functions work on linux/X11.
(Technically, you can do X11 programming entirely in euphoria just using socket calls, by working at the X11 network protocol level, and remove Xlib out of the picture entirely.)
When you are using the frame-buffer the X11 server is shutdown.
I assume you mean that having an X11 server running won't help you access the mouse in a framebuffer program. While you can in fact have both running at the same time, you can use only one at a time, so controling the mouse from the X server would be greatly impractial here.
If I assume correctly, then you are right. However, direct access to /dev/psaux or /dev/mice should work for a framebuffer app.
13. Re: question about liballeg.a
- Posted by mattlewis (admin) Sep 16, 2008
- 953 views
/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.
On Kubuntu, I can get /dev/input/mice, though it requires root to read.
FYI, here was my code:
integer m = open( "/dev/input/mice", "r" ) while 1 do ? getc(m) end while
Matt
14. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 942 views
SVGAlib required suid-root to work. I believe direct framebuffer access also has permission restrictions on the actual device files (/dev/fb0 ?)
So, this is really expected behavior.
On Kubuntu, I can get /dev/input/mice, though it requires root to read.
FYI, here was my code:
integer m = open( "/dev/input/mice", "r" ) while 1 do ? getc(m) end while
Matt
15. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 972 views
(Technically, you can do X11 programming entirely in euphoria just using socket calls, by working at the X11 network protocol level, and remove Xlib out of the picture entirely.)
I assume you mean that having an X11 server running won't help you access the mouse in a framebuffer program. While you can in fact have both running at the same time, you can use only one at a time, so controling the mouse from the X server would be greatly impractial here.
Yes
If I assume correctly, then you are right. However, direct access to /dev/psaux or /dev/mice should work for a framebuffer app.
Please show me the euphoria code needed to
use these devices in a frame-buffer.
I am using the standard frame-buffer that is built-in to the
a 2.6 Linux kernel
16. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 963 views
If I assume correctly, then you are right. However, direct access to /dev/psaux or /dev/mice should work for a framebuffer app.
Please show me the euphoria code needed to
use these devices in a frame-buffer.
I am using the standard frame-buffer that is built-in to the
a 2.6 Linux kernel
Matt Lewis already demonstrated the beginnings of such code.
From there you just need to figure out what protocol the device is using (PS/2, Busmouse, Serial, IMPS/2, etc) and then interpret the datastream as retrieved by getc().
17. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 967 views
/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.
On Kubuntu, I can get /dev/input/mice, though it requires root to read.
FYI, here was my code:
integer m = open( "/dev/input/mice", "r" ) while 1 do ? getc(m) end while
Matt:
Are you running it in a frame-buffer ?
How do you use that to turn on\off the mouse pointer ?
What should you expect for input from getc(m) ?
18. Re: question about liballeg.a
- Posted by mattlewis (admin) Sep 16, 2008
- 947 views
Matt:
Are you running it in a frame-buffer ?
How do you use that to turn on\off the mouse pointer ?
What should you expect for input from getc(m) ?
I wasn't running it in a frame buffer, but I don't think it would make a difference. I don't think that /dev/input/mice is provided by X or anything. It's coming from the kernel, so I don't see why you shouldn't be able to read it the same way. I could be wrong, of course, but have you taken a look inside dev? I just did some ls-ing around, found input, under which I had mice, mouse0, mouse1 and mouse2.
I don't know anything about what the data means, but it printed a lot of stuff as I moved the mouse around, so it shouldn't be too difficult to figure out what it's doing. I have no idea how to turn on the cursor.
Matt
19. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 962 views
Matt:
Are you running it in a frame-buffer ?
How do you use that to turn on\off the mouse pointer ?
What should you expect for input from getc(m) ?
I wasn't running it in a frame buffer, but I don't think it would make a difference. I don't think that /dev/input/mice is provided by X or anything. It's coming from the kernel, so I don't see why you shouldn't be able to read it the same way. I could be wrong, of course, but have you taken a look inside dev? I just did some ls-ing around, found input, under which I had mice, mouse0, mouse1 and mouse2.
I don't know anything about what the data means, but it printed a lot of stuff as I moved the mouse around, so it shouldn't be too difficult to figure out what it's doing. I have no idea how to turn on the cursor.
Matt:
/dev/mouse are used for syslinks pointing different mouse devices.
GPM mouse was used in Eu past but that only worked when running in
text console.
I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.
20. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 1000 views
- Last edited Sep 17, 2008
/dev/mouse are used for syslinks pointing different mouse devices.
Correct, but /dev/input/mice is not.
crw-rw-- 1 root root 13, 63 2008-08-15 08:00 /dev/input/mice
It is a device that reports the movements of all non-absolute mice attached to the system.
GPM mouse was used in Eu past but that only worked when running in
text console.
In other words, eu 2.2 would not be able to use the mouse from linux framebuffer either (at least not via get_mouse() ) ?
I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.
What is Cee?
21. Re: question about liballeg.a
- Posted by bernie Sep 16, 2008
- 936 views
- Last edited Sep 17, 2008
GPM mouse was used in Eu past but that only worked when running in
text console.
In other words, eu 2.2 would not be able to use the mouse from linux framebuffer either (at least not via get_mouse() ) ?
Thats correct it only worked in the text console/terminal.
Remember it used GPM and curses.
I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.
What is Cee?
My abbreviation for "the C Language"
22. Re: question about liballeg.a
- Posted by jimcbrown (admin) Sep 16, 2008
- 971 views
- Last edited Sep 17, 2008
I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.
What is Cee?
My abbreviation for "the C Language"
If you can give me working C code for that, I can give you working euphoria code that will provide the exact same functionality. The only issue I had was not being familiar enough with the PS/2 protocol.