1GLXMAKECURRENT(3G) OpenGL Manual GLXMAKECURRENT(3G)
2
3
4
6 glXMakeCurrent - attach a GLX context to a window or a GLX pixmap
7
9 Bool glXMakeCurrent(Display * dpy, GLXDrawable drawable,
10 GLXContext ctx);
11
13 dpy
14 Specifies the connection to the X server.
15
16 drawable
17 Specifies a GLX drawable. Must be either an X window ID or a GLX
18 pixmap ID.
19
20 ctx
21 Specifies a GLX rendering context that is to be attached to
22 drawable.
23
25 glXMakeCurrent does two things: It makes ctx the current GLX rendering
26 context of the calling thread, replacing the previously current context
27 if there was one, and it attaches ctx to a GLX drawable, either a
28 window or a GLX pixmap. As a result of these two actions, subsequent GL
29 rendering calls use rendering context ctx to modify GLX drawable
30 drawable (for reading and writing). Because glXMakeCurrent always
31 replaces the current rendering context with ctx, there can be only one
32 current context per thread.
33
34 Pending commands to the previous context, if any, are flushed before it
35 is released.
36
37 The first time ctx is made current to any thread, its viewport is set
38 to the full size of drawable. Subsequent calls by any thread to
39 glXMakeCurrent with ctx have no effect on its viewport.
40
41 To release the current context without assigning a new one, call
42 glXMakeCurrent with drawable set to None and ctx set to NULL.
43
44 glXMakeCurrent returns True if it is successful, False otherwise. If
45 False is returned, the previously current rendering context and
46 drawable (if any) remain unchanged.
47
49 A process is a single-execution environment, implemented in a single
50 address space, consisting of one or more threads.
51
52 A thread is one of a set of subprocesses that share a single address
53 space, but maintain separate program counters, stack spaces, and other
54 related global data. A thread that is the only member of its subprocess
55 group is equivalent to a process.
56
58 BadMatch is generated if drawable was not created with the same X
59 screen and visual as ctx. It is also generated if drawable is None and
60 ctx is not NULL.
61
62 BadAccess is generated if ctx was current to another thread at the time
63 glXMakeCurrent was called.
64
65 GLXBadDrawable is generated if drawable is not a valid GLX drawable.
66
67 GLXBadContext is generated if ctx is not a valid GLX context.
68
69 GLXBadContextState is generated if glXMakeCurrent is executed between
70 the execution of glBegin() and the corresponding execution of glEnd().
71
72 GLXBadContextState is also generated if the rendering context current
73 to the calling thread has GL renderer state GLX_FEEDBACK or GLX_SELECT.
74
75 GLXBadCurrentWindow is generated if there are pending GL commands for
76 the previous context and the current drawable is a window that is no
77 longer valid.
78
79 BadAlloc may be generated if the server has delayed allocation of
80 ancillary buffers until glXMakeCurrent is called, only to find that it
81 has insufficient resources to complete the allocation.
82
84 glXCreateContext(), glXCreateGLXPixmap()glXGetCurrentContext(),
85 glXGetCurrentDisplay(), glXGetCurrentDrawable(),
86 glXGetCurrentReadDrawable(), glXMakeContextCurrent()
87
89 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
90 under the SGI Free Software B License. For details, see
91 http://oss.sgi.com/projects/FreeB/.
92
94 opengl.org
95
96
97
98opengl.org 06/10/2014 GLXMAKECURRENT(3G)