flat assembler
Message board for the users of flat assembler.

Index > Linux > Sample window without using any "API"

Author
Thread Post new topic Reply to topic
marcelo.sabino



Joined: 10 Mar 2006
Posts: 4
marcelo.sabino
Hi all,
I want to make a window without using any api or something related, I just want to draw a black square with text or something just to the square remember a window, just like zsnes do.

Thanx

Marcelo Sabino
Post 20 Sep 2006, 04:44
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
zsnes Windows version doesn't use any API??? I can't believe that, it should at least call CreateWindow once to create a WS_POPUP Window and then render on it using DirectDraw (through API call too), or maybe using a DIBSection (but I think it uses DirectDraw). Check the DDRAW example inside FASM package.
Post 20 Sep 2006, 05:59
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
loco: flat assembler > Linux > Sample window without using any "API" Smile

Anyway, you *will* need an API call of one form or another to set graphics mode - linux int80 is an API call too.
Post 20 Sep 2006, 06:02
View user's profile Send private message Visit poster's website Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade
I'm afraid pretty much all your choices for GUI in linux are API-based.
Choices you have:
Xlib - About as low as you can go, still means using an external library though (libX11)
GTK - Much easier to code in, also an external library. And there's even some examples of how to use it in fasm at http://www.flatassembler.net/examples.php. (libGTK)
SDL - Not too hard, but more for graphics/animations/games, you can also use OpenGL through SDL. (libSDL)
OpenGL - As far as I can remember, you can use the opengl library directly. (libGL)

There are probably more, but these are the main ones, and any others will also probably be some kind of library just like these.

The only way you could make a window without using an external library (but still requiring you to use syscall for the write function), would be to "talk" with the X server directly. You need to create a socket, then connect to /tmp/.X11-unix/X0, then you can write to it what you want, but its very cryptic, and information on the protocol might be hard to find.
If you want to see what it looks like, do an strace on a GUI program, and look for the write() calls.
Post 20 Sep 2006, 09:04
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

loco: flat assembler > Linux > Sample window without using any "API"


Hahahahaha, sorry, 0259 AM when I posted that, I didn't note that this is the Linux forum Razz
Post 20 Sep 2006, 13:03
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.