flat assembler
Message board for the users of flat assembler.

Index > Linux > GUI programming

Author
Thread Post new topic Reply to topic
binary108



Joined: 03 Apr 2004
Posts: 7
Location: Russia
binary108 03 Apr 2004, 19:30
How can i write code for x-server?
How to link my program with gui libraries?
And how to create seample window?
Thanks
Post 03 Apr 2004, 19:30
View user's profile Send private message Reply with quote
The dead



Joined: 27 Jan 2004
Posts: 13
The dead 04 Apr 2004, 11:20
i think you need gcc to do that
Post 04 Apr 2004, 11:20
View user's profile Send private message ICQ Number Reply with quote
zenek_tm



Joined: 21 Mar 2004
Posts: 33
Location: Poland
zenek_tm 04 Apr 2004, 13:59
In fasm for linux there is an example of linking fasm code with c library using gcc. It should be possible to do the same thing with other libraries like gtk.
Post 04 Apr 2004, 13:59
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 04 Apr 2004, 16:22
Since the examples section of this website is still not done, please look at the archive of old site: http://fasm.sourceforge.net/archive/oldsite/ - in the examples section there is package of GTK programming examples by bazik.
Post 04 Apr 2004, 16:22
View user's profile Send private message Visit poster's website Reply with quote
binary108



Joined: 03 Apr 2004
Posts: 7
Location: Russia
binary108 04 Apr 2004, 20:06
Thanks!
Post 04 Apr 2004, 20:06
View user's profile Send private message Reply with quote
Shakain



Joined: 08 May 2004
Posts: 3
Shakain 08 May 2004, 23:42
Hi. I am new to the group. I am totally ignorant of Linux. But I like to be able to programm in it so its time to start removing some of that ignorance. I downloaded FASM. My project is to program GUI applications, using XFree. Or XLib, whatever its name is. Thats is program GUI at the lowest possible level. Remember I know NADA of linux. I just got logged in so to say.

1) Is linux protected from hardware like Widnows? Does it have a GDI kind of interface ? Or is it possible to draw directly to the screen ? I guess so since it has OGL stuff ?
2) Whats the minimum I need to know. How can I say output a pixel or a line ?

I be very happy with good links.

Thank you.

_________________
Hi guys Very Happy
Post 08 May 2004, 23:42
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 09 May 2004, 16:27
1) GDI, well, if you consider GTK (and such) and GDI layer, yes.
2) I'm a afraid quite a bit, unless you're just looking for an example app to cut 'n' paste.

I'm currently trying to learn much of linux programming (in general and (f)asm), for the moment I think the easiest way is to learn the programming way in C (or C++, as they are the biggest languages, and in which you fins the most documentatio/examples) for linux then port it to fasm Smile

the lowser level I think would be speaking with the X server directly, not sure how to do that, but it sure must be possible -- how would any gfx work if so wasn't the case? Smile
Post 09 May 2004, 16:27
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 10 May 2004, 02:28
Shakain,

I suggest to stick either to GTK or QT because low level programming of X is an amazing challenge.
Post 10 May 2004, 02:28
View user's profile Send private message Yahoo Messenger Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 10 May 2004, 09:14
Shakain,

Hi. I am new to the group. I am totally ignorant of Linux. But I like to be able to programm in it so its time to start removing some of that ignorance. I downloaded FASM. My project is to program GUI applications, using XFree. Or XLib, whatever its name is. Thats is program GUI at the lowest possible level. Remember I know NADA of linux. I just got logged in so to say.

1) Is linux protected from hardware like Widnows? Does it have a GDI kind of interface ? Or is it possible to draw directly to the screen ? I guess so since it has OGL stuff ?

Linux doesn't allow easy access to the hardware. To do any real GUI programming, you'll need to use xlib, or Gtk, or Qt, or some of the simpler solutions like SVGALIB and libSDL. Using the last two, I have some examples in RetroForth 6.25.2 (http://download.retroforth.org/retroforth-6.25.2.tar.gz). The two graphical versions are written in NASM, but it shouldn't be too difficult to port them over to FASM.

2) Whats the minimum I need to know. How can I say output a pixel or a line ?

As mentioned by others, quite a bit. It really comes down to the libraries you choose to link with. If you just want to draw things on the screen, you can't beat SVGALIB. It's small, and easy to work with. It does have the disadvantage of not always playing nicely with X11 though. libSDL is a slightly more complex option, but it's also manageable.

I really should make a lightweight graphics library for SVGALIB/libSDL and FASM for those wanting to do basic graphical programming under Linux. Maybe I'll give it a try later this month.
Post 10 May 2004, 09:14
View user's profile Send private message Visit poster's website Reply with quote
Todd



Joined: 05 Oct 2003
Posts: 10
Location: US
Todd 25 May 2004, 23:18
If you really want to get into low-level graphics programming in X, than I'd suggest reading this tutorial. It explains fairly well how an X server works, how to use it, and it gives the command to link to the X libraries with GCC and some tutorials in C code. Although, I think you would have more luck learning GTK, and I think there's even some Fasm GTK tutorials around here somewhere.

As for drawing directly to the screen, I would recommend SDL. It's really not too hard to learn and it provides an interface for OpenGL too.

(Edit): By the way, I put together a little demo in SDL that might be helpful to you. It's commented, but it should be easy enough to understand. It's just a black screen with a red square bouncing around, but it shows how to do several other things as well.

Click Here to Download (8.0k)
Post 25 May 2004, 23:18
View user's profile Send private message Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9 17 Jun 2004, 13:11
IMHO, x11/x* is not fit for FASM. it's not FASM-style. And Linux is not ready for fasm.
Linux at GUI needs 10 years.
gnome? what is gnome? kde? what is kde? xfce/X.org? what is the...?

--
Debian:~#sr freshmeat opengui


Last edited by fasm9 on 16 Jul 2004, 10:57; edited 1 time in total
Post 17 Jun 2004, 13:11
View user's profile Send private message Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 17 Jun 2004, 21:03
X11 is a pain to program for in any language. If you need to run programs under X11, either use a toolkit (GTK is probably the easiest of the well-known toolkits) or SDL. Even then, the API's used are geared towards C/C++, not assembly. One of these days, I'll release the graphics library I've been working on (SDL and SVGALIB backends).

There is little to no code in the Linux (and *nix) or Windows worlds that is really fasm-style. Almost everything is geared towards C/C++. It's a shame that we have to go through bloated C/C++ libraries/dll's to do work well with most of today's OSes.

Quote:
linux at GUI needs 10 years.
gnome? what is gnome? kde? what is kde? xfce/X.org? what is the...?


Linux + GUO does not need 10 years. They need to rethink their approach and start fresh. I'm sick of emulating Windows/MacOS in the look and feel. I'm sick of big, bloated libraries. I'm sick of all the bloatware. For those times when a GUI is needed, just make it as small and simple as possible. Hopefully some of the promising hobby OSes don't fall into this trap.

_________________
Charles Childers, Programmer
Post 17 Jun 2004, 21:03
View user's profile Send private message Visit poster's website Reply with quote
Sasha



Joined: 17 Nov 2011
Posts: 93
Sasha 20 Jul 2012, 22:23
crc wrote:
Hopefully some of the promising hobby OSes don't fall into this trap.


MenuetOS ?
Post 20 Jul 2012, 22:23
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.