Skip to main content
gamedev.net
🔒 Locked

Starting with X11 Programming

Started by glytchbinary Dec 4, 2001 at 6:54 AM 4 replies 600+ views
Original Post
glytchbinary
glytchbinary
How do i even create a new window?(i dont wanna use toolkits) using just the standard X11 libraries can anyone point me to some tutorials?
Null and Void
Null and Void
I''m not very good with XLib (since I didn''t spend much time on it) but here are the links that I have for it:
http://www.vislab.usyd.edu.au/ebt-bin/nph-dweb/dynaweb/SGI_Developer/XLib_PG/
http://tronche.com/gui/x/xlib-tutorial/2nd-program-anatomy.html

Most of the other links don''t seem to work anymore, but that first one should help you some .

[Resist Windows XP''s Invasive Production Activation Technology!]
Larkfellow
Larkfellow
http://tuxgames.scurvypenguin.net It''s my site, and I currently have one tutorial up and available for download (BTW, I''m working on redoing the site, it''s been a while I know). But if nothing else there''s a link to an X11 programming page that I got the tutorials from. however it''s not very detailed, and doesn''t actually explain much. That''s why I decided to do one myself. Anywho, check it out.

-- Never monkey with another monkey''s monkey.
-- Never monkey with another monkey's monkey.
glytchbinary
glytchbinary
thanks all, im off to do some reading.
Biased turkey
Biased turkey
This is the simplest program to open a window:
#include X11/Xlib.h

#include stdio.h
#include stdlib.h
#include unistd.h

Display *dis;
Window win;

int main()
{
dis = XOpenDisplay( NULL );
win = XCreateSimpleWindow( dis, RootWindow( dis, 0 ), 1, 1, 200, 140,
0, BlackPixel( dis, 0 ), BlackPixel( dis, 0 ) );
XMapWindow( dis, win );
XFlush( dis );
sleep( 5 );
return 0;
}

P.S. I removed the surounding special characters smaller than and bigger than surrounding the files to include in the includes statement. because I know it screws up HTML files.
don''t forget to include the following statements when compiling:
gcc myfile.c -o myfile -I/usr/X11R6/include -L/usr/X11R6/lib

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.