Сделал структуру, которую будет возвращать функция инициализации окна в glx:
struct contextResult
{
Display dp;
GLXContext ctx;
Colormap cmap;
Window win;
};
field ‘dp’ has incomplete type
Смотрю в Xlib.h и вижу:
/*
* Display datatype maintaining display specific data.
* The contents of this structure are implementation dependent.
* A Display should be treated as opaque by application code.
*/
#ifndef XLIB_ILLEGAL_ACCESS
typedef struct _XDisplay Display;
#endif
typedef struct
#ifdef XLIB_ILLEGAL_ACCESS
_XDisplay
#endif
{
XExtData *ext_data; /* hook for extension to hang data */
struct _XPrivate *private1;
int fd; /* Network socket. */
int private2;
int proto_major_version;/* major version of server's X protocol */
int proto_minor_version;/* minor version of servers X protocol */
char *vendor; /* vendor of the server hardware */
XID private3;
XID private4;
XID private5;
int private6;
XID (*resource_alloc)( /* allocator function */
struct _XDisplay*
);
int byte_order; /* screen byte order, LSBFirst, MSBFirst */
int bitmap_unit; /* padding and data requirements */
int bitmap_pad; /* padding requirements on bitmaps */
int bitmap_bit_order; /* LeastSignificant or MostSignificant */
int nformats; /* number of pixmap formats in list */
ScreenFormat *pixmap_format; /* pixmap format list */
int private8;
int release; /* release of the server */
struct _XPrivate *private9, *private10;
int qlen; /* Length of input event queue */
unsigned long last_request_read; /* seq number of last event read */
unsigned long request; /* sequence number of last request. */
XPointer private11;
XPointer private12;
XPointer private13;
XPointer private14;
unsigned max_request_size; /* maximum number 32 bit words in request*/
struct _XrmHashBucketRec *db;
int (*private15)(
struct _XDisplay*
);
char *display_name; /* "host:display" string used on this connect*/
int default_screen; /* default screen for operations */
int nscreens; /* number of screens on this server*/
Screen *screens; /* pointer to list of screens */
unsigned long motion_buffer; /* size of motion buffer */
unsigned long private16;
int min_keycode; /* minimum defined keycode */
int max_keycode; /* maximum defined keycode */
XPointer private17;
XPointer private18;
int private19;
char *xdefaults; /* contents of defaults from server */
/* there is more to this structure, but it is private to Xlib */
}
#ifdef XLIB_ILLEGAL_ACCESS
Display,
#endif
*_XPrivDisplay;
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glext.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xfuncproto.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>