flat assembler
Message board for the users of flat assembler.
Index
> Linux > windowsAPI linux equivalent |
Author |
|
JohnFound 14 May 2011, 12:40
Most of Linux distributions (and almost all other Unixes) uses XWindow client/server interface for GUI. It is flexible but really slow system that uses a lot of machine resources only in order to transfer a some bunch of strings back and forth. The idea of this approach is that the application, using network layer, sends GUI commands to the X server. The server interprets these commands and creates/manipulates needed windows.
The X protocol is pretty complex, so most of the applications don't communicate with the server directly, but use some library, that provides functions or objects based API. Unfortunately all these libraries are C-centric with all HLL drawbacks. If we are talking about low level API (similar to Win32 API) there are only 2 viable alternatives - XLib and XCB. XCB is newest and probably fastest, but it was never supposed to be used directly, so it have really inconvenient interface and almost total lack of reference materials. XLib is the another library accessible - it have more "human-centric design" and more reference information (examples, etc.) There is also assembly written AsmLibX. It is NASM project (on sourceforge) but the project is abandoned and I was never able to run application that use AsmLibX. Another approach is to use some HLL "widget toolkit" like GTK or Qt or any other (there are many of them) but all they are overbloated HLL monsters and IMHO should be avoided in assembly programming. |
|||
14 May 2011, 12:40 |
|
edfed 22 Jul 2011, 02:23
then, there is no good way to do graphic programming under linux?
can opengl be used as under windows? in that case, we have a common interface simple enough to become a good basis for a graphic programming framework. |
|||
22 Jul 2011, 02:23 |
|
bitshifter 22 Jul 2011, 02:31
< can opengl be used as under windows?
Yep, and Mesa is open source too! |
|||
22 Jul 2011, 02:31 |
|
JohnFound 22 Jul 2011, 09:11
edfed wrote: then, there is no good way to do graphic programming under linux? You can use OpenGL, but you still need some widget toolkit to make the GUI. AFAIK, there are some widget toolkits based on OpenGL, but they are still overbloated. XLib really looks most suitable for assembly programming. Well, at least I choose it for FreshLib linux port, after some tests of XCB and AsmLibX. |
|||
22 Jul 2011, 09:11 |
|
r22 22 Jul 2011, 16:36
* completely useless suggestion, but could be interesting/funny *
1- On program start switch to an empty desktop 2- Render your UI to a BMP and switch to desktop background for your BMP 3- Process keyboard/mouse input on the desktop as UI commands 4- Goto step 2 That would be a truly innovative UI |
|||
22 Jul 2011, 16:36 |
|
edfed 22 Jul 2011, 19:42
r22 wrote: * completely useless suggestion, but could be interesting/funny * my graphic lib fool renders the ui like you said, as a bmp, and then, put it on the video memory. but in fact, what you are suggesting is to make a triple or double buffering, that is what i make for gui, and even tui. each time the cpu and the ram are used as a simulation of any machine, it can be cool to render the simulation periodically, in order to have something like real time. a simple windows is the simulation of an electronic front panel or display board. 1: render all the graphical objects in one single image (buffer) 2: wait for vsynch (optional) 3: transfert the image to screen (video memory) goto 1 |
|||
22 Jul 2011, 19:42 |
|
praddo 10 Oct 2011, 10:32
Why not just use GTK?
|
|||
10 Oct 2011, 10:32 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.