2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: lib/opengl32/opengl.h
5 * PURPOSE: OpenGL32 lib, general header
11 #define WIN32_NO_STATUS
20 #ifndef OPENGL32_USE_TLS
24 #include <wine/debug.h>
28 /* *$%$£^§! headers inclusion */
32 _In_ PLIST_ENTRY Entry
)
37 OldFlink
= Entry
->Flink
;
38 OldBlink
= Entry
->Blink
;
39 OldFlink
->Blink
= OldBlink
;
40 OldBlink
->Flink
= OldFlink
;
41 return (OldFlink
== OldBlink
);
47 _In_ PLIST_ENTRY ListHead
,
48 _In_ PLIST_ENTRY Entry
52 OldBlink
= ListHead
->Blink
;
53 Entry
->Flink
= ListHead
;
54 Entry
->Blink
= OldBlink
;
55 OldBlink
->Flink
= Entry
;
56 ListHead
->Blink
= Entry
;
63 _Inout_ PLIST_ENTRY ListHead
66 ListHead
->Flink
= ListHead
->Blink
= ListHead
;
69 extern LIST_ENTRY ContextListHead
;
79 struct ICD_Data
* icd_data
;
81 volatile LONG thread_id
;
84 #define WGL_DC_OBJ_DC 0x1
100 struct ICD_Data
* icd_data
;
103 /* Software implementation */
108 struct wgl_dc_data
* next
;
111 /* Clean up functions */
112 void IntDeleteAllContexts(void);
113 void IntDeleteAllICDs(void);
116 const GLDISPATCHTABLE
*
117 IntGetCurrentDispatchTable(void)
119 return (GLDISPATCHTABLE
*)NtCurrentTeb()->glTable
;
124 IntSetCurrentDispatchTable(const GLDISPATCHTABLE
* table
)
126 NtCurrentTeb()->glTable
= (void*)table
;
131 IntMakeCurrent(HGLRC hglrc
, HDC hdc
, struct wgl_dc_data
* dc_data
)
133 TEB
* CurrentTeb
= NtCurrentTeb();
135 CurrentTeb
->glCurrentRC
= hglrc
;
136 CurrentTeb
->glReserved2
= hdc
;
137 CurrentTeb
->glSectionInfo
= dc_data
;
142 IntGetCurrentRC(void)
144 return NtCurrentTeb()->glCurrentRC
;
149 IntGetCurrentDC(void)
151 return NtCurrentTeb()->glReserved2
;
156 IntGetCurrentDcData(void)
158 return NtCurrentTeb()->glSectionInfo
;
163 IntSetCurrentICDPrivate(void* value
)
165 NtCurrentTeb()->glContext
= value
;
170 IntGetCurrentICDPrivate(void)
172 return (void*)NtCurrentTeb()->glContext
;
177 IntGetCurrentDHGLRC(void)
179 struct wgl_context
* ctx
= (struct wgl_context
*)IntGetCurrentRC();
180 if(!ctx
) return NULL
;
184 /* Software implementation functions */
185 INT
sw_DescribePixelFormat(HDC hdc
, INT format
, UINT size
, PIXELFORMATDESCRIPTOR
* descr
);
186 BOOL
sw_SetPixelFormat(HDC hdc
, struct wgl_dc_data
*, INT format
);
187 DHGLRC
sw_CreateContext(struct wgl_dc_data
*);
188 BOOL
sw_DeleteContext(DHGLRC dhglrc
);
189 BOOL
sw_SetContext(struct wgl_dc_data
* dc_data
, DHGLRC dhglrc
);
190 void sw_ReleaseContext(DHGLRC hglrc
);
191 PROC
sw_GetProcAddress(LPCSTR name
);
192 BOOL
sw_CopyContext(DHGLRC dhglrcSrc
, DHGLRC dhglrcDst
, UINT mask
);
193 BOOL
sw_ShareLists(DHGLRC dhglrcSrc
, DHGLRC dhglrcDst
);
194 BOOL
sw_SwapBuffers(HDC hdc
, struct wgl_dc_data
* dc_data
);
196 #endif /* _OPENGL32_PCH_ */