doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NVCtrlLib.h
Go to the documentation of this file.
1 #ifndef __NVCTRLLIB_H
2 #define __NVCTRLLIB_H
3 
4 #include "NVCtrl.h"
5 
6 /*
7  * XNVCTRLQueryExtension -
8  *
9  * Returns True if the extension exists, returns False otherwise.
10  * event_basep and error_basep are the extension event and error
11  * bases. Currently, no extension specific errors or events are
12  * defined.
13  */
14 
16  Display *dpy,
17  int *event_basep,
18  int *error_basep
19 );
20 
21 /*
22  * XNVCTRLQueryVersion -
23  *
24  * Returns True if the extension exists, returns False otherwise.
25  * major and minor are the extension's major and minor version
26  * numbers.
27  */
28 
30  Display *dpy,
31  int *major,
32  int *minor
33 );
34 
35 
36 /*
37  * XNVCTRLIsNvScreen
38  *
39  * Returns True is the specified screen is controlled by the NVIDIA
40  * driver. Returns False otherwise.
41  */
42 
43 Bool XNVCTRLIsNvScreen (
44  Display *dpy,
45  int screen
46 );
47 
48 /*
49  * XNVCTRLSetAttribute -
50  *
51  * Sets the attribute to the given value. The attributes and their
52  * possible values are listed in NVCtrl.h.
53  *
54  * Not all attributes require the display_mask parameter; see
55  * NVCtrl.h for details.
56  *
57  * Possible errors:
58  * BadValue - The screen or attribute doesn't exist.
59  * BadMatch - The NVIDIA driver is not present on that screen.
60  */
61 
63  Display *dpy,
64  int screen,
65  unsigned int display_mask,
66  unsigned int attribute,
67  int value
68 );
69 
70 /*
71  * XNVCTRLQueryAttribute -
72  *
73  * Returns True if the attribute exists. Returns False otherwise.
74  * If XNVCTRLQueryAttribute returns True, value will contain the
75  * value of the specified attribute.
76  *
77  * Not all attributes require the display_mask parameter; see
78  * NVCtrl.h for details.
79  *
80  * Possible errors:
81  * BadValue - The screen doesn't exist.
82  * BadMatch - The NVIDIA driver is not present on that screen.
83  */
84 
85 
87  Display *dpy,
88  int screen,
89  unsigned int display_mask,
90  unsigned int attribute,
91  int *value
92 );
93 
94 /*
95  * XNVCTRLQueryStringAttribute -
96  *
97  * Returns True if the attribute exists. Returns False otherwise.
98  * If XNVCTRLQueryStringAttribute returns True, *ptr will point to an
99  * allocated string containing the string attribute requested. It is
100  * the caller's responsibility to free the string when done.
101  *
102  * Possible errors:
103  * BadValue - The screen doesn't exist.
104  * BadMatch - The NVIDIA driver is not present on that screen.
105  * BadAlloc - Insufficient resources to fulfill the request.
106  */
107 
109  Display *dpy,
110  int screen,
111  unsigned int display_mask,
112  unsigned int attribute,
113  char **ptr
114 );
115 
116 /*
117  * XNVCTRLQueryValidAttributeValues -
118  *
119  * Returns True if the attribute exists. Returns False otherwise. If
120  * XNVCTRLQueryValidAttributeValues returns True, values will indicate
121  * the valid values for the specified attribute; see the description
122  * of NVCTRLAttributeValidValues in NVCtrl.h.
123  */
124 
126  Display *dpy,
127  int screen,
128  unsigned int display_mask,
129  unsigned int attribute,
131 );
132 
133 /*
134  * XNVCtrlSelectNotify -
135  *
136  * This enables/disables receiving of NV-CONTROL events. The type
137  * specifies the type of event to enable (currently, the only type is
138  * ATTRIBUTE_CHANGED_EVENT); onoff controls whether receiving this
139  * type of event should be enabled (True) or disabled (False).
140  *
141  * Returns True if successful, or False if the screen is not
142  * controlled by the NVIDIA driver.
143  */
144 
145 Bool XNVCtrlSelectNotify (
146  Display *dpy,
147  int screen,
148  int type,
149  Bool onoff
150 );
151 
152 
153 
154 /*
155  * XNVCtrlEvent structure
156  */
157 
158 typedef struct {
159  int type;
160  unsigned long serial;
161  Bool send_event; /* always FALSE, we don't allow send_events */
162  Display *display;
163  Time time;
164  int screen;
165  unsigned int display_mask;
166  unsigned int attribute;
167  int value;
169 
170 typedef union {
171  int type;
173  long pad[24];
174 } XNVCtrlEvent;
175 
176 
177 #endif /* __NVCTRLLIB_H */
XNVCtrlAttributeChangedEvent attribute_changed
Definition: NVCtrlLib.h:172
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:2868
GLsizei const GLfloat * value
Definition: glext.h:3614
void XNVCTRLSetAttribute(Display *dpy, int screen, unsigned int display_mask, unsigned int attribute, int value)
Definition: NVCtrl.c:125
GLuint GLuint GLsizei GLenum type
Definition: glext.h:2845
Bool XNVCTRLQueryStringAttribute(Display *dpy, int screen, unsigned int display_mask, unsigned int attribute, char **ptr)
Definition: NVCtrl.c:187
Bool XNVCTRLQueryValidAttributeValues(Display *dpy, int screen, unsigned int display_mask, unsigned int attribute, NVCTRLAttributeValidValuesRec *values)
Definition: NVCtrl.c:238
Bool XNVCTRLIsNvScreen(Display *dpy, int screen)
Definition: NVCtrl.c:94
Bool XNVCTRLQueryAttribute(Display *dpy, int screen, unsigned int display_mask, unsigned int attribute, int *value)
Definition: NVCtrl.c:150
Display * dpy
Definition: glimp.cpp:43
Bool XNVCTRLQueryVersion(Display *dpy, int *major, int *minor)
Definition: NVCtrl.c:63
Bool XNVCTRLQueryExtension(Display *dpy, int *event_basep, int *error_basep)
Definition: NVCtrl.c:46
Bool XNVCtrlSelectNotify(Display *dpy, int screen, int type, Bool onoff)
Definition: NVCtrl.c:284