Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
06640efa
Commit
06640efa
authored
16 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
opengl32: Dynamically load libGLU.
Based on a patch by Roderick Colenbrander.
parent
0567e72c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-2
1 addition, 2 deletions
configure
configure.ac
+1
-2
1 addition, 2 deletions
configure.ac
dlls/glu32/Makefile.in
+1
-1
1 addition, 1 deletion
dlls/glu32/Makefile.in
dlls/opengl32/wgl.c
+70
-14
70 additions, 14 deletions
dlls/opengl32/wgl.c
with
73 additions
and
19 deletions
configure
+
1
−
2
View file @
06640efa
...
...
@@ -11173,8 +11173,7 @@ cat >>confdefs.h <<_ACEOF
#define SONAME_LIBGLU "$ac_cv_lib_soname_GLU"
_ACEOF
OPENGL_LIBS="$OPENGL_LIBS -lGLU"
GLU32FILES='$(GLU32FILES)'
GLU32FILES='$(GLU32FILES)'
fi
fi
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
2
View file @
06640efa
...
...
@@ -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)
if test "$ac_cv_header_GL_glu_h" = "yes"
then
WINE_CHECK_SONAME(GLU,gluLookAt,[OPENGL_LIBS="$OPENGL_LIBS -lGLU"
GLU32FILES='$(GLU32FILES)'],,
WINE_CHECK_SONAME(GLU,gluLookAt,[GLU32FILES='$(GLU32FILES)'],,
[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS])
fi
WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"],
...
...
This diff is collapsed.
Click to expand it.
dlls/glu32/Makefile.in
+
1
−
1
View file @
06640efa
...
...
@@ -6,7 +6,7 @@ MODULE = glu32.dll
IMPORTLIB
=
glu32
IMPORTS
=
kernel32
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
=
\
glu.c
...
...
This diff is collapsed.
Click to expand it.
dlls/opengl32/wgl.c
+
70
−
14
View file @
06640efa
...
...
@@ -56,6 +56,19 @@ typedef struct wine_wgl_s {
/** global wgl object */
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 */
#define X11DRV_ESCAPE 6789
enum
x11drv_escape_codes
...
...
@@ -76,6 +89,7 @@ void (*wine_tsx11_lock_ptr)(void) = NULL;
void
(
*
wine_tsx11_unlock_ptr
)(
void
)
=
NULL
;
static
HMODULE
opengl32_handle
;
static
void
*
libglu_handle
=
NULL
;
static
char
*
internal_gl_disabled_extensions
=
NULL
;
static
char
*
internal_gl_extensions
=
NULL
;
...
...
@@ -315,6 +329,42 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
#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
])
{
vertex
[
0
]
=
(
fixed
.
x
.
value
+
(
GLdouble
)
fixed
.
x
.
fract
/
(
1
<<
16
))
/
em_size
;
...
...
@@ -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
,
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
();
tess
=
gluNewTess
();
tess
=
p
gluNewTess
();
if
(
tess
)
{
gluTessCallback
(
tess
,
GLU_TESS_VERTEX
,
(
_GLUfuncptr
)
tess_callback_vertex
);
gluTessCallback
(
tess
,
GLU_TESS_BEGIN
,
(
_GLUfuncptr
)
tess_callback_begin
);
gluTessCallback
(
tess
,
GLU_TESS_END
,
tess_callback_end
);
p
gluTessCallback
(
tess
,
GLU_TESS_VERTEX
,
(
_GLUfuncptr
)
tess_callback_vertex
);
p
gluTessCallback
(
tess
,
GLU_TESS_BEGIN
,
(
_GLUfuncptr
)
tess_callback_begin
);
p
gluTessCallback
(
tess
,
GLU_TESS_END
,
tess_callback_end
);
}
LEAVE_GL
();
...
...
@@ -430,17 +485,17 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
ENTER_GL
();
glNewList
(
listBase
++
,
GL_COMPILE
);
gluTessBeginPolygon
(
tess
,
NULL
);
p
gluTessBeginPolygon
(
tess
,
NULL
);
pph
=
(
TTPOLYGONHEADER
*
)
buf
;
while
((
BYTE
*
)
pph
<
buf
+
needed
)
{
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
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
pph
+
sizeof
(
*
pph
));
...
...
@@ -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
);
fixed_to_double
(
ppc
->
apfx
[
i
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
}
break
;
...
...
@@ -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
+
1
].
x
.
value
,
ppc
->
apfx
[
i
*
3
+
1
].
y
.
value
);
fixed_to_double
(
ppc
->
apfx
[
i
*
2
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
fixed_to_double
(
ppc
->
apfx
[
i
*
2
+
1
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
p
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
}
break
;
default:
ERR
(
"
\t\t
curve type = %d
\n
"
,
ppc
->
wType
);
gluTessEndContour
(
tess
);
p
gluTessEndContour
(
tess
);
goto
error_in_list
;
}
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
ppc
+
sizeof
(
*
ppc
)
+
(
ppc
->
cpfx
-
1
)
*
sizeof
(
POINTFX
));
}
gluTessEndContour
(
tess
);
p
gluTessEndContour
(
tess
);
pph
=
(
TTPOLYGONHEADER
*
)((
char
*
)
pph
+
pph
->
cb
);
}
error_in_list:
gluTessEndPolygon
(
tess
);
p
gluTessEndPolygon
(
tess
);
glTranslated
((
GLdouble
)
gm
.
gmCellIncX
/
em_size
,
(
GLdouble
)
gm
.
gmCellIncY
/
em_size
,
0
.
0
);
glEndList
();
LEAVE_GL
();
...
...
@@ -498,7 +553,7 @@ error_in_list:
error:
DeleteObject
(
SelectObject
(
hdc
,
old_font
));
gluDeleteTess
(
tess
);
p
gluDeleteTess
(
tess
);
return
TRUE
;
}
...
...
@@ -676,6 +731,7 @@ static BOOL process_attach(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_disabled_extensions
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment