Commit 494251ad authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

opengl32: Move some WGL functions to unix_wgl.c.

parent dec91f06
......@@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wl,--image-base,0x7a800000 -mcygwin
C_SRCS = \
thunks.c \
unix_thunks.c \
unix_wgl.c \
wgl.c
RC_SRCS = version.rc
......@@ -837,6 +837,20 @@ foreach (sort keys %ext_functions)
}
print OUT "};\n\n";
print OUT "typedef void (WINAPI *gl_debug_cb)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar *, const void *);\n";
print OUT "struct wine_gl_debug_message_params\n";
print OUT "{\n";
print OUT " gl_debug_cb user_callback;\n";
print OUT " const void *user_data;\n";
print OUT "\n";
print OUT " GLenum source;\n";
print OUT " GLenum type;\n";
print OUT " GLuint id;\n";
print OUT " GLenum severity;\n";
print OUT " GLsizei length;\n";
print OUT " const GLchar *message;\n";
print OUT "};\n\n";
print OUT "typedef NTSTATUS (*unixlib_function_t)( void *args );\n";
print OUT "extern const unixlib_function_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN;\n";
print OUT "#define UNIX_CALL( func, params ) __wine_unix_call_funcs[unix_ ## func]( params )\n";
......
......@@ -19,9 +19,14 @@
#ifndef __DLLS_OPENGL32_OPENGL_EXT_H
#define __DLLS_OPENGL32_OPENGL_EXT_H
#include <stdarg.h>
#include <stddef.h>
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "wingdi.h"
#include "wine/wgl.h"
#include "wine/wgl_driver.h"
......@@ -43,6 +48,57 @@ static inline struct opengl_funcs *get_dc_funcs( HDC hdc )
return funcs;
}
#define MAX_WGL_HANDLES 1024
/* handle management */
enum wgl_handle_type
{
HANDLE_PBUFFER = 0 << 12,
HANDLE_CONTEXT = 1 << 12,
HANDLE_CONTEXT_V3 = 3 << 12,
HANDLE_TYPE_MASK = 15 << 12
};
struct opengl_context
{
DWORD tid; /* thread that the context is current in */
HDC draw_dc; /* current drawing DC */
HDC read_dc; /* current reading DC */
void (CALLBACK *debug_callback)( GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar *, const void * ); /* debug callback */
const void *debug_user; /* debug user parameter */
GLubyte *extensions; /* extension string */
GLuint *disabled_exts; /* indices of disabled extensions */
struct wgl_context *drv_ctx; /* driver context */
};
struct wgl_handle
{
UINT handle;
struct opengl_funcs *funcs;
union
{
struct opengl_context *context; /* for HANDLE_CONTEXT */
struct wgl_pbuffer *pbuffer; /* for HANDLE_PBUFFER */
struct wgl_handle *next; /* for free handles */
} u;
};
extern struct wgl_handle wgl_handles[MAX_WGL_HANDLES];
/* the current context is assumed valid and doesn't need locking */
static inline struct wgl_handle *get_current_context_ptr(void)
{
if (!NtCurrentTeb()->glCurrentRC) return NULL;
return &wgl_handles[LOWORD(NtCurrentTeb()->glCurrentRC) & ~HANDLE_TYPE_MASK];
}
static inline enum wgl_handle_type get_current_context_type(void)
{
if (!NtCurrentTeb()->glCurrentRC) return HANDLE_CONTEXT;
return LOWORD(NtCurrentTeb()->glCurrentRC) & HANDLE_TYPE_MASK;
}
extern int WINAPI wglDescribePixelFormat( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR *ppfd );
#endif /* __DLLS_OPENGL32_OPENGL_EXT_H */
......@@ -25335,6 +25335,20 @@ enum unix_funcs
unix_wglSwapIntervalEXT,
};
typedef void (WINAPI *gl_debug_cb)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar *, const void *);
struct wine_gl_debug_message_params
{
gl_debug_cb user_callback;
const void *user_data;
GLenum source;
GLenum type;
GLuint id;
GLenum severity;
GLsizei length;
const GLchar *message;
};
typedef NTSTATUS (*unixlib_function_t)( void *args );
extern const unixlib_function_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN;
#define UNIX_CALL( func, params ) __wine_unix_call_funcs[unix_ ## func]( params )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment