Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
06640efa
Commit
06640efa
authored
May 01, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Dynamically load libGLU.
Based on a patch by Roderick Colenbrander.
parent
0567e72c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
18 deletions
+72
-18
configure
configure
+0
-1
configure.ac
configure.ac
+1
-2
Makefile.in
dlls/glu32/Makefile.in
+1
-1
wgl.c
dlls/opengl32/wgl.c
+70
-14
No files found.
configure
View file @
06640efa
...
@@ -11173,7 +11173,6 @@ cat >>confdefs.h <<_ACEOF
...
@@ -11173,7 +11173,6 @@ cat >>confdefs.h <<_ACEOF
#define SONAME_LIBGLU "
$ac_cv_lib_soname_GLU
"
#define SONAME_LIBGLU "
$ac_cv_lib_soname_GLU
"
_ACEOF
_ACEOF
OPENGL_LIBS
=
"
$OPENGL_LIBS
-lGLU"
GLU32FILES
=
'$(GLU32FILES)'
GLU32FILES
=
'$(GLU32FILES)'
fi
fi
...
...
configure.ac
View file @
06640efa
...
@@ -746,8 +746,7 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
...
@@ -746,8 +746,7 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
if test "$ac_cv_header_GL_glu_h" = "yes"
if test "$ac_cv_header_GL_glu_h" = "yes"
then
then
WINE_CHECK_SONAME(GLU,gluLookAt,[OPENGL_LIBS="$OPENGL_LIBS -lGLU"
WINE_CHECK_SONAME(GLU,gluLookAt,[GLU32FILES='$(GLU32FILES)'],,
GLU32FILES='$(GLU32FILES)'],,
[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS])
[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS])
fi
fi
WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"],
WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"],
...
...
dlls/glu32/Makefile.in
View file @
06640efa
...
@@ -6,7 +6,7 @@ MODULE = glu32.dll
...
@@ -6,7 +6,7 @@ MODULE = glu32.dll
IMPORTLIB
=
glu32
IMPORTLIB
=
glu32
IMPORTS
=
kernel32
IMPORTS
=
kernel32
EXTRAINCL
=
@X_CFLAGS@
EXTRAINCL
=
@X_CFLAGS@
EXTRALIBS
=
@X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ @OPENGL
_LIBS@
EXTRALIBS
=
-lGLU
@OPENGL_LIBS@ @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA
_LIBS@
C_SRCS
=
\
C_SRCS
=
\
glu.c
glu.c
...
...
dlls/opengl32/wgl.c
View file @
06640efa
...
@@ -56,6 +56,19 @@ typedef struct wine_wgl_s {
...
@@ -56,6 +56,19 @@ typedef struct wine_wgl_s {
/** global wgl object */
/** global wgl object */
static
wine_wgl_t
wine_wgl
;
static
wine_wgl_t
wine_wgl
;
#ifdef SONAME_LIBGLU
#define MAKE_FUNCPTR(f) static typeof(f) * p##f;
MAKE_FUNCPTR
(
gluNewTess
)
MAKE_FUNCPTR
(
gluDeleteTess
)
MAKE_FUNCPTR
(
gluTessBeginContour
)
MAKE_FUNCPTR
(
gluTessBeginPolygon
)
MAKE_FUNCPTR
(
gluTessCallback
)
MAKE_FUNCPTR
(
gluTessEndContour
)
MAKE_FUNCPTR
(
gluTessEndPolygon
)
MAKE_FUNCPTR
(
gluTessVertex
)
#undef MAKE_FUNCPTR
#endif
/* SONAME_LIBGLU */
/* x11drv GDI escapes */
/* x11drv GDI escapes */
#define X11DRV_ESCAPE 6789
#define X11DRV_ESCAPE 6789
enum
x11drv_escape_codes
enum
x11drv_escape_codes
...
@@ -76,6 +89,7 @@ void (*wine_tsx11_lock_ptr)(void) = NULL;
...
@@ -76,6 +89,7 @@ void (*wine_tsx11_lock_ptr)(void) = NULL;
void
(
*
wine_tsx11_unlock_ptr
)(
void
)
=
NULL
;
void
(
*
wine_tsx11_unlock_ptr
)(
void
)
=
NULL
;
static
HMODULE
opengl32_handle
;
static
HMODULE
opengl32_handle
;
static
void
*
libglu_handle
=
NULL
;
static
char
*
internal_gl_disabled_extensions
=
NULL
;
static
char
*
internal_gl_disabled_extensions
=
NULL
;
static
char
*
internal_gl_extensions
=
NULL
;
static
char
*
internal_gl_extensions
=
NULL
;
...
@@ -315,6 +329,42 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
...
@@ -315,6 +329,42 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
#ifdef SONAME_LIBGLU
#ifdef SONAME_LIBGLU
static
void
*
load_libglu
(
void
)
{
static
int
already_loaded
;
void
*
handle
;
if
(
already_loaded
)
return
libglu_handle
;
already_loaded
=
1
;
TRACE
(
"Trying to load GLU library: %s
\n
"
,
SONAME_LIBGLU
);
handle
=
wine_dlopen
(
SONAME_LIBGLU
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
handle
)
{
WARN
(
"Failed to load %s
\n
"
,
SONAME_LIBGLU
);
return
NULL
;
}
#define LOAD_FUNCPTR(f) if((p##f = (void*)wine_dlsym(handle, #f, NULL, 0)) == NULL) goto sym_not_found;
LOAD_FUNCPTR
(
gluNewTess
)
LOAD_FUNCPTR
(
gluDeleteTess
)
LOAD_FUNCPTR
(
gluTessBeginContour
)
LOAD_FUNCPTR
(
gluTessBeginPolygon
)
LOAD_FUNCPTR
(
gluTessCallback
)
LOAD_FUNCPTR
(
gluTessEndContour
)
LOAD_FUNCPTR
(
gluTessEndPolygon
)
LOAD_FUNCPTR
(
gluTessVertex
)
#undef LOAD_FUNCPTR
libglu_handle
=
handle
;
return
handle
;
sym_not_found:
WARN
(
"Unable to load function ptrs from libGLU
\n
"
);
/* Close the library as we won't use it */
wine_dlclose
(
handle
,
NULL
,
0
);
return
NULL
;
}
static
void
fixed_to_double
(
POINTFX
fixed
,
UINT
em_size
,
GLdouble
vertex
[
3
])
static
void
fixed_to_double
(
POINTFX
fixed
,
UINT
em_size
,
GLdouble
vertex
[
3
])
{
{
vertex
[
0
]
=
(
fixed
.
x
.
value
+
(
GLdouble
)
fixed
.
x
.
fract
/
(
1
<<
16
))
/
em_size
;
vertex
[
0
]
=
(
fixed
.
x
.
value
+
(
GLdouble
)
fixed
.
x
.
fract
/
(
1
<<
16
))
/
em_size
;
...
@@ -365,14 +415,19 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
...
@@ -365,14 +415,19 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
TRACE
(
"(%p, %d, %d, %d, %f, %f, %d, %p, %s)
\n
"
,
hdc
,
first
,
count
,
TRACE
(
"(%p, %d, %d, %d, %f, %f, %d, %p, %s)
\n
"
,
hdc
,
first
,
count
,
listBase
,
deviation
,
extrusion
,
format
,
lpgmf
,
unicode
?
"W"
:
"A"
);
listBase
,
deviation
,
extrusion
,
format
,
lpgmf
,
unicode
?
"W"
:
"A"
);
if
(
!
load_libglu
())
{
ERR
(
"libGLU is required for this function but isn't loaded
\n
"
);
return
FALSE
;
}
ENTER_GL
();
ENTER_GL
();
tess
=
gluNewTess
();
tess
=
p
gluNewTess
();
if
(
tess
)
if
(
tess
)
{
{
gluTessCallback
(
tess
,
GLU_TESS_VERTEX
,
(
_GLUfuncptr
)
tess_callback_vertex
);
p
gluTessCallback
(
tess
,
GLU_TESS_VERTEX
,
(
_GLUfuncptr
)
tess_callback_vertex
);
gluTessCallback
(
tess
,
GLU_TESS_BEGIN
,
(
_GLUfuncptr
)
tess_callback_begin
);
p
gluTessCallback
(
tess
,
GLU_TESS_BEGIN
,
(
_GLUfuncptr
)
tess_callback_begin
);
gluTessCallback
(
tess
,
GLU_TESS_END
,
tess_callback_end
);
p
gluTessCallback
(
tess
,
GLU_TESS_END
,
tess_callback_end
);
}
}
LEAVE_GL
();
LEAVE_GL
();
...
@@ -430,17 +485,17 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
...
@@ -430,17 +485,17 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
ENTER_GL
();
ENTER_GL
();
glNewList
(
listBase
++
,
GL_COMPILE
);
glNewList
(
listBase
++
,
GL_COMPILE
);
gluTessBeginPolygon
(
tess
,
NULL
);
p
gluTessBeginPolygon
(
tess
,
NULL
);
pph
=
(
TTPOLYGONHEADER
*
)
buf
;
pph
=
(
TTPOLYGONHEADER
*
)
buf
;
while
((
BYTE
*
)
pph
<
buf
+
needed
)
while
((
BYTE
*
)
pph
<
buf
+
needed
)
{
{
TRACE
(
"
\t
start %d, %d
\n
"
,
pph
->
pfxStart
.
x
.
value
,
pph
->
pfxStart
.
y
.
value
);
TRACE
(
"
\t
start %d, %d
\n
"
,
pph
->
pfxStart
.
x
.
value
,
pph
->
pfxStart
.
y
.
value
);
gluTessBeginContour
(
tess
);
p
gluTessBeginContour
(
tess
);
fixed_to_double
(
pph
->
pfxStart
,
em_size
,
vertices
);
fixed_to_double
(
pph
->
pfxStart
,
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
vertices
+=
3
;
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
pph
+
sizeof
(
*
pph
));
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
pph
+
sizeof
(
*
pph
));
...
@@ -454,7 +509,7 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
...
@@ -454,7 +509,7 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
{
{
TRACE
(
"
\t\t
line to %d, %d
\n
"
,
ppc
->
apfx
[
i
].
x
.
value
,
ppc
->
apfx
[
i
].
y
.
value
);
TRACE
(
"
\t\t
line to %d, %d
\n
"
,
ppc
->
apfx
[
i
].
x
.
value
,
ppc
->
apfx
[
i
].
y
.
value
);
fixed_to_double
(
ppc
->
apfx
[
i
],
em_size
,
vertices
);
fixed_to_double
(
ppc
->
apfx
[
i
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
vertices
+=
3
;
}
}
break
;
break
;
...
@@ -467,28 +522,28 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
...
@@ -467,28 +522,28 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
ppc
->
apfx
[
i
*
2
].
x
.
value
,
ppc
->
apfx
[
i
*
3
].
y
.
value
,
ppc
->
apfx
[
i
*
2
].
x
.
value
,
ppc
->
apfx
[
i
*
3
].
y
.
value
,
ppc
->
apfx
[
i
*
2
+
1
].
x
.
value
,
ppc
->
apfx
[
i
*
3
+
1
].
y
.
value
);
ppc
->
apfx
[
i
*
2
+
1
].
x
.
value
,
ppc
->
apfx
[
i
*
3
+
1
].
y
.
value
);
fixed_to_double
(
ppc
->
apfx
[
i
*
2
],
em_size
,
vertices
);
fixed_to_double
(
ppc
->
apfx
[
i
*
2
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
vertices
+=
3
;
fixed_to_double
(
ppc
->
apfx
[
i
*
2
+
1
],
em_size
,
vertices
);
fixed_to_double
(
ppc
->
apfx
[
i
*
2
+
1
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
vertices
+=
3
;
}
}
break
;
break
;
default:
default:
ERR
(
"
\t\t
curve type = %d
\n
"
,
ppc
->
wType
);
ERR
(
"
\t\t
curve type = %d
\n
"
,
ppc
->
wType
);
gluTessEndContour
(
tess
);
p
gluTessEndContour
(
tess
);
goto
error_in_list
;
goto
error_in_list
;
}
}
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
ppc
+
sizeof
(
*
ppc
)
+
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
ppc
+
sizeof
(
*
ppc
)
+
(
ppc
->
cpfx
-
1
)
*
sizeof
(
POINTFX
));
(
ppc
->
cpfx
-
1
)
*
sizeof
(
POINTFX
));
}
}
gluTessEndContour
(
tess
);
p
gluTessEndContour
(
tess
);
pph
=
(
TTPOLYGONHEADER
*
)((
char
*
)
pph
+
pph
->
cb
);
pph
=
(
TTPOLYGONHEADER
*
)((
char
*
)
pph
+
pph
->
cb
);
}
}
error_in_list:
error_in_list:
gluTessEndPolygon
(
tess
);
p
gluTessEndPolygon
(
tess
);
glTranslated
((
GLdouble
)
gm
.
gmCellIncX
/
em_size
,
(
GLdouble
)
gm
.
gmCellIncY
/
em_size
,
0
.
0
);
glTranslated
((
GLdouble
)
gm
.
gmCellIncX
/
em_size
,
(
GLdouble
)
gm
.
gmCellIncY
/
em_size
,
0
.
0
);
glEndList
();
glEndList
();
LEAVE_GL
();
LEAVE_GL
();
...
@@ -498,7 +553,7 @@ error_in_list:
...
@@ -498,7 +553,7 @@ error_in_list:
error:
error:
DeleteObject
(
SelectObject
(
hdc
,
old_font
));
DeleteObject
(
SelectObject
(
hdc
,
old_font
));
gluDeleteTess
(
tess
);
p
gluDeleteTess
(
tess
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -676,6 +731,7 @@ static BOOL process_attach(void)
...
@@ -676,6 +731,7 @@ static BOOL process_attach(void)
static
void
process_detach
(
void
)
static
void
process_detach
(
void
)
{
{
if
(
libglu_handle
)
wine_dlclose
(
libglu_handle
,
NULL
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
internal_gl_extensions
);
HeapFree
(
GetProcessHeap
(),
0
,
internal_gl_extensions
);
HeapFree
(
GetProcessHeap
(),
0
,
internal_gl_disabled_extensions
);
HeapFree
(
GetProcessHeap
(),
0
,
internal_gl_disabled_extensions
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment