1GLXCREATECONTEXT() GLXCREATECONTEXT()
2
3
4
6 glXCreateContext - create a new GLX rendering context
7
8
10 GLXContext glXCreateContext( Display *dpy,
11 XVisualInfo *vis,
12 GLXContext shareList,
13 Bool direct )
14
15 delim $$
16
18 dpy Specifies the connection to the X server.
19
20 vis Specifies the visual that defines the frame buffer resources
21 available to the rendering context. It is a pointer to an
22 XVisualInfo structure, not a visual ID or a pointer to a
23 Visual.
24
25 shareList Specifies the context with which to share display lists.
26 NULL indicates that no sharing is to take place.
27
28 direct Specifies whether rendering is to be done with a direct con‐
29 nection to the graphics system if possible (True) or through
30 the X server (False).
31
33 glXCreateContext creates a GLX rendering context and returns its han‐
34 dle. This context can be used to render into both windows and GLX
35 pixmaps. If glXCreateContext fails to create a rendering context, NULL
36 is returned.
37
38 If direct is True, then a direct rendering context is created if the
39 implementation supports direct rendering, if the connection is to an X
40 server that is local, and if a direct rendering context is available.
41 (An implementation may return an indirect context when direct is True).
42 If direct is False, then a rendering context that renders through the X
43 server is always created. Direct rendering provides a performance
44 advantage in some implementations. However, direct rendering contexts
45 cannot be shared outside a single process, and they may be unable to
46 render to GLX pixmaps.
47
48 If shareList is not NULL, then all display-list indexes and definitions
49 are shared by context shareList and by the newly created context. An
50 arbitrary number of contexts can share a single display-list space.
51 However, all rendering contexts that share a single display-list space
52 must themselves exist in the same address space. Two rendering con‐
53 texts share an address space if both are nondirect using the same
54 server, or if both are direct and owned by a single process. Note that
55 in the nondirect case, it is not necessary for the calling threads to
56 share an address space, only for their related rendering contexts to
57 share an address space.
58
59 If the GL version is 1.1 or greater, then all texture objects except
60 object 0, are shared by any contexts that share display lists.
61
63 XVisualInfo is defined in Xutil.h. It is a structure that includes
64 visual, visualID, screen, and depth elements.
65
66 A process is a single execution environment, implemented in a single
67 address space, consisting of one or more threads.
68
69 A thread is one of a set of subprocesses that share a single address
70 space, but maintain separate program counters, stack spaces, and other
71 related global data. A thread that is the only member of its subpro‐
72 cess group is equivalent to a process.
73
74 It may not be possible to render to a GLX pixmap with a direct render‐
75 ing context.
76
78 NULL is returned if execution fails on the client side.
79
80 BadMatch is generated if the context to be created would not share the
81 address space or the screen of the context specified by shareList.
82
83 BadValue is generated if vis is not a valid visual (for example, if a
84 particular GLX implementation does not support it).
85
86 GLXBadContext is generated if shareList is not a GLX context and is not
87 NULL.
88
89 BadAlloc is generated if the server does not have enough resources to
90 allocate the new context.
91
93 glXDestroyContext, glXGetConfig, glXIsDirect, glXMakeCurrent
94
95
96
97
98 GLXCREATECONTEXT()